@extends('layouts.app') @section('content')

My Attendance

{{-- ✅ Summary Cards --}}
Present

{{ $totalPresent ?? 0 }}

Absent

{{ $totalAbsent ?? 0 }}

Late

{{ $totalLate ?? 0 }}

{{-- ✅ Check-In / Check-Out --}}
@if(!isset($todayAttendance))
@csrf
@elseif(!$todayAttendance->check_out_time)
@csrf
@else
You’ve completed attendance for today.
@endif
{{-- ✅ Attendance Table --}}
@forelse($attendances as $index => $att) @empty @endforelse
# Date Class Trainer Check In Check Out Status Code
{{ $attendances->firstItem() + $index }} {{ \Carbon\Carbon::parse($att->attendance_date)->format('d M Y') }} {{ $att->classRoom->name ?? 'N/A' }} {{ $att->trainer->name ?? 'N/A' }} {{ $att->check_in_time ?? '-' }} {{ $att->check_out_time ?? '-' }} {{ ucfirst($att->status) }} {{ $att->attendance_code ?? '-' }}
No attendance records found.
{{ $attendances->links('pagination::bootstrap-5') }}
@endsection