fix enrollment logic, add financial aid, fix class distribution
Tests / PHPUnit (push) Failing after 1m6s

This commit is contained in:
root
2026-08-15 15:07:16 -04:00
parent c12bb59372
commit 4603d9ced2
95 changed files with 6892 additions and 1295 deletions
+93
View File
@@ -0,0 +1,93 @@
<?= $this->extend('layout/main_layout') ?>
<?= $this->section('content') ?>
<div class="container my-5">
<h3 class="text-center text-success">Financial Aid</h3>
<?php if (!empty($schoolYear)): ?>
<div class="text-center text-muted small mb-3">School Year: <?= esc($schoolYear) ?></div>
<?php endif; ?>
<?php if (session()->getFlashdata('success')): ?>
<div class="alert alert-success"><?= esc(session()->getFlashdata('success')) ?></div>
<?php endif; ?>
<?php if (session()->getFlashdata('error')): ?>
<div class="alert alert-danger"><?= esc(session()->getFlashdata('error')) ?></div>
<?php endif; ?>
<div class="alert alert-warning" role="alert">
<h4 class="alert-heading">
<i class="bi bi-exclamation-triangle-fill me-2"></i>
Bring these documents to the school office
</h4>
<p class="mb-2">
You must bring <strong>2 recent pay stubs</strong> <strong>and</strong> <strong>last years tax return</strong>
to the school office so administration can review your financial aid request.
</p>
<ul class="mb-2">
<li><strong>Recent pay stubs</strong></li>
<li><strong>Last years tax return</strong></li>
</ul>
<p class="mb-0">This is required whether you are submitting a new request or already have one open.</p>
</div>
<p>Use this form to request a tuition reduction. Administration will review the request and apply any approved amount to your invoice.</p>
<?php if (!empty($requests)): ?>
<div class="table-responsive mb-4">
<table class="table table-bordered">
<thead>
<tr>
<th>Submitted</th>
<th>Status</th>
<th>Requested</th>
<th>Approved amount</th>
<th>Note</th>
</tr>
</thead>
<tbody>
<?php foreach ($requests as $row): ?>
<tr>
<td><?= esc($row['created_at'] ?? '') ?></td>
<td><?= esc($row['status'] ?? '') ?></td>
<td><?= $row['requested_amount'] !== null && $row['requested_amount'] !== '' ? '$' . number_format((float) $row['requested_amount'], 2) : 'Not specified' ?></td>
<td><?= $row['admin_amount'] !== null && $row['admin_amount'] !== '' ? '$' . number_format((float) $row['admin_amount'], 2) : '—' ?></td>
<td><?= esc($row['admin_note'] ?? '') ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
<?php if (empty($openRequest)): ?>
<form method="post" action="<?= site_url('parent/financial-aid') ?>" class="border rounded p-3 bg-light">
<?= csrf_field() ?>
<div class="mb-3">
<label class="form-label">Students</label>
<?php foreach (($students ?? []) as $student): ?>
<div class="form-check">
<input class="form-check-input" type="checkbox" name="student_ids[]" value="<?= (int) $student['id'] ?>" id="fa_student_<?= (int) $student['id'] ?>">
<label class="form-check-label" for="fa_student_<?= (int) $student['id'] ?>">
<?= esc(trim(($student['firstname'] ?? '') . ' ' . ($student['lastname'] ?? ''))) ?>
</label>
</div>
<?php endforeach; ?>
</div>
<div class="mb-3">
<label class="form-label" for="household_size">Household size</label>
<input class="form-control" type="number" min="1" name="household_size" id="household_size" value="<?= esc(old('household_size')) ?>">
</div>
<div class="mb-3">
<label class="form-label" for="requested_amount">Requested amount (optional)</label>
<input class="form-control" type="number" min="0" step="0.01" name="requested_amount" id="requested_amount" value="<?= esc(old('requested_amount')) ?>">
</div>
<div class="mb-3">
<label class="form-label" for="need_statement">Why are you requesting financial aid?</label>
<textarea class="form-control" name="need_statement" id="need_statement" rows="5" required><?= esc(old('need_statement')) ?></textarea>
</div>
<button class="btn btn-success" type="submit">Submit request</button>
</form>
<?php else: ?>
<div class="alert alert-info">You already have an open request. Administration will update it after review. Remember to bring recent pay stubs and last years tax return to the school office.</div>
<?php endif; ?>
</div>
<?= $this->endSection() ?>