@extends('layout.layout') @section('content') @include('components.alert') @php $teacherName = trim(($teacher->first_name ?? '') . ' ' . ($teacher->last_name ?? '')) ?: 'N/A'; $pageDescription = $absenceDate ? 'Detailed absence records for ' . \Carbon\Carbon::parse($absenceDate)->format('Y-m-d') . '.' : 'Inspect each missed session for this teacher and review the handling schedules created afterward.'; @endphp
Back to List
Teacher Information

Basic teacher details and the number of absence sessions recorded.

Name {{ $teacherName }}
Email {{ $teacher->email ?? 'N/A' }}
Teacher ID {{ $teacher->id ?? 'N/A' }}
Total Absences {{ $uniqueAbsences->count() }} sessions
Selected Date {{ $absenceDate ? \Carbon\Carbon::parse($absenceDate)->format('Y-m-d') : 'All recorded dates' }}
Detailed Absence Records

Expand each record to see the missed session and the replacement handling sessions.

@if ($uniqueAbsences->isEmpty())
No absence records found.

There are no teacher absence records available for this teacher.

@else
@foreach ($uniqueAbsences as $oldSessionId => $absenceData) @php $oldSession = $absenceData['old_session']; $handlingSessions = $absenceData['handling_sessions']; @endphp

Missed Session Information
@if ($oldSession)
Session ID {{ $oldSession->id }}
Date {{ $oldSession->session_date ?? 'N/A' }}
Time {{ $oldSession->start_time ?? 'N/A' }}
Students
@forelse ($oldSession->staffScheduled?->courseStudent ?? [] as $courseStudent) {{ ($courseStudent->student->first_name ?? '') . ' ' . ($courseStudent->student->last_name ?? '') }} @empty No students @endforelse
@else

No information available.

@endif
Handling Sessions
{{ $handlingSessions->count() }}
@foreach ($handlingSessions as $handling)
Handling #{{ $loop->iteration }}
Schedule ID {{ $handling['new_staff_scheduled']->id ?? 'N/A' }}
Date {{ $handling['new_staff_scheduled']->start_date ?? 'N/A' }}
Session Type {{ $handling['new_staff_scheduled']->academyProduct->name_en ?? $handling['new_staff_scheduled']->course_name_en ?? 'N/A' }}
Created By {{ $handling['created_by']->full_name ?? 'N/A' }}
Created At {{ $handling['created_at'] ? $handling['created_at']->format('Y-m-d H:i') : 'N/A' }}
Students
@forelse ($handling['new_staff_scheduled']?->courseStudent ?? [] as $courseStudent) {{ ($courseStudent->student->first_name ?? '') . ' ' . ($courseStudent->student->last_name ?? '') }} @empty No students @endforelse
@endforeach
@endforeach
@endif
@endsection @push('styles') @endpush