Attendance Report

@foreach ($attendance as $key => $classSection)

{{ $classSection['Grade'] }} ({{ $classSection['Gate'] }} {{ $classSection['Campus'] }}):

@foreach ($dateRange as $datenew) @php $currentDate = \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $datenew); $formattedDate = $currentDate->format('Y-m-d'); $holidayKey = $classSection['class_id'] . '_' . $classSection['section_id'] . '_' . $classSection['campus_id']; $sectionHolidays = $holidays[$holidayKey] ?? []; $isHoliday = in_array($formattedDate, $sectionHolidays); @endphp @if ($isHoliday) @else @if (!empty($classSection['DateWiseCounts']) && isset($classSection['DateWiseCounts'][$datenew->setTime(0, 0, 0)->format('Y-m-d H:i:s')])) @php $counts = $classSection['DateWiseCounts'][$datenew->setTime(0, 0, 0)->format('Y-m-d H:i:s')]; @endphp @else @php $checkDate = $currentDate->copy()->setTime(11, 20, 20); $isWeekend = in_array($checkDate->dayOfWeek, [0, 6]); $isOpenWeekend = in_array($checkDate->format('Y-m-d'), $weekends); if ($isWeekend && $isOpenWeekend) { $status = 'Not Marked'; } elseif ($isWeekend) { $status = 'Weekend'; } else { $status = 'Not Marked'; } @endphp @endif @endif @endforeach
Date Present Absent Total
{{ $currentDate->format('d M Y') }} Holiday {{ $counts['total_present'] }} {{ $counts['total_absent'] }} {{ $counts['total_count'] }} {{ $status }}
@endforeach