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
@@ -12,34 +12,11 @@
</div>
</div>
<?php endif; ?>
<div class="row g-2 align-items-center justify-content-center mb-2">
<div class="col-auto"><label for="schoolYearSelect" class="col-form-label">School year</label></div>
<div class="col-auto">
<form method="get" action="<?= site_url('enroll_withdraw/enrollment_withdrawal') ?>" class="d-flex align-items-center gap-2">
<select id="schoolYearSelect" name="schoolYear" class="form-select form-select-sm" style="min-width:180px;">
<?php if (!empty($schoolYears) && is_array($schoolYears)): ?>
<?php foreach ($schoolYears as $y): ?>
<?php $yval = is_array($y) && isset($y['school_year']) ? (string)$y['school_year'] : (string)$y; ?>
<option value="<?= esc($yval) ?>" <?= (isset($selectedYear) && (string)$selectedYear === $yval) ? 'selected' : '' ?>><?= esc($yval) ?></option>
<?php endforeach; ?>
<?php else: ?>
<option value="<?= esc($selectedYear ?? '') ?>" selected><?= esc($selectedYear ?? '') ?></option>
<?php endif; ?>
</select>
<?php $semVal = (string)($semester ?? ($_GET['semester'] ?? '')); ?>
<label for="ewSemester" class="col-form-label">Semester</label>
<select id="ewSemester" name="semester" class="form-select form-select-sm" style="min-width: 140px;">
<option value="">—</option>
<option value="Fall" <?= (strcasecmp($semVal,'Fall')===0?'selected':'') ?>>Fall</option>
<option value="Spring" <?= (strcasecmp($semVal,'Spring')===0?'selected':'') ?>>Spring</option>
</select>
<button type="submit" class="btn btn-secondary btn-sm">Apply</button>
</form>
<?php if (empty($isCurrentYear)): ?>
<div class="text-center mb-2">
<span class="badge bg-secondary">Read-only (Past Year)</span>
</div>
<?php if (isset($selectedYear, $currentYear) && (string)$selectedYear !== (string)$currentYear): ?>
<div class="col-auto"><span class="badge bg-secondary">Read-only (Past Year)</span></div>
<?php endif; ?>
</div>
<?php endif; ?>
<!-- Display success and error messages -->
<?php if (session()->getFlashdata('success')): ?>
<div class="alert alert-success">
@@ -161,7 +138,7 @@
<!-- Update Enrollment -->
<td>
<select <?= (isset($selectedYear, $currentYear) && (string)$selectedYear !== (string)$currentYear) ? 'disabled' : '' ?>
<select <?= empty($isCurrentYear) ? 'disabled' : '' ?>
name="enrollment_status[<?= $sid ?>]"
class="form-control enrollment-status"
data-student-id="<?= $sid ?>"
@@ -182,7 +159,7 @@
<td>
<?php $isUnderReview = (strtolower($student['enrollment_status'] ?? '') === 'admission under review'); ?>
<?php if ($isUnderReview): ?>
<select class="form-select form-select-sm assign-class-select" <?= (isset($selectedYear, $currentYear) && (string)$selectedYear !== (string)$currentYear) ? 'disabled' : '' ?>
<select class="form-select form-select-sm assign-class-select" <?= empty($isCurrentYear) ? 'disabled' : '' ?>
data-student-id="<?= $sid ?>"
data-parent-id="<?= $pid ?>">
<option value="">— Select class section —</option>
@@ -212,7 +189,7 @@
</div>
<!-- Centered action buttons under the table -->
<div class="d-flex justify-content-center gap-2 my-3">
<button type="button" id="bulkSaveGenerateButton" class="btn btn-success btn-lg" <?= (isset($selectedYear, $currentYear) && (string)$selectedYear !== (string)$currentYear) ? 'disabled title="Editing disabled for non-current year"' : '' ?> >
<button type="button" id="bulkSaveGenerateButton" class="btn btn-success btn-lg" <?= empty($isCurrentYear) ? 'disabled title="Editing disabled for non-current year"' : '' ?> >
Save &amp; Generate Invoice
</button>
<span id="bulkProgress" class="small text-muted d-none">Processing…</span>
@@ -9,7 +9,6 @@
<span class="badge bg-secondary ms-2"><?= (int)$total_new ?></span>
<?php endif; ?>
</h2>
<?= $this->include('partials/academic_filter') ?>
<!-- Flash messages -->
<?php if (session()->getFlashdata('success')): ?>