From a8ef6652398a57714a3f92b6069cc5eb1f8d6f2a Mon Sep 17 00:00:00 2001 From: root Date: Sat, 16 May 2026 16:03:46 -0400 Subject: [PATCH] fix event parent list --- app/Controllers/View/EventController.php | 11 ++++++ .../administrator/events/event_charges.php | 39 +++++++++++++++++-- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/app/Controllers/View/EventController.php b/app/Controllers/View/EventController.php index d44b2a6..659a41f 100644 --- a/app/Controllers/View/EventController.php +++ b/app/Controllers/View/EventController.php @@ -480,6 +480,17 @@ class EventController extends ResourceController $semester = $this->request->getGet('semester') ?? $this->semester; $parents = $this->userModel->getParents(); + usort($parents, static function (array $a, array $b): int { + $aLabel = trim(preg_replace('/\s+/', ' ', (string) ($a['firstname'] ?? '') . ' ' . (string) ($a['lastname'] ?? ''))); + $bLabel = trim(preg_replace('/\s+/', ' ', (string) ($b['firstname'] ?? '') . ' ' . (string) ($b['lastname'] ?? ''))); + + $nameCmp = strnatcasecmp($aLabel, $bLabel); + if ($nameCmp !== 0) { + return $nameCmp; + } + + return strnatcasecmp((string) ($a['school_id'] ?? ''), (string) ($b['school_id'] ?? '')); + }); $events = $this->eventModel->getActiveEvents($schoolYear); $filterEventId = (int) ($this->request->getGet('event_id') ?? 0); $filterParentId = (int) ($this->request->getGet('parent_id') ?? 0); diff --git a/app/Views/administrator/events/event_charges.php b/app/Views/administrator/events/event_charges.php index cdbc817..cbd530a 100644 --- a/app/Views/administrator/events/event_charges.php +++ b/app/Views/administrator/events/event_charges.php @@ -145,9 +145,24 @@ $ fee -

- -

+ +
+ +
+
+ +
+
+
Expires: @@ -465,6 +480,24 @@ section('scripts') ?>