@extends('layouts.examiner') @section('title', $term ? "Search: {$term}" : 'Search Candidates') @section('content')

@if($term) Search Results for “{{ $term }}” @else Search Candidates @endif

@if(session('success'))
{{ session('success') }}
@endif
@forelse($candidates as $i => $cand) @php $status = $cand->candidateStatus; $score = ''; $myStatus = $status->status ?? ''; if ($status && $myStatus !== 'pending') { $score = $status->score; } // Fallback to results table if no status record if (! $status) { $result = \App\Models\Result::where('reg_no', $cand->reg_no)->first(); $score = $result->score ?? ''; } @endphp @empty @endforelse
S/N REG. NO. NAME SEX DEPARTMENT PROGRAMME JAMB SCORE SCORE
{{ $i + 1 }} {{ $cand->reg_no }} {{ $cand->full_name }} {{ strtoupper(substr($cand->gender ?? '', 0, 1)) ?: '—' }} {{ optional($cand->department)->name ?? '—' }} {{ optional($cand->programme)->name ?? '—' }} {{ $cand->jamb_score ?? '—' }} {{ $score !== '' ? $score : '—' }}
@if($term) No candidates found for “{{ $term }}”. @else Use the search box in the top bar to find candidates. @endif
{{-- Delete confirmation modal --}} @endsection @push('scripts') @endpush