@extends('user.app')
@php $meta_title = trim($course->meta_title); @endphp
@section('pagetitle'){{ ($meta_title) ? $meta_title : $course->package_name }}@stop
@section('pagedescription')
@php $meta_details = trim($course->meta_details); @endphp
<meta name="description" content="{{ $meta_details }}">
@stop
@section('pagekeywords')
@php $meta_tags = trim($course->meta_tags); @endphp
<meta name="keywords" content="{{ $meta_tags }}">
@stop
@section('main-content')
<div class="banner-part">
  <img src="{{ asset('user/images/inner-ban1.jpg') }}" alt="">
  <div class="inner-ban-tx">
    <div class="container">
      <div class="row">
        <h2>{{$course->package_name}}</h2>
        
        <ul class="breadcrumbs">
          @php
          echo '<li><a href="'.url('/').'">Home</a></li>';
          echo '<li><a href="'.url('/').'/course/'.$selecteddegree->slug.'">'.$selecteddegree->name.'</a></li>';
          echo '<li><a href="'.url('/').'/course/'.$selectedlevel->slug.'">'.$selectedlevel->name.'</a></li>';
          echo '<li><a  href="'.url('/').'/course/'.$selectedsubject->slug.'">'.$selectedsubject->name.'</a></li>';
          echo '<li class="selected">'.$course->package_name.'</li>';
          
          @endphp
        </ul>
      </div>
    </div>
  </div>
</div>
<section class="single-page">
  <div class="container">
    <div class="row">
      <div class="col-md-5 main-pro">
        @php
        $photos =array();
        if( !empty($course->product_image))
        {
        $photos = unserialize( $course->product_image);
        if(count($photos)>0)
        {
        
        $img_path=url('/logo/'.$photos['product_image']);
        echo '<img src="'.$img_path.'" width="100px">';
        }
        
        }
        @endphp
      </div>
      <div class="col-md-7 pro-decp">
        <h2>{{$course->package_name}}</h2>
        {{-- <h3>CA Final New FR, SFM, Audit And Law Combo Course By AS Foundation In Google Drive</h3> --}}
        <p>
          @php if( $course->product_details) { @endphp
          {{ strip_tags( html_entity_decode(stripslashes($course->product_details),ENT_QUOTES,"UTF-8") ) }}
          @php } @endphp
        </p>
        <h5>Instructed by
        @php if( $course->faculty_name) { @endphp
        
        @foreach($educators as $educator)
        @php if($course->faculty_name==$educator->id) { @endphp
        <a href="{{url('/')}}/educator/{{ $educator->slug }}"> {{$educator->coaching_classes  }} </a>
        @php }  @endphp
        @endforeach
        
        @php } @endphp
        {{-- <i class="fas fa-users"></i> 1000 students enrolled --}}
        </h5>
        <div class="price">
        <h2><del>{{ ($course->price) ? 'Rs.'.$course->price : ''  }}</del></span> {{ ($course->discounted_price) ? 'Rs.'.$course->discounted_price : ''  }}</h2>
        @php
        $pcartprice =0;
        $pcartprice = ($course->discounted_price) ? $course->discounted_price : $course->price;
        
        @endphp
        @if (Auth::check())
        {!! Form::open(array('route' => 'cart.store', 'class' => 'form' ,'id' =>'createroomsform','files' => true)) !!}
        {{ Form::hidden('product_id', $course->id) }}
        {{ Form::hidden('user_id',Auth::user()->id ) }}
        {{ Form::hidden('name', $course->package_name) }}
        {{ Form::hidden('quantity', 1) }}
        {{ Form::hidden('price', $pcartprice) }}
        {!! Form::submit('Take This Course',
        array('class'=>'add-acte')) !!}
        {!! Form::close() !!}
        @else
        {{-- //{{ url('login') }} --}}
        <a  href=""  onClick="return false;"  class="add-acte add-acte-cart" pid="{{$course->id}}">Take This Course</a>
        @endif
        @if (Auth::check())
        {!! Form::open(array('route' => 'wishlist.store', 'class' => 'form' ,'id' =>'createroomsform','files' => true)) !!}
        {{ Form::hidden('product_id', $course->id) }}
        {{ Form::hidden('user_id',Auth::user()->id ) }}
        {{ Form::hidden('name', $course->package_name) }}
        {{ Form::hidden('quantity', 1) }}
        {{ Form::hidden('price', $pcartprice) }}
        {!! Form::submit('Add to Wishlist',
        array('class'=>'add-acte')) !!}
        {!! Form::close() !!}
        @else
        <a   href="" onClick="return false;"  class="add-acte add-acte-wishlist" pid="{{$course->id}}">Add to Wishlist</a>
        @endif
      </div>
    </div>
    <div class="col-md-12 cources_details_wrap">
      <div class="row">
        <div class="col-md-7">
          <div class="Course-Details">
            <h3>Course Details</h3>
            <div class="clearfix"></div>
            <table class="coursetable">
              @php if( $course->degree) { @endphp
              <tr>
                @foreach($degrees as $degree)
                @php if($course->degree==$degree->id) { @endphp
                <td><span>Degree : </span></td><td> {{$degree->name  }}</td>
                @php }  @endphp
                @endforeach
              </tr>
              @php } @endphp
              @php if( $course->level) { @endphp
              <tr>
                @foreach($levels as $level)
                @php if($course->level==$level->id) { @endphp
                <td><span>Level : </span></td><td> {{$level->name  }}</td>
                @php }  @endphp
                @endforeach
              </tr>
              @php } @endphp
              @php if( $course->subject) { @endphp
              <tr>
                @foreach($subjects as $subject)
                @php if($course->subject==$subject->id) { @endphp
                <td><span>Subject : </span></td><td> {{$subject->name  }}</td>
                @php }  @endphp
                @endforeach
              </tr>
              @php } @endphp
              @php if( $course->recording) { @endphp
              <tr>
                <td><span>Recording : </span></td><td> {{$course->recording  }}</td>
              </tr>
              @php } @endphp
              @php if( $course->syllabus) { @endphp
              <tr>
                <td><span>Syllabus : </span></td><td> {{$course->syllabus  }}</td>
              </tr>
              @php } @endphp
              @php if( $course->format) { @endphp
              <tr>
                <td><span>Format : </span></td><td> {{$course->format  }}</td>
              </tr>
              @php } @endphp
              @php if( $course->material_by) { @endphp
              <tr>
                <td><span>Material by : </span></td><td> {{$course->material_by  }}</td>
              </tr>
              @php } @endphp
              @php if( $course->hard_copy) { @endphp
              <tr>
                <td><span>Hard Copy : </span></td><td> {{$course->hard_copy  }}</td>
              </tr>
              @php } @endphp
              @php if( $course->applicable_for_attempt) { @endphp
              <tr>
                <td><span>Applicable for attempt : </span></td><td> {{$course->applicable_for_attempt  }}</td>
              </tr>
              @php } @endphp
              {{--   @php if( $course->faculty_name) { @endphp
              <tr>
                @foreach($educators as $educator)
                @php if($course->faculty_name==$educator->id) { @endphp
                <td><span>Faculty : </span></td><td> {{$educator->coaching_classes  }}</td>
                @php }  @endphp
                @endforeach
              </tr>
              @php } @endphp --}}
              @php if( $course->lectures_no) { @endphp
              <tr>
                <td><span>Lectures_no : </span></td><td> {{$course->lectures_no  }}</td>
              </tr>
              @php } @endphp
              @php if( $course->hours_no) { @endphp
              <tr>
                <td><span>Hours  : </span></td><td> {{$course->hours_no  }}</td>
              </tr>
              @php } @endphp
              @php if( $course->video_language) { @endphp
              <tr>
                <td><span>Video Language : </span></td><td> {{$course->video_language  }}</td>
              </tr>
              @php } @endphp
              @php if( $course->lectures_view) { @endphp
              <tr>
                <td><span>Lectures view  : </span></td><td> {{$course->lectures_view  }}</td>
              </tr>
              @php } @endphp
              @php if( $course->fast_forward) { @endphp
              <tr>
                <td><span>Fast Forward : </span></td><td> {{$course->fast_forward  }}</td>
              </tr>
              @php } @endphp
              @php if( $course->fast_forward_details) { @endphp
              <tr>
                <td><span>Fast Forward Details  : </span></td><td> {{$course->fast_forward_details  }}</td>
              </tr>
              @php } @endphp
              @php if( $course->expire_validity) { @endphp
              <tr>
                <td><span>Validity : </span></td><td> {{$course->expire_validity  }}</td>
              </tr>
              @php } @endphp
              @php if( $course->topics_covered) { @endphp
              <tr>
                <td><span>Topics Covered  : </span></td><td> {{$course->topics_covered  }}</td>
              </tr>
              @php } @endphp
              @php if( $course->doubt_clearing_availability) { @endphp
              <tr>
                <td><span>Doubt Clearing Availability : </span></td><td> {{$course->doubt_clearing_availability  }}</td>
              </tr>
              @php } @endphp
              @php if( $course->amendmend) { @endphp
              <tr>
                <td><span>Amendments  : </span></td><td> {{$course->amendmend  }}</td>
              </tr>
              @php } @endphp
              @php if( $course->video_run_on) { @endphp
              <tr>
                <td><span>Video run on : </span></td><td> {{$course->video_run_on  }}</td>
              </tr>
              @php } @endphp
              @php if( $course->mention_details) { @endphp
              <tr>
                <td><span>Test Series Provided  : </span></td><td>
              {{ strip_tags( html_entity_decode(stripslashes( $course->mention_details ),ENT_QUOTES,"UTF-8") ) }}</td>
            </tr>
            @php } @endphp
            @php if( $course->charts_details) { @endphp
            <tr>
              <td><span>Charts details : </span></td><td> {{ strip_tags( html_entity_decode(stripslashes($course->charts_details),ENT_QUOTES,"UTF-8") ) }} </td>
            </tr>
            @php } @endphp
            @php if( $course->dispatch) { @endphp
            <tr>
              <td><span>Dispatch  : </span></td><td> {{$course->dispatch  }}</td>
            </tr>
            @php } @endphp
            @php if( $course->dispatch_schedule) { @endphp
            <tr>
              <td><span>Dispatch Schedule : </span></td><td>
              {!! $course->dispatch_schedule !!}
            </td>
          </tr>
          @php } @endphp
          
          @php if( $course->books_images_link) { @endphp
          <tr>
            <td><span>Books images link : </span></td><td> {{$course->books_images_link  }}</td>
          </tr>
          @php } @endphp
          @php if( $course->other_details) { @endphp
          <tr>
            <td><span>Other details  : </span></td><td> {!! $course->other_details !!}</td>
          </tr>
          @php } @endphp
          
        </table>
        
        @php if( $course->lectures_link) { @endphp
        <h3>Demo Video</h3>
        <iframe width="100%" height="315"
        src="https://www.youtube.com/embed/{{$course->lectures_link }}">
        </iframe>
        
        @php } @endphp
      </div>
    </div>
    <div class="col-md-5">
      <div class="Course-Details">
        <h3>Related Courses</h3>
        <div class="clearfix"></div>
        @if(isset($relatedcources))
        @foreach($relatedcources as $value)
        @php
        if($course->id == $value->id ) continue;
        @endphp
        <div class="relcourse">
          <div class="col-md-4">
            @php
            $photos =array();
            if( !empty($value->product_image))
            {
            $photos = unserialize( $value->product_image);
            if(count($photos)>0)
            {
            $img_path=url('/logo/'.$photos['product_image']);
            @endphp
            <a href="{{url('/')}}/enrol/{{ $value->slug }}" class="prlink"><img class="card-img-top"  src="{{ $img_path }}"></a>
            @php
            }
            }
            @endphp
          </div>
          <div class="col-md-8">
            <div class="card-body">
              <h3><a href="{{url('/')}}/enrol/{{ $value->slug }}" class="prlink">{{ $value->package_name }}</a></h3>
              
              @foreach($educators as $educator)
              {{-- {{ $educator->id }} --}}
              
              @if($value->faculty_name==$educator->id )
              <h4>By <a href="{{url('/')}}/educator/{{ $educator->slug }}" class="educatorlink">{{$educator->coaching_classes}}</a></h4>
              @endif
              @endforeach
              <!-- <h4> By <a href="#" class="educatorlink">Educator</a></h4> -->
              <h4 class="cross-t">
              <del> Rs.{{ $value->price }}</del>
              Rs.{{ $value->discounted_price }}
              </h4>
              
              <!-- <a href="{{url('/')}}/enrol/{{ $value->slug }}">add to cart</a> -->
            </div>
            
          </div>
        </div>
        @endforeach
        @endif
      </div>
    </div>
  </div>
</div>
</div>
</div>
</section>
<div class="clearfix"></div>
@endsection