@php $isArabic = app()->getLocale() === 'ar'; $sectionTitle = $isArabic ? 'section-title-rtl' : 'section-title'; @endphp
{{ \App\Models\Setting::valueOf($isArabic ? 'site_name_ar' : 'site_name_en') ?: \App\Models\Setting::valueOf('site_name') }}
{{ $isArabic ? 'تقرير شامل للطالب' : 'Comprehensive Student Report' }}
{{ now()->format('Y-m-d') }}
{{ now()->format('h:i A') }}
{{-- Student Info --}}
{{ $isArabic ? 'الطالب: ' : 'Student: ' }}{{ $child->name }}
{{ $isArabic ? 'الفصل: ' : 'Class: ' }}{{ $child->schoolClass->map->name->join(' / ') }}
@if($child->schoolClass->first()?->grade?->stage)
{{ $isArabic ? 'المرحلة: ' : 'Stage: ' }}{{ $child->schoolClass->first()->grade->stage->name }}
@endif
{{ $isArabic ? 'ولي الأمر: ' : 'Parent: ' }}{{ $parent->name }}
{{-- Summary Stats --}} @php $avgMark = $marks->whereNotNull('mark')->avg('mark'); $submittedCount = collect($assignments)->where('submitted', true)->count(); $totalAssignments = collect($assignments)->count(); @endphp
{{ $avgMark ? number_format($avgMark, 1) : '—' }}
{{ $isArabic ? 'متوسط الدرجات' : 'Avg. Mark' }}
{{ $attendanceSummary['pct'] !== null ? $attendanceSummary['pct'].'%' : '—' }}
{{ $isArabic ? 'نسبة الحضور' : 'Attendance' }}
{{ $submittedCount }}/{{ $totalAssignments }}
{{ $isArabic ? 'الواجبات المسلّمة' : 'Assignments' }}
{{ $marks->count() }}
{{ $isArabic ? 'إجمالي الدرجات' : 'Total Marks' }}
{{-- Marks by Subject --}} @if($marksBySubject->isNotEmpty())
{{ $isArabic ? 'الأداء حسب المادة' : 'Performance by Subject' }}
@foreach($marksBySubject as $subject => $data) @endforeach
{{ $isArabic ? 'المادة' : 'Subject' }} {{ $isArabic ? 'عدد الدرجات' : 'Count' }} {{ $isArabic ? 'المتوسط' : 'Average' }} {{ $isArabic ? 'التقييم' : 'Rating' }}
{{ $subject }} {{ $data['count'] }} {{ $data['avg'] }} @if($data['avg'] >= 70) {{ $isArabic ? 'ممتاز' : 'Good' }} @elseif($data['avg'] >= 50) {{ $isArabic ? 'مقبول' : 'Fair' }} @else {{ $isArabic ? 'يحتاج تحسين' : 'Needs Work' }} @endif
@endif {{-- Detailed Marks --}} @if($marks->isNotEmpty())
{{ $isArabic ? 'الدرجات التفصيلية' : 'Detailed Marks' }}
@foreach($marks->sortByDesc(fn($ms) => $ms->mark->date) as $ms) @endforeach
{{ $isArabic ? 'الاختبار' : 'Test' }} {{ $isArabic ? 'المادة' : 'Subject' }} {{ $isArabic ? 'التاريخ' : 'Date' }} {{ $isArabic ? 'الدرجة' : 'Mark' }}
{{ $ms->mark->title }} {{ $ms->mark->course?->subject?->name ?? '—' }} {{ $ms->mark->date?->format('Y-m-d') ?? '—' }} @if($ms->absent) {{ $isArabic ? 'غائب' : 'Absent' }} @else {{ $ms->mark }} @endif
@endif {{-- Attendance --}}
{{ $isArabic ? 'ملخص الحضور' : 'Attendance Summary' }}
{{ $isArabic ? 'إجمالي الحصص' : 'Total' }} {{ $isArabic ? 'حاضر' : 'Present' }} {{ $isArabic ? 'غائب' : 'Absent' }} {{ $isArabic ? 'نسبة الحضور' : 'Rate' }}
{{ $attendanceSummary['total'] }} {{ $attendanceSummary['present'] }} {{ $attendanceSummary['absent'] }} {{ $attendanceSummary['pct'] !== null ? $attendanceSummary['pct'].'%' : '—' }}
{{-- Assignments --}} @if(collect($assignments)->isNotEmpty())
{{ $isArabic ? 'الواجبات' : 'Assignments' }}
@foreach($assignments as $a) @endforeach
{{ $isArabic ? 'الواجب' : 'Assignment' }} {{ $isArabic ? 'المادة' : 'Subject' }} {{ $isArabic ? 'تاريخ التسليم' : 'Due Date' }} {{ $isArabic ? 'الحالة' : 'Status' }}
{{ $a['title'] }} {{ $a['subject'] ?? '—' }} {{ $a['due_date']?->format('Y-m-d') ?? '—' }} @if($a['submitted']) {{ $isArabic ? 'تم التسليم' : 'Submitted' }} @elseif($a['late']) {{ $isArabic ? 'متأخر' : 'Late' }} @else {{ $isArabic ? 'بانتظار التسليم' : 'Pending' }} @endif
@endif