fix invoice and enrollment fees
This commit is contained in:
@@ -80,13 +80,14 @@
|
||||
<?php
|
||||
$isEditable = (bool) ($isEditable ?? true);
|
||||
$disabledAttr = $isEditable ? '' : ' disabled';
|
||||
$reportRows = $reportRows ?? [];
|
||||
?>
|
||||
<div class="container my-5">
|
||||
<div class="d-flex flex-wrap align-items-center justify-content-between gap-2 mb-3">
|
||||
<div>
|
||||
<h3 class="text-success mb-1">Report Cards</h3>
|
||||
<div class="text-muted small">
|
||||
<?= esc($schoolYear ?: 'N/A') ?> <?= $semester ? '• ' . esc($semester) . ' Semester' : '' ?>
|
||||
<?= esc($schoolYear ?: 'N/A') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -103,7 +104,7 @@
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (empty($students)): ?>
|
||||
<?php if (empty($reportRows)): ?>
|
||||
<div class="alert alert-info">No students available for report cards.</div>
|
||||
<?php else: ?>
|
||||
<div class="table-responsive">
|
||||
@@ -112,24 +113,29 @@
|
||||
<tr>
|
||||
<th>Student</th>
|
||||
<th>Class Section</th>
|
||||
<th>Semester</th>
|
||||
<th>Viewed</th>
|
||||
<th>Signature</th>
|
||||
<th class="text-end">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($students as $student): ?>
|
||||
<?php foreach ($reportRows as $reportRow): ?>
|
||||
<?php
|
||||
$student = $reportRow['student'] ?? [];
|
||||
$sid = (int) ($student['id'] ?? 0);
|
||||
$ack = $ackMap[$sid] ?? null;
|
||||
$rowSemester = (string) ($reportRow['semester'] ?? '');
|
||||
$rowKey = (string) ($reportRow['key'] ?? ($sid . '|' . $rowSemester));
|
||||
$ack = $ackMap[$rowKey] ?? null;
|
||||
$viewedAt = $ack['viewed_at'] ?? '';
|
||||
$signedAt = $ack['signed_at'] ?? '';
|
||||
$signedName = $ack['signed_name'] ?? '';
|
||||
$hasReport = !empty(($reportAvailableMap ?? [])[$sid]);
|
||||
$hasReport = !empty(($reportAvailableMap ?? [])[$rowKey]);
|
||||
?>
|
||||
<tr>
|
||||
<td data-label="Student"><?= esc(trim(($student['firstname'] ?? '') . ' ' . ($student['lastname'] ?? ''))) ?></td>
|
||||
<td data-label="Class Section"><?= esc($student['class_section_name'] ?? 'N/A') ?></td>
|
||||
<td data-label="Semester"><?= esc($rowSemester) ?></td>
|
||||
<td data-label="Viewed"><?= $viewedAt ? esc(local_datetime($viewedAt, 'm-d-Y H:i')) : 'Not viewed' ?></td>
|
||||
<td data-label="Signature">
|
||||
<?php if ($signedAt): ?>
|
||||
@@ -141,13 +147,14 @@
|
||||
</td>
|
||||
<td class="text-end" data-label="Action">
|
||||
<?php if ($hasReport): ?>
|
||||
<a class="btn btn-sm btn-outline-primary" target="_blank" href="<?= base_url('parent/report-cards/view/' . $sid) ?>">View Report</a>
|
||||
<a class="btn btn-sm btn-outline-primary" target="_blank" href="<?= site_url('parent/report-cards/view/' . $sid) . '?' . http_build_query(['semester' => $rowSemester]) ?>">View Report</a>
|
||||
<?php else: ?>
|
||||
<button class="btn btn-sm btn-outline-secondary" type="button" disabled>No report available</button>
|
||||
<?php endif; ?>
|
||||
<?php if ($hasReport && ! $signedAt): ?>
|
||||
<form class="d-inline-flex align-items-center gap-2 ms-2" method="post" action="<?= base_url('parent/report-cards/sign/' . $sid) ?>">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="semester" value="<?= esc($rowSemester) ?>">
|
||||
<input type="text" name="signed_name" class="form-control form-control-sm" placeholder="Full name" required<?= $disabledAttr ?>>
|
||||
<button class="btn btn-sm btn-success" type="submit"<?= $disabledAttr ?>>Sign</button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user