@extends('layouts.examiner') @section('title', 'Attendance') @section('content')

Attendance

{{-- Flash messages --}} @if(session('success'))
{!! session('success') !!}
@endif @if(session('error'))
{!! session('error') !!}
@endif
{{-- LEFT: Search / Candidate card --}}
Check In Candidate
{{-- Step 1: Search form --}}
@if($candidate) {{-- Step 2: Candidate card --}}
Passport
@if($schedule) @endif
Name{{ trim("{$candidate->surname} {$candidate->firstname} {$candidate->othernames}") }}
Reg No{{ $candidate->reg_no }}
Department{{ optional($candidate->department)->name ?? '—' }}
Programme{{ optional($candidate->programme)->name ?? '—' }}
Degree{{ optional($candidate->degree)->name ?? '—' }}
Venue{{ $schedule->venue ?? '—' }}
Exam Time{{ $schedule->time ?? '—' }}
Exam Status @if($examStatus === 'Finished') {{ $examStatus }} @elseif($examStatus === 'Currently Logged In') {{ $examStatus }} @else {{ $examStatus }} @endif @if($exam)
Start: {{ $exam->started_at ? \Carbon\Carbon::parse($exam->started_at)->format('H:i:s') : '—' }}  |  Stop: {{ $exam->stopped_at ? \Carbon\Carbon::parse($exam->stopped_at)->format('H:i:s') : '—' }} @endif
@if(! $existing) {{-- Not yet checked in → show Check In button --}}
@csrf Go Back
@else {{-- Already checked in --}}
Already checked in.
Date/Time: {{ \Carbon\Carbon::parse($existing->time)->format('d M Y H:i:s') }}
Checked by: {{ $existing->checked_by }}
Go Back @if(auth('web')->user()->type === 'admin')
@csrf
@endif
@endif @endif {{-- end $candidate --}}
{{-- RIGHT: Attendance list --}}
Attendance List ({{ $attendance->total() }})
@forelse($attendance as $att) @empty @endforelse
# Reg No Name Department Time Checked By
{{ $attendance->firstItem() + $loop->index }} {{ $att->reg_no }} {{ $att->name }} {{ $att->department }} {{ $att->time ? \Carbon\Carbon::parse($att->time)->format('H:i:s') : '—' }} {{ $att->checked_by }}
@csrf @method('DELETE')
No attendance records yet.
{{ $attendance->links() }}
@endsection @section('scripts') @endsection