From 246def8ca9c83539ec050207039e6ab220c02387 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 20 Aug 2026 16:07:34 -0400 Subject: [PATCH] fix widthraw spelling --- .../View/AdministratorController.php | 16 ++++------------ app/Controllers/View/GradingController.php | 18 +++++++++--------- app/Helpers/student_status_helper.php | 4 ++-- app/Models/StudentClassModel.php | 3 --- app/Models/StudentModel.php | 6 +++--- app/Services/EnrollmentTransitionService.php | 2 +- .../Enrollment/DeliberationDecision.php | 2 +- 7 files changed, 20 insertions(+), 31 deletions(-) diff --git a/app/Controllers/View/AdministratorController.php b/app/Controllers/View/AdministratorController.php index 07bae3d..347ce04 100644 --- a/app/Controllers/View/AdministratorController.php +++ b/app/Controllers/View/AdministratorController.php @@ -2833,25 +2833,17 @@ class AdministratorController extends BaseController $hasRemovalCondition = false; if ($hasIsWithdrawn) { - $builder->where('is_withdrawn', 1); + $builder->orWhere('is_withdrawn', 1); $hasRemovalCondition = true; } if ($hasEnrollmentStatus) { - if ($hasRemovalCondition) { - $builder->orWhereIn('enrollment_status', ['withdrawn', 'widthran', 'denied']); - } else { - $builder->whereIn('enrollment_status', ['withdrawn', 'widthran', 'denied']); - } + $builder->orWhereIn('enrollment_status', ['withdrawn', 'denied']); $hasRemovalCondition = true; } if ($hasAdmissionStatus) { - if ($hasRemovalCondition) { - $builder->orWhere('admission_status', 'denied'); - } else { - $builder->where('admission_status', 'denied'); - } + $builder->orWhere('admission_status', 'denied'); $hasRemovalCondition = true; } @@ -2901,7 +2893,7 @@ class AdministratorController extends BaseController return 'denied'; } - if (in_array($enrollmentStatus, ['withdrawn', 'widthran'], true) || (int)($row['is_withdrawn'] ?? 0) === 1) { + if ($enrollmentStatus === 'withdrawn' || (int)($row['is_withdrawn'] ?? 0) === 1) { return 'withdrawn'; } diff --git a/app/Controllers/View/GradingController.php b/app/Controllers/View/GradingController.php index b9866cc..ee9bb7f 100644 --- a/app/Controllers/View/GradingController.php +++ b/app/Controllers/View/GradingController.php @@ -1007,7 +1007,7 @@ class GradingController extends BaseController ->join('classes c', 'c.id = cs.class_id', 'left') ->groupStart() ->where('s.is_active', 1) - ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','widthran','widthrawan','withdrawan','waitlist')", null, false) + ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','waitlist')", null, false) ->orWhere('e.is_withdrawn', 1) ->groupEnd() ->orderBy('s.lastname', 'ASC') @@ -1049,7 +1049,7 @@ class GradingController extends BaseController ->whereIn('ps.batch_id', $batchIds) ->groupStart() ->where('s.is_active', 1) - ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','widthran','widthrawan','withdrawan','waitlist')", null, false) + ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','waitlist')", null, false) ->orWhere('e.is_withdrawn', 1) ->groupEnd() ->orderBy('ps.batch_id', 'ASC') @@ -1688,7 +1688,7 @@ public function belowSixty() ->where('sc.school_year', $schoolYear) ->groupStart() ->where('s.is_active', 1) - ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','widthran','widthrawan','withdrawan','waitlist')", null, false) + ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','waitlist')", null, false) ->orWhere('e.is_withdrawn', 1) ->groupEnd(); @@ -1888,7 +1888,7 @@ public function belowSixty() ->join('classSection cs', 'cs.class_section_id = ss.class_section_id', 'left') ->groupStart() ->where('s.is_active', 1) - ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','widthran','widthrawan','withdrawan','waitlist')", null, false) + ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','waitlist')", null, false) ->orWhere('e.is_withdrawn', 1) ->groupEnd() ->where('ss.school_year', $schoolYear) @@ -1940,7 +1940,7 @@ public function belowSixty() ->join('classSection cs', 'cs.class_section_id = ss.class_section_id', 'left') ->groupStart() ->where('s.is_active', 1) - ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','widthran','widthrawan','withdrawan','waitlist')", null, false) + ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','waitlist')", null, false) ->orWhere('e.is_withdrawn', 1) ->groupEnd() ->where('ss.school_year', $schoolYear) @@ -2060,7 +2060,7 @@ public function belowSixty() ->where('ss.student_id', $studentId) ->groupStart() ->where('s.is_active', 1) - ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','widthran','widthrawan','withdrawan','waitlist')", null, false) + ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','waitlist')", null, false) ->orWhere('e.is_withdrawn', 1) ->groupEnd() ->where("LOWER(TRIM(ss.semester))", $semesterKey) @@ -2411,7 +2411,7 @@ public function belowSixty() ->join('classSection cs', 'cs.class_section_id = ss.class_section_id', 'left') ->groupStart() ->where('s.is_active', 1) - ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','widthran','widthrawan','withdrawan','waitlist')", null, false) + ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','waitlist')", null, false) ->orWhere('e.is_withdrawn', 1) ->groupEnd() ->where('ss.school_year', $schoolYear) @@ -3472,7 +3472,7 @@ public function allDecisions() ->join('classes c', 'c.id = cs.class_id', 'left') ->groupStart() ->where('s.is_active', 1) - ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','widthran','widthrawan','withdrawan','waitlist')", null, false) + ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','waitlist')", null, false) ->orWhere('e.is_withdrawn', 1) ->groupEnd() ->where('ss.school_year', $schoolYear) @@ -3692,7 +3692,7 @@ public function generateAllDecisions() ->join('classSection cs', 'cs.class_section_id = ss.class_section_id', 'left') ->groupStart() ->where('s.is_active', 1) - ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','widthran','widthrawan','withdrawan','waitlist')", null, false) + ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','waitlist')", null, false) ->orWhere('e.is_withdrawn', 1) ->groupEnd() ->where('ss.school_year', $schoolYear) diff --git a/app/Helpers/student_status_helper.php b/app/Helpers/student_status_helper.php index 95fa5e4..cb06f2c 100644 --- a/app/Helpers/student_status_helper.php +++ b/app/Helpers/student_status_helper.php @@ -5,7 +5,7 @@ if (!function_exists('student_normalized_enrollment_status')) { { $studentId = (int)($student['student_id'] ?? $student['id'] ?? 0); $status = strtolower(trim((string)($student['enrollment_status'] ?? ''))); - if ($status === 'widthran' || $status === 'widthrawan' || $status === 'withdrawan' || $status === 'withdrawn student' || (int)($student['is_withdrawn'] ?? 0) === 1) { + if ($status === 'withdrawn student' || (int)($student['is_withdrawn'] ?? 0) === 1) { $status = 'withdrawn'; } @@ -35,7 +35,7 @@ if (!function_exists('student_normalized_enrollment_status')) { ->get(1) ->getRowArray(); $rowStatus = strtolower(trim((string)($row['enrollment_status'] ?? ''))); - if ($rowStatus === 'widthran' || $rowStatus === 'widthrawan' || $rowStatus === 'withdrawan' || $rowStatus === 'withdrawn student' || (int)($row['is_withdrawn'] ?? 0) === 1) { + if ($rowStatus === 'withdrawn student' || (int)($row['is_withdrawn'] ?? 0) === 1) { $rowStatus = 'withdrawn'; } $statusCache[$cacheKey] = $rowStatus; diff --git a/app/Models/StudentClassModel.php b/app/Models/StudentClassModel.php index 5efd798..8bd1110 100644 --- a/app/Models/StudentClassModel.php +++ b/app/Models/StudentClassModel.php @@ -60,9 +60,6 @@ class StudentClassModel extends Model $terminalStatuses = array_map([$this->db, 'escape'], [ 'denied', 'withdrawn', - 'widthran', - 'widthrawan', - 'withdrawan', 'waitlist', ]); diff --git a/app/Models/StudentModel.php b/app/Models/StudentModel.php index 2ba857d..d236132 100644 --- a/app/Models/StudentModel.php +++ b/app/Models/StudentModel.php @@ -305,7 +305,7 @@ class StudentModel extends Model ->where('sc.school_year', $school_year) ->groupStart() ->where('students.is_active', 1) - ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','widthran','widthrawan','withdrawan','waitlist')", null, false) + ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','waitlist')", null, false) ->orWhere('e.is_withdrawn', 1) ->groupEnd(); @@ -346,7 +346,7 @@ class StudentModel extends Model ->where('student_class.school_year', $schoolYear) ->groupStart() ->where('students.is_active', 1) - ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','widthran','widthrawan','withdrawan','waitlist')", null, false) + ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','waitlist')", null, false) ->orWhere('e.is_withdrawn', 1) ->groupEnd() ->groupBy('students.id, students.school_id, students.firstname, students.lastname, students.is_active, e.enrollment_status, e.is_withdrawn') @@ -502,7 +502,7 @@ class StudentModel extends Model $builder->groupStart() ->where('students.is_active', 1) - ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','widthran','widthrawan','withdrawan','waitlist')", null, false) + ->orWhere("LOWER(TRIM(e.enrollment_status)) IN ('denied','withdrawn','waitlist')", null, false) ->orWhere('e.is_withdrawn', 1) ->groupEnd(); diff --git a/app/Services/EnrollmentTransitionService.php b/app/Services/EnrollmentTransitionService.php index 7aa771a..874561d 100644 --- a/app/Services/EnrollmentTransitionService.php +++ b/app/Services/EnrollmentTransitionService.php @@ -1396,7 +1396,7 @@ final class EnrollmentTransitionService $admission = strtolower(trim((string) ($enrollment['admission_status'] ?? ''))); return $admission === 'denied' - || in_array($status, ['denied', 'withdrawn', 'widthran'], true) + || in_array($status, ['denied', 'withdrawn'], true) || (int) ($enrollment['is_withdrawn'] ?? 0) === 1; } diff --git a/app/Support/Enrollment/DeliberationDecision.php b/app/Support/Enrollment/DeliberationDecision.php index 0cc554f..2724c16 100644 --- a/app/Support/Enrollment/DeliberationDecision.php +++ b/app/Support/Enrollment/DeliberationDecision.php @@ -41,7 +41,7 @@ final class DeliberationDecision str_contains($compact, 'repeat') || str_contains($compact, 'keepkg') => self::REPEAT_CLASS, str_contains($compact, 'makeupexam') || str_contains($compact, 'makeupexamfall') || str_contains($compact, 'makeup') => self::MAKE_UP_EXAM, str_contains($compact, 'deferred') || str_contains($compact, 'pendingdecision') => self::DEFERRED_DECISION, - str_contains($compact, 'withdraw') || str_contains($compact, 'widthraw') || str_contains($compact, 'widthdraw') || str_contains($compact, 'widthrwan') => self::WITHDRAWN, + str_contains($compact, 'withdraw') => self::WITHDRAWN, str_contains($compact, 'expel') => self::EXPELLED, default => null, };