Attendance Report

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

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

@foreach ($dateRange as $datenew) @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 = \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $datenew)->setTime(11, 20, 20); $status = $checkDate->format('w') == 0 || $checkDate->format('w') == 6 ? 'Weekend' : (in_array($checkDate->format('Y-m-d'), $holidays) ? 'Holiday' : 'Not Marked'); @endphp @endif @endforeach
Date Present Absent Total
{{ \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $datenew)->format('d M Y') }}{{ $counts['total_present'] }} {{ $counts['total_absent'] }} {{ $counts['total_count'] }} {{ $status }}
@endforeach