{{-- Row 1: Subject Group Headers --}} {{-- Fixed columns --}} {{-- Subject groups --}} @foreach($data['blueprint']['subjects'] ?? [] as $subject) @php $visibleComponents = collect($subject['components'] ?? [])->filter(fn($c) => ($c['showOnReport'] ?? true) === true); $colSpan = $visibleComponents->count(); // Add 1 for subject total if exists if (!empty($subject['showTotal'])) { $colSpan++; } @endphp @endforeach {{-- Summary columns --}} {{-- Row 2: Component Headers --}} @foreach($data['blueprint']['subjects'] ?? [] as $subject) @foreach($subject['components'] ?? [] as $component) @if(($component['showOnReport'] ?? true) === true) @endif @endforeach @if(!empty($subject['showTotal'])) @endif @endforeach @foreach($data['students'] ?? [] as $student) {{-- Fixed columns --}} {{-- Subject marks --}} @php $studentSubjects = collect($student['subjects'] ?? [])->keyBy('key'); @endphp @foreach($data['blueprint']['subjects'] ?? [] as $subject) @php $subjectData = $studentSubjects->get($subject['key'], []); $subjectComponents = collect($subjectData['components'] ?? [])->keyBy('key'); @endphp @foreach($subject['components'] ?? [] as $component) @if(($component['showOnReport'] ?? true) === true) @php $compData = $subjectComponents->get($component['key'], []); $obtained = $compData['obtained'] ?? ''; @endphp @endif @endforeach @if(!empty($subject['showTotal'])) @endif @endforeach {{-- Summary columns --}} @endforeach
Student Name Admission No Father Name Mother Name Gender{{ $subject['name'] ?? $subject['key'] }}Total Obtained Total Max Percentage Grade Result
{{ $component['label'] ?? $component['key'] }} ({{ $component['max'] ?? '' }})Total ({{ $subject['maxTotal'] ?? '' }})
{{ $student['name'] ?? '' }} {{ $student['admission_no'] ?? '' }} {{ $student['father_name'] ?? '' }} {{ $student['mother_name'] ?? '' }} {{ $student['gender'] ?? '' }}{{ $obtained }}{{ $subjectData['total'] ?? '' }}{{ $student['summary']['total_obtained'] ?? '' }} {{ $student['summary']['total_max'] ?? '' }} {{ $student['summary']['percentage'] ?? '' }} {{ $student['summary']['grade'] ?? '' }} {{ $student['summary']['result_status'] ?? '' }}