This commit is contained in:
root
2026-05-26 23:14:55 -04:00
parent 5ed65a867c
commit c294d7bed7
38 changed files with 277 additions and 146 deletions
+15 -3
View File
@@ -9,13 +9,15 @@
<div class="d-flex justify-content-between align-items-center mb-3 flex-wrap gap-2">
<div class="text-muted">
<?= esc(ucfirst($semester ?? '')) ?> • <?= esc($schoolYear ?? '') ?>
<?= !empty($isYearMode) ? 'Whole Year' : esc(ucfirst($semester ?? '')) ?> • <?= esc($schoolYear ?? '') ?>
</div>
<div class="d-flex gap-2">
<?php if (empty($isYearMode)): ?>
<a class="btn btn-outline-primary btn-sm"
href="<?= site_url('grading/below-60/decisions?' . http_build_query(['semester' => $semester ?? '', 'school_year' => $schoolYear ?? ''])) ?>">
Decisions
</a>
<?php endif; ?>
<?php if (!empty($canViewGrading)): ?>
<a class="btn btn-outline-secondary btn-sm" href="<?= base_url('grading') ?>">
Back to Grading
@@ -47,6 +49,7 @@
<tr>
<th>Student Name</th>
<th>Section</th>
<?php if (!empty($isYearMode)): ?><th>Semester</th><?php endif; ?>
<th>Hwk Avg</th>
<th>Project Avg</th>
<th>Participation</th>
@@ -54,10 +57,12 @@
<th>PTAP Score</th>
<th>Attendance</th>
<th>Midterm Score</th>
<th><?= strcasecmp($semester ?? '', 'fall') === 0 ? '1st Semester Score' : 'Semester Score' ?></th>
<th><?= !empty($isYearMode) ? 'Semester Score' : (strcasecmp($semester ?? '', 'fall') === 0 ? '1st Semester Score' : 'Semester Score') ?></th>
<?php if (empty($isYearMode)): ?>
<th>Status</th>
<th>Email Parent</th>
<th>Schedule Meeting</th>
<?php endif; ?>
</tr>
</thead>
<tbody>
@@ -76,9 +81,13 @@
$studentName = trim((string)($row['firstname'] ?? '') . ' ' . (string)($row['lastname'] ?? ''));
?>
<?php $isClosed = ($row['status'] ?? 'Open') === 'Closed'; ?>
<?php $rowSemester = ucfirst(strtolower(trim((string)($row['semester'] ?? ($semester ?? ''))))); ?>
<tr class="<?= esc($scoreClass) ?>">
<td><?= esc($studentName !== '' ? $studentName : 'N/A') ?></td>
<td><?= esc($row['class_section_name'] ?? '—') ?></td>
<?php if (!empty($isYearMode)): ?>
<td class="text-center"><?= esc($rowSemester) ?></td>
<?php endif; ?>
<td class="text-center"><?= $displayScore($row['homework_avg'] ?? null) ?></td>
<td class="text-center"><?= $displayScore($row['project_avg'] ?? null) ?></td>
<td class="text-center"><?= $displayScore($row['participation_score'] ?? null) ?></td>
@@ -87,6 +96,7 @@
<td class="text-center"><?= $displayScore($row['attendance_score'] ?? null) ?></td>
<td class="text-center"><?= $displayScore($row['midterm_exam_score'] ?? null) ?></td>
<td class="text-center"><?= $displayScore($row['semester_score'] ?? null) ?></td>
<?php if (empty($isYearMode)): ?>
<td class="text-center">
<form method="post" action="<?= site_url('grading/below-60/status') ?>" class="d-flex align-items-center gap-2 justify-content-center">
<?= csrf_field() ?>
@@ -121,6 +131,7 @@
</a>
<?php endif; ?>
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
@@ -147,8 +158,9 @@
const table = $('.below-sixty-dt');
if (!table.length) return;
try {
const semesterOffset = <?= !empty($isYearMode) ? '1' : '0' ?>;
table.DataTable({
order: [[8, 'asc']],
order: [[8 + semesterOffset, 'asc']],
pageLength: 100,
lengthMenu: [10, 25, 50, 100, 200]
});