@extends('layouts.staff_dashboard') @section('title', 'Attendance Register') @section('content') @php $totalStudentsCount = $students->count(); $markedHoursList = array_keys($markedHours ?? []); sort($markedHoursList, SORT_NUMERIC); $markedHoursCount = count($markedHoursList); $displayDate = !empty($currentDate) ? \Carbon\Carbon::parse($currentDate)->format('M d, Y') : date('M d, Y'); @endphp
Click any hour cell to instantly toggle P ↔ A (right-click for Leave / options), or click an hour header (H1, H2...) to view/clear that hour.
@if(empty($totalHours)) This course has 0 hours configured. @else No students match your current search criteria. @endif
| Student Name | Reg No | @for($h = 1; $h <= $totalHours; $h++) @php $isMarked = !empty($markedHours[$h]); @endphpH{{ $h }} | @endfor
|---|---|---|
| {{ $student->name }} | {{ $student->regno }} | @for($h = 1; $h <= $totalHours; $h++) @php $status = $attendanceRecords[$student->id][$h] ?? null; $attDate = isset($attendanceDates[$student->id][$h]) ? $attendanceDates[$student->id][$h] : $currentDate; $cellClass = 'att-cell-none'; $cellLabel = '-'; if ($status === 'Present') { $cellClass = 'att-cell-p'; $cellLabel = 'P'; } elseif ($status === 'Absent') { $cellClass = 'att-cell-a'; $cellLabel = 'A'; } elseif ($status === 'Leave') { $cellClass = 'att-cell-l'; $cellLabel = 'L'; } elseif (!empty($status)) { $cellClass = 'att-cell-p'; $cellLabel = '✓'; } @endphp@endfor |