@extends('user.app')
@section('main-content')
<div class="banner-part">
   <img src="{{ asset('user/images/inner-ban1.jpg') }}" alt="">    
    <div class="inner-ban-tx">
        <h2>{{$course->package_name}}</h2>
    </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->mention_details) { @endphp
                        {{ strip_tags( html_entity_decode(stripslashes($course->mention_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="foundation.php"> {{$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
                        <a href="{{ url('login') }}" class="add-acte">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="{{ url('login') }}" class="add-acte">Add to Wishlist</a>
                    @endif
                </div>
            </div>
            <div class="col-md-12 cources_details_wrap">
                <div class="row">
                     <div class="col-md-6 Course-Details">
                       <h3>Course Details</h3>

                               <div class="clearfix"></div>
                        <ul>

                            @php if( $course->degree) { @endphp
                                <li>
                                    @foreach($degrees as $degree)
                                        @php if($course->degree==$degree->id) { @endphp
                                            <span>Degree : </span> {{$degree->name  }}
                                        @php }  @endphp 
                                    @endforeach
                                </li>
                                @php } @endphp
                                @php if( $course->level) { @endphp
                                    <li>
                                        @foreach($levels as $level)
                                            @php if($course->degree==$level->id) { @endphp
                                                <span>Level : </span> {{$level->name  }}
                                            @php }  @endphp 
                                        @endforeach
                                    </li>
                                @php } @endphp
                                @php if( $course->subject) { @endphp
                                    <li>
                                        @foreach($subjects as $subject)
                                            @php if($course->subject==$subject->id) { @endphp
                                                <span>Subject : </span> {{$subject->name  }}
                                            @php }  @endphp 
                                        @endforeach
                                    </li>
                                @php } @endphp
                                @php if( $course->recording) { @endphp
                                    <li>
                                       <span>Recording : </span> {{$course->recording  }}
                                    </li>
                                @php } @endphp

                                @php if( $course->syllabus) { @endphp
                                    <li>
                                       <span>Syllabus : </span> {{$course->syllabus  }}
                                    </li>
                                @php } @endphp

                                @php if( $course->format) { @endphp
                                    <li>
                                       <span>Format : </span> {{$course->format  }}
                                    </li>
                                @php } @endphp
                                @php if( $course->material_by) { @endphp
                                    <li>
                                       <span>Material by : </span> {{$course->material_by  }}
                                    </li>
                                @php } @endphp


                                 @php if( $course->hard_copy) { @endphp
                                    <li>
                                       <span>hard_copy : </span> {{$course->hard_copy  }}
                                    </li>
                                @php } @endphp

                                @php if( $course->applicable_for_attempt) { @endphp
                                    <li>
                                       <span>Applicable for attempt : </span> {{$course->applicable_for_attempt  }}
                                    </li>
                                @php } @endphp
                              {{--   @php if( $course->faculty_name) { @endphp
                                    <li>
                                        @foreach($educators as $educator)
                                         @php if($course->faculty_name==$educator->id) { @endphp
                                                <span>Faculty : </span> {{$educator->coaching_classes  }}
                                            @php }  @endphp  
                                        @endforeach
                                    </li>
                                @php } @endphp --}}
                                @php if( $course->lectures_no) { @endphp
                                    <li>
                                       <span>Lectures_no : </span> {{$course->lectures_no  }}
                                    </li>
                                @php } @endphp
                                @php if( $course->hours_no) { @endphp
                                    <li>
                                       <span>Hours  : </span> {{$course->hours_no  }}
                                    </li>
                                @php } @endphp
                                @php if( $course->video_language) { @endphp
                                    <li>
                                       <span>Video Language : </span> {{$course->video_language  }}
                                    </li>
                                @php } @endphp
                                @php if( $course->lectures_view) { @endphp
                                    <li>
                                       <span>Lectures view  : </span> {{$course->lectures_view  }}
                                    </li>
                                @php } @endphp
                                @php if( $course->fast_forward) { @endphp
                                    <li>
                                       <span>Fast Forward : </span> {{$course->fast_forward  }}
                                    </li>
                                @php } @endphp
                                @php if( $course->fast_forward_details) { @endphp
                                    <li>
                                       <span>Fast Forward Details  : </span> {{$course->fast_forward_details  }}
                                    </li>
                                @php } @endphp

                                @php if( $course->expire_validity) { @endphp
                                    <li>
                                       <span>Expire Validity : </span> {{$course->expire_validity  }}
                                    </li>
                                @php } @endphp
                                @php if( $course->topics_covered) { @endphp
                                    <li>
                                       <span>Topics Covered  : </span> {{$course->topics_covered  }}
                                    </li>
                                @php } @endphp
                                @php if( $course->doubt_clearing_availability) { @endphp
                                    <li>
                                       <span>Doubt Clearing Availability : </span> {{$course->doubt_clearing_availability  }}
                                    </li>
                                @php } @endphp
                                @php if( $course->amendmend) { @endphp
                                    <li>
                                       <span>Amendmend  : </span> {{$course->amendmend  }}
                                    </li>
                                @php } @endphp

                                @php if( $course->video_run_on) { @endphp
                                    <li>
                                       <span>Video run on : </span> {{$course->video_run_on  }}
                                    </li>
                                @php } @endphp
                              {{--   @php if( $course->mention_details) { @endphp
                                    <li>
                                       <span>Mention details  : </span>  {{ strip_tags( html_entity_decode(stripslashes($course->mention_details),ENT_QUOTES,"UTF-8") ) }}
                                    </li>
                                @php } @endphp --}}
                                @php if( $course->charts_details) { @endphp
                                    <li>
                                       <span>Charts details : </span> {{ strip_tags( html_entity_decode(stripslashes($course->charts_details),ENT_QUOTES,"UTF-8") ) }} 
                                    </li>
                                @php } @endphp
                                @php if( $course->dispatch) { @endphp
                                    <li>
                                       <span>Dispatch  : </span> {{$course->dispatch  }}
                                    </li>
                                @php } @endphp
                                @php if( $course->dispatch_schedule) { @endphp
                                    <li>
                                       <span>Dispatch Schedule : </span>
                                         {{ strip_tags( html_entity_decode(stripslashes($course->dispatch_schedule),ENT_QUOTES,"UTF-8") ) }}
                                    </li>
                                @php } @endphp
                                @php if( $course->lectures_link) { @endphp
                                    <li>
                                       <span>Lectures link  : </span> {{$course->lectures_link  }}
                                    </li>
                                @php } @endphp
                                @php if( $course->books_images_link) { @endphp
                                    <li>
                                       <span>Books images link : </span> {{$course->books_images_link  }}
                                    </li>
                                @php } @endphp
                                @php if( $course->other_details) { @endphp
                                    <li>
                                       <span>Other details  : </span>   {{ strip_tags( html_entity_decode(stripslashes($course->other_details),ENT_QUOTES,"UTF-8") ) }}
                                    </li>
                                @php } @endphp
                               
                            </ul>
                        </div>
                         <div class="col-md-6 Course-Details">
                              <h3>Related Courses</h3>

                               <div class="clearfix"></div>

                                <div class="online-courses">

                                    @if(isset($relatedcources))

                                        @foreach($relatedcources as $value)
                                        @php 
                                            if($course->id == $value->id ) continue; 
                                        @endphp
                                        <div class="item">

                                            <div class="card">

                                                    @php 

                                                    $photos =array();

                                                    if( !empty($value->product_image))
                                                    {
                                                        $photos = unserialize( $value->product_image);

                                                        if(count($photos)>0)

                                                        {

                                                            $img_path=url('/logo/'.$photos['product_image']); 
                                                            echo '<img class="card-img-top"  src="'.$img_path.'">';

                                                        }
                                                    }                             

                                                    @endphp

                                                <div class="card-body">

                                                   <h3>{{ substr($value->package_name,0,38) }}..</h3>

                                                   {{-- <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi, nisi ratione illo. </p> --}}

                                                   <h4 class="cross-t">

                                                       <del> Rs.{{ $value->price }}</del>
                                                       Rs.{{ $value->discounted_price }}
                                                   </h4>
                                                   

                                                </div>  

                                                <a href="{{url('/')}}/enrol/{{ $value->slug }}">add to cart</a>                     

                                            </div>

                                        </div>

                                        @endforeach

                                    @endif

                                </div>
                           
                         </div>
                    </div>
                </div>
            </div>
    </div>
</section>
<div class="clearfix"></div>

@endsection