{{ \App\Models\Setting::valueOf(app()->getLocale() === 'ar' ? 'site_name_ar' : 'site_name_en') ?: \App\Models\Setting::valueOf('site_name') }}
{{ app()->getLocale() === 'ar' ? 'تقرير الحضور والغياب' : 'Attendance Report' }}
{{ now()->format('Y-m-d') }}
{{ now()->format('h:i A') }}
{{ app()->getLocale() === 'ar' ? 'المقرر: ' : 'Course: ' }}{{ $course->name }}
{{ app()->getLocale() === 'ar' ? 'المادة: ' : 'Subject: ' }}{{ $course->subject?->name ?? '—' }}
{{ app()->getLocale() === 'ar' ? 'الفصل: ' : 'Class: ' }}{{ $course->schoolClass?->name ?? '—' }}
{{ app()->getLocale() === 'ar' ? 'عدد الجلسات: ' : 'Sessions: ' }}{{ $attendances->count() }}
@php $totalSessions = $attendances->count(); $totalStudents = $students->count(); $totalAbsences = $absentMap->sum(fn($ids) => $ids->count()); $avgAttendance = $totalStudents > 0 && $totalSessions > 0 ? round((($totalStudents * $totalSessions - $totalAbsences) / ($totalStudents * $totalSessions)) * 100) : 100; $perfectAttendance = $students->filter(fn($s) => ($absentMap[$s->id] ?? collect())->isEmpty())->count(); @endphp
{{ app()->getLocale() === 'ar' ? 'عدد الطلاب' : 'Students' }} {{ app()->getLocale() === 'ar' ? 'عدد الجلسات' : 'Sessions' }} {{ app()->getLocale() === 'ar' ? 'إجمالي الغياب' : 'Total Absences' }} {{ app()->getLocale() === 'ar' ? 'متوسط الحضور' : 'Avg. Attendance' }} {{ app()->getLocale() === 'ar' ? 'حضور كامل' : 'Perfect Attend.' }}
{{ $totalStudents }} {{ $totalSessions }} {{ $totalAbsences }} {{ $avgAttendance }}% {{ $perfectAttendance }}
@foreach($attendances as $att) @endforeach @foreach($students as $student) @php $absentIds = $absentMap[$student->id] ?? collect(); $absentCount = $absentIds->count(); $pct = $attendances->count() > 0 ? round((($attendances->count() - $absentCount) / $attendances->count()) * 100) : 100; @endphp @foreach($attendances as $att) @endforeach @endforeach
{{ app()->getLocale() === 'ar' ? 'الطالب' : 'Student' }}{{ $att->date?->format('m/d') }}{{ app()->getLocale() === 'ar' ? 'الغياب' : 'Absent' }} {{ app()->getLocale() === 'ar' ? 'الحضور%' : 'Attend%' }}
{{ $student->name }} @if($absentIds->contains($att->id)) @else @endif {{ $absentCount }} {{ $pct }}%