@extends('admin.admin_dashboard') @section('customcss') @endsection @section('admin')
{{-- Quick Actions --}}

Quick Actions

{{-- Attendance Sheet --}}

Attendance Sheet

@if(session('error'))
{{ session('error') }}
@endif @foreach(($data ?? []) as $sheet)
{{-- School Header --}}
@if(!empty($schoolInfo->school_logo)) School Logo @endif
{{ $schoolInfo->school_name ?? 'School Name' }}

{{ $schoolInfo->address ?? 'School Address' }}

{{-- Exam Info --}}
Exam: {{ $exam->exam_name }}
Class: {{ $exam->class->name ?? '-' }}, Section: {{ $sheet['section'] ?? '-' }}
{{-- ✅ Row-1: Subjects (same date => same column; joined with "/") --}} @foreach(($sheet['subject_columns'] ?? []) as $column) @endforeach {{-- ✅ Row-2: Exam Date (dd-mm-yyyy should come from controller) --}} @foreach(($sheet['subject_columns'] ?? []) as $column) @endforeach @foreach(($sheet['students'] ?? []) as $registration) @foreach(($sheet['subject_columns'] ?? []) as $column) @php $hasAnySubject = false; foreach ($column as $sub) { if (!empty($sub['student_ids']) && in_array($registration->student_id, $sub['student_ids'])) { $hasAnySubject = true; break; } } @endphp @endforeach @endforeach
Roll Student Name {{ collect($column)->pluck('name')->filter()->implode(' / ') }}
{{ $column[0]['exam_date'] ?? '-' }}
{{ $registration->class_roll ?? '' }} {{ $registration->student->student_name_english ?? '-' }} @if($hasAnySubject) {{-- keep blank for signature --}} @else - @endif
@endforeach
@endsection @section('customjs') @endsection