@extends('admin.layout.index')
@push('css-head')
@endpush
@section('content')
<!-- Page header -->
<div class="page-header page-header-light">
    <div class="breadcrumb-line breadcrumb-line-light header-elements-md-inline">
        <div class="d-flex">
            <div class="breadcrumb">
                <a href="{{url('/admin')}}" class="breadcrumb-item"><i class="icon-home2 mr-2"></i> Dashboard</a>
                <a href="{{url('/admin/courses')}}" class="breadcrumb-item"> Courses</a>
                <span class="breadcrumb-item active">View</span>
            </div>
        </div>
    </div>
</div>
<!-- /page header -->

<!-- Content area -->
<div class="content">
    <div class="card">
        <div class="table-responsive">
            <table class="table">
                <tbody>
                    <tr>
                        <td class="font-weight-bold">Course Name:</td>
                        <td>{{ $course->name }}</td>
                    </tr>
                    <tr>
                        <td class="font-weight-bold">Length:</td>
                        <td>{{ $course->length }} months</td>
                    </tr>
                    <tr>
                        <td class="font-weight-bold">Tution Fee:</td>
                        <td>{{$course->destination->currency}}{{ $course->tution_fee }}</td>
                    </tr>
                    <tr>
                        <td class="font-weight-bold">Institute:</td>
                        <td>{{ $course->institute->name }}, {{ $course->destination->name }}</td>
                    </tr>

                    @if(count($selected_campuses) > 0)
                    <tr>
                        <td class="font-weight-bold">Campuses:</td>
                        <td>@foreach($selected_campuses as $campus) {{$campus->name}} @if(!$loop->last) , @endif @endforeach</td>
                    </tr>
                    @endif

                    <tr>
                        <td class="font-weight-bold">Level:</td>
                        <td>{{ $course->level->name }}</td>
                    </tr>

                    <tr>
                        <td class="font-weight-bold">Department:</td>
                        <td>{{ $course->department }}</td>
                    </tr>
                    
                    <tr>
                        <td class="font-weight-bold">Intakes:</td>
                        <td>@foreach($course->intakes as $intake) {{date("F", strtotime(date("Y") ."-". $intake->intake ."-01"))}} @if(!$loop->last) , @endif @endforeach</td>
                    </tr>

                    <tr>
                        <td class="font-weight-bold">IELTS:</td>
                        <td>{{ $course->ielts }}</td>
                    </tr>

                    <tr>
                        <td class="font-weight-bold">TOEFL:</td>
                        <td>{{ $course->toefl }}</td>
                    </tr>

                    <tr>
                        <td class="font-weight-bold">PTE:</td>
                        <td>{{ $course->pte }}</td>
                    </tr>

                    <tr>
                        <td class="font-weight-bold">Duolingo:</td>
                        <td>{{ $course->duolingo }}</td>
                    </tr>

                    <tr>
                        <td class="font-weight-bold">Scolarship:</td>
                        <td>{{ $course->scholarship }}</td>
                    </tr>

                    <tr>
                        <td class="font-weight-bold">Deposit Required:</td>
                        <td>{{ $course->deposit_required }}</td>
                    </tr>

                    {{-- <tr>
                        <td class="font-weight-bold">UCAS Fee:</td>
                        <td>
                            @if($course->ucas_fee == 1)
                            <span class="badge bg-success">{{ 'Yes' }}</span>
                            @else
                            <span class="badge bg-danger">{{ 'No' }}</span>
                            @endif
                        </td>
                    </tr>

                    <tr>
                        <td class="font-weight-bold">Minimum GPA:</td>
                        <td>{{ $course->min_gpa }}</td>
                    </tr> --}}
                    <tr>
                        <td class="font-weight-bold">Reference:</td>
                        <td>{{ $course->reference }}</td>
                    </tr>

                    <tr>
                        <td class="font-weight-bold">SOP:</td>
                        <td>
                            @if($course->sop == 1)
                            <span class="badge bg-success">{{ 'Yes' }}</span>
                            @else
                            <span class="badge bg-danger">{{ 'No' }}</span>
                            @endif
                        </td>
                    </tr>
                    <tr>
                        <td class="font-weight-bold">CV:</td>
                        <td>
                            @if($course->cv == 1)
                            <span class="badge bg-success">{{ 'Yes' }}</span>
                            @else
                            <span class="badge bg-danger">{{ 'No' }}</span>
                            @endif
                        </td>
                    </tr>
                    <tr>
                        <td class="font-weight-bold">Keywords:</td>
                        <td>@foreach($course->tags as $tag) {{$tag->keyword}} @if(!$loop->last) , @endif @endforeach</td>
                    </tr>

                    <tr>
                        <td class="font-weight-bold">Entry Requirements:</td>
                        <td>{!! $course->entry_requirement !!}</td>
                    </tr>

                    <tr>
                        <td class="font-weight-bold">Created at:</td>
                        <td>{{date('F j, y h:i a', strtotime($course->created_at))}}</td>
                    </tr>

                    <tr>
                        <td class="font-weight-bold">Updated at:</td>
                        <td>{{date('F j, y h:i a', strtotime($course->updated_at))}}</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
<!-- /content area -->
@endsection

@push('scripts')
@endpush