merge prod to main
This commit is contained in:
Regular → Executable
+21
-17
@@ -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.
|
||||
@@ -1005,9 +1004,13 @@ public function showUpdateAttendanceForm()
|
||||
}
|
||||
|
||||
$hasRoster = false;
|
||||
$seenStudents = [];
|
||||
|
||||
foreach ($students as $sc) {
|
||||
$studentId = (int)$sc['student_id'];
|
||||
if ($studentId <= 0 || isset($seenStudents[$studentId])) {
|
||||
continue;
|
||||
}
|
||||
$student = $this->studentModel
|
||||
->select('id, firstname, lastname, school_id')
|
||||
->find($studentId);
|
||||
@@ -1015,6 +1018,7 @@ public function showUpdateAttendanceForm()
|
||||
|
||||
$studentsBySection[$secCode][] = $student;
|
||||
$hasRoster = true;
|
||||
$seenStudents[$studentId] = true;
|
||||
|
||||
// Attendance history
|
||||
$qb = $this->attendanceDataModel
|
||||
|
||||
Reference in New Issue
Block a user