@extends('app') @section('title', ucwords(__('profile'))) @section('head') @endsection @section('content')

{!!strtoupper(__('my account'))!!}

@include("includes/front_alerts")

{{strtoupper(__('personal information'))}}

{{ucfirst(__('name'))}}
{{ $profile->first_name.' '.$profile->middle_name.' '.$profile->last_name }}
{{ucfirst(__('email'))}}
{{ $profile->email }}
{{ucwords(__('date of birth'))}}
{{ $profile->dob }}
{{ucfirst(__('phone'))}}
{{ $profile->contact }}
@if($profile->purchases->where('course_id',\App\Courses::TABCFAST)->first())
{{ucwords(__('social security number'))}}
{{ $profile->ssn }}
@endif
{{ucwords(__('address'))}}s
{{ $profile->address }}
{{ucwords(__('employer'))}}
{{ $profile->eof }}
{{ucwords(__('your title'))}}
{{ $profile->title }}
Default 2
@if(true || $profile->purchases->count() > 0)
@foreach( $courses->sortBy('course_id') as $purchase ) @php $course = $purchase; $active = null; if($purchase instanceof \App\Purchases){ $course = $purchase->course; //check if there is a current certificate for the user $active = $profile->purchases()->whereHas('course',function($q)use($course){ $q->where('course_id',$course->id); })->where(function($q){ $q->whereNotNull('user_purchases.certificate_id')->where('expiry_date','>',date('Y-m-d')); })->where('user_purchases.id','!=',$purchase->id) ->leftJoin('assigned_certificates as ac','user_purchases.certificate_id','=','ac.assigned_id') ->orderBy('user_purchases.id','desc') ->first(); } @endphp @if($course->timer == 1)
@foreach ($course->chapters as $chapter) @endforeach
{{strtoupper(__('chapters'))}} {{strtoupper(__('progress'))}}
Chapter {{ $i++ }} – {{ $chapter->getAttributes()['name'] }} @foreach ($courses_progress as $progress) @if($progress->chapter_id == $chapter->getAttributes()['chapter_id']) {{ $progress->progress }} % @endif @endforeach
@else @php $course_token = null; $all_chapters = $course->chapters->pluck('chapter_id')->toArray(); $chapter_id = null; if($purchase instanceof \App\Purchases){ $chapter_id = $courses_progress->whereIn('chapter_id',$all_chapters)->where('user_purchase_id',$purchase->id)->where('progress',100)->max('chapter_id'); $course_token = $purchase->course_token; }else{ $chapter_id = $courses_progress->whereIn('chapter_id',$all_chapters)->where('progress',100)->max('chapter_id'); } $max_chapter = $course->chapters->max('chapter_id'); $nex_chapter = null; if($chapter_id < $max_chapter){ $pos = array_search($chapter_id,$all_chapters); if($pos!==false){ $pos++; $nex_chapter =$all_chapters[$pos]; } } @endphp {{--If they have no chapters then they show the introduction--}}

{{ str_replace(['tabc'],['TABC'],preg_replace('/course/i','',$course->title)) }} Course

{!!$course->tag_line!!}
@if(false && $active)
{{ucfirst(__('you have an active certificate that expires on'))}} {{ date('F d, Y',strtotime($active->expiry_date)) }}
@endif @if(empty($chapter_id)) {{ucwords(__('begin course'))}} {{--If they have finished all the chapters the show the exam--}} @elseif($chapter_id == $max_chapter) {{ucwords(__('take exam'))}} @elseif($chapter_id == 'cleared') @else Current Chapter: {{ $course->chapters->where('chapter_id',$nex_chapter)->first()['name'] }} {{ucwords(__('continue cours'))}}e @endif
@endif @endforeach {{--Show any course that the user doesnt have.--}} @if(!empty($available_courses)) @foreach($available_courses->sortBy('course_id') as $course) @php //check if there are any certs that have not expired yet for the $active = $profile->purchases()->whereHas('course',function($q)use($course){ $q->where('course_id',$course->id); })->where(function($q){ $q->whereNotNull('user_purchases.certificate_id')->where('expiry_date','>',date('Y-m-d')); })->leftJoin('assigned_certificates as ac','user_purchases.certificate_id','=','ac.assigned_id') ->orderBy('user_purchases.id','desc') ->first(); @endphp

{{ preg_replace('/course/i','',$course->title) }} Course

{!! $course->tag_line !!}
@if($active)
{{ucfirst(__('you have an active certificate that expires on'))}} {{ date('F d, Y',strtotime($active->expiry_date)) }}
@endif {{ucwords(__('signup for this course'))}}.
@endforeach() @endif
{{--Show any course that the user doesnt have.--}} @else
@foreach ($courses->chapters as $chapter) @endforeach
{{strtoupper(__('chapters'))}} {{strtoupper(__('progress'))}}
Chapter {{ $i++ }} – {{ $chapter->getAttributes()['name'] }} @foreach ($courses_progress as $progress) @if($progress->chapter_id == $chapter->getAttributes()['chapter_id']) {{ $progress->progress }} % @endif @endforeach
@endif
@foreach ($certificates as $certificate) @endforeach
{{strtoupper(__('issued date'))}} {{strtoupper(__('exp.date'))}} {{strtoupper(__('certificate number'))}} {{strtoupper(__('status'))}}
{{$certificate->assigned_date }} {{$certificate->expiry_date }} {{$certificate->certificate_number }} $certificate->certificate_name,'action'=>'view']) }}'>{{ucfirst(__('certificate'))}}
@endsection @section('foot') @endsection