update code
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user