{{-- resources/views/concours_ext/pdf.blade.php --}} @php $lang = $locale ?? app()->getLocale(); $direction = ($lang === 'ar') ? 'rtl' : 'ltr'; $textAlign = $direction === 'rtl' ? 'right' : 'left'; // color used in model $accent = '#c62828'; // creation label/value (will be shown on top of candidate info) $createdLabel = __('site.table_created_at'); $createdValue = optional($candidate->created_at)->format('Y-m-d') ?? '—'; $statusLabel = __('site.table_status'); // prepare fields excluding created_at AND status so they won't appear twice $allFieldsFiltered = array_values(array_filter($allFields ?? [], function($f) use ($createdLabel, $statusLabel) { if (!isset($f['label'])) return true; return !in_array($f['label'], [$createdLabel, $statusLabel]); })); @endphp {{ trans_field($concours, 'titre') }} - {{ __('site.concours_results_title') }} {{-- HEADER --}}
@if(file_exists(public_path('storage/logo.png'))) @endif

{{ __('site.republic') }}

{{ __('site.ministry') }}

{{ $concours->titre ?? ($concours->titre_fr ?? $concours->titre_en ?? $concours->titre_ar ?? '') }}

{{-- CANDIDATE INFO SECTION --}}

{{ __('site.candidate_info') }}

{{-- Created date + Status ONLY HERE --}}
{{ $createdLabel }} : {{ $createdValue }}
{{ __('site.table_status') }} {{ $candidate->etat_label ?? $candidate->etat ?? '—' }}
{{-- Render remaining fields two-per-row (excluded created_at + status already) --}} @php $chunks = array_chunk($allFieldsFiltered, 2); @endphp @foreach($chunks as $pair)
@foreach($pair as $f)
{{ $f['label'] }} {!! nl2br(e($f['value'] ?? '—')) !!}
@endforeach {{-- If single item in last row, keep layout consistent --}} @if(count($pair) === 1) @endif
@endforeach
{{-- UPLOADED FILES (if any) --}} @if($candidate->files && $candidate->files->count())

{{ __('site.uploaded_files') }}

@foreach($candidate->files as $file) @endforeach
{{ __('site.file_name') }} {{ __('site.file_size') }}
{{ $file->original_name }} {{ intval($file->size / 1024) }} KB
@endif