fix pages and add distribution system
Tests / PHPUnit (push) Failing after 1m13s

This commit is contained in:
root
2026-07-15 23:03:51 -04:00
parent 7f3b24e47f
commit ba87598d3a
38 changed files with 1362 additions and 658 deletions
+7 -7
View File
@@ -322,23 +322,23 @@ class EventController extends ResourceController
public function index()
{
$eventModel = new EventModel();
$today = local_date(utc_now(), 'Y-m-d');
$schoolYear = $this->currentSchoolYearName();
// Fetch all events
$events = $eventModel
$events = $this->eventModel
->where('school_year', $schoolYear)
->orderBy('created_at', 'DESC')
->findAll();
// Fetch active events (not expired)
$activeEventCount = $eventModel
$activeEventCount = $this->eventModel
->where('school_year', $schoolYear)
->where('expiration_date >=', $today)
->countAllResults();
return view('administrator/events/event_list', [
'events' => $events,
'activeEventCount' => $activeEventCount
'activeEventCount' => $activeEventCount,
'schoolYear' => $schoolYear,
]);
}