update code

This commit is contained in:
root
2026-02-26 23:27:50 -05:00
parent 663c0cdbda
commit a6880ea14f
10 changed files with 807 additions and 138 deletions
+16 -17
View File
@@ -797,26 +797,25 @@ public function showUpdateAttendanceForm()
}
$noSchoolDays = [];
if ($schoolYearForRange !== '') {
$events = [];
try {
$events = $this->calendarModel->getEvents();
} catch (\Throwable $e) {
$events = [];
try {
$events = $this->calendarModel->getEventsBySchoolYearAndSemester(
$schoolYearForRange,
$semesterNorm !== '' ? $semesterNorm : null
);
} catch (\Throwable $e) {
$events = [];
}
foreach ($events as $event) {
$d = substr((string)($event['date'] ?? ''), 0, 10);
if ($d === '' || empty($event['no_school'])) {
continue;
}
foreach ($events as $event) {
$d = substr((string)($event['date'] ?? ''), 0, 10);
if ($d === '' || empty($event['no_school'])) {
continue;
}
if ($d < $rangeStart || $d > $rangeEnd) {
continue;
}
$noSchoolDays[$d] = true;
if ($d < $rangeStart || $d > $rangeEnd) {
continue;
}
$eventYear = trim((string)($event['school_year'] ?? ''));
if ($schoolYearForRange !== '' && $eventYear !== '' && $eventYear !== $schoolYearForRange) {
continue;
}
$noSchoolDays[$d] = true;
}
// Total passed attendance days up to this Sunday (inclusive), excluding no-school days.