@extends(getTemplate() .'.panel.layouts.panel_layout')
@push('styles_top')
@endpush
@section('content')
{{ trans('quiz.certificate_unified_hint') }}{{ trans('quiz.filter_certificates') }}
{{ trans('quiz.my_certificates') }}
@foreach($allCertificates as $cert)
@php
$ctype = $cert->certificate_type ?? 'old';
@endphp
{{ trans('quiz.certificate_column_type') }}
{{ trans('quiz.certificate_column_subject') }}
{{ trans('quiz.certificate_column_grade_or_sn') }}
{{ trans('public.certificate_id') }}
{{ trans('public.date') }}
@endforeach
@if($ctype === 'old')
@if($cert->type === 'course')
{{ trans('quiz.certificate_kind_course') }}
@elseif($cert->type === 'quiz')
{{ trans('quiz.certificate_kind_quiz') }}
@elseif($cert->type === 'imtmontessori')
{{ trans('quiz.certificate_kind_montessori') }}
@else
{{ $cert->type }}
@endif
@elseif($ctype === 'new')
{{ trans('quiz.certificate_kind_template') }}
@elseif($ctype === 'last')
{{ trans('quiz.certificate_kind_generated') }}
@endif
@if($ctype === 'old')
@if($cert->type === 'quiz' && !empty($cert->quiz))
{{ $cert->quiz->webinar ? $cert->quiz->webinar->title : $cert->quiz->title }}
@elseif($cert->webinar)
{{ $cert->webinar->title }}
@else
—
@endif
@elseif($ctype === 'new')
{{ $cert->course_name ?? optional($cert->template)->title ?? '—' }}
@elseif($ctype === 'last')
{{ $cert->template_name ?? trans('quiz.certificate_kind_generated') }}
@endif
@if($ctype === 'old')
@if(!empty($cert->user_grade))
{{ $cert->user_grade }}%
@elseif(!empty($cert->serial_number))
{{ $cert->serial_number }}
@else
—
@endif
@elseif($ctype === 'new')
{{ $cert->serial_number ?? '—' }}
@else
—
@endif
{{ $cert->id }}
@if($ctype === 'old')
{{ dateTimeFormat($cert->created_at, 'j M Y') }}
@elseif($ctype === 'new')
@if(!empty($cert->completion_date))
{{ $cert->completion_date instanceof \Carbon\Carbon ? dateTimeFormat($cert->completion_date->timestamp, 'j M Y') : dateTimeFormat(strtotime((string)$cert->completion_date), 'j M Y') }}
@else
—
@endif
@elseif($ctype === 'last')
@if(!empty($cert->generated_at))
{{ dateTimeFormat($cert->generated_at instanceof \Carbon\Carbon ? $cert->generated_at->timestamp : strtotime((string)$cert->generated_at), 'j M Y') }}
@else
—
@endif
@endif
@if($ctype === 'old')
@if($cert->type === 'quiz' && !empty($cert->quiz_result_id))
{{ trans('quiz.certificate_download') }}
@elseif($cert->type === 'course' && !empty($cert->webinar_id))
{{ trans('quiz.certificate_download') }}
@elseif($cert->type === 'imtmontessori')
{{ trans('quiz.certificate_download') }}
@else
{{ trans('quiz.certificate_pending_file') }}
@endif
@elseif($ctype === 'new')
@if(!empty($cert->generated_image_path))
{{ trans('quiz.certificate_download') }}
@else
{{ trans('quiz.certificate_pending_file') }}
@endif
@elseif($ctype === 'last')
@if(!empty($cert->image_path))
{{ trans('quiz.certificate_download') }}
@else
{{ trans('quiz.certificate_pending_file') }}
@endif
@endif