@extends('layouts.staff_dashboard') @section('title', 'Add Attendance') @section('content') @php $alreadyMarked = $alreadyMarkedHours ?? []; $markedKeys = array_keys($alreadyMarked); sort($markedKeys, SORT_NUMERIC); $displayDate = !empty($selectedDate) ? \Carbon\Carbon::parse($selectedDate)->format('l, M d, Y') : date('l, M d, Y'); // Normalize numeric hour list [1..courseHours] (handles associative $hoursList [1 => "Hour 1"]) $maxCourseHours = max(1, (int) ($courseHours ?? count($hoursList ?? []) ?: 1)); $numericHours = range(1, $maxCourseHours); $hourFromInt = max(1, min($maxCourseHours, (int) ($hourFrom ?? 1))); $hourToInt = max($hourFromInt, min($maxCourseHours, (int) ($hourTo ?? $hourFromInt))); @endphp
Select the hour range, toggle Present or Absent for each student, and save in one click.