fix is_active student flag and apply it in all pages
This commit is contained in:
@@ -176,14 +176,20 @@ if (empty($schoolYears) && $schoolYear !== '') {
|
||||
}
|
||||
|
||||
$studentName = trim((string)($row['firstname'] ?? '') . ' ' . (string)($row['lastname'] ?? ''));
|
||||
$studentLabel = $studentName !== '' ? $studentName : 'N/A';
|
||||
$currentDecision = (string)($row['decision'] ?? '');
|
||||
$currentNotes = (string)($row['decision_notes'] ?? '');
|
||||
$badge = $decisionBadge[$currentDecision] ?? null;
|
||||
?>
|
||||
$studentLabel = $studentName !== '' ? $studentName : 'N/A';
|
||||
$currentDecision = (string)($row['decision'] ?? '');
|
||||
$currentNotes = (string)($row['decision_notes'] ?? '');
|
||||
$badge = $decisionBadge[$currentDecision] ?? null;
|
||||
$rowLocked = student_is_non_active_for_editing($row, $schoolYear ?? null);
|
||||
$rowClass = trim($rowClass . ' ' . ($rowLocked ? 'table-secondary text-muted' : ''));
|
||||
$controlsEditable = $isEditable && !$rowLocked;
|
||||
?>
|
||||
|
||||
<tr class="<?= esc($rowClass) ?>">
|
||||
<td><?= esc($studentLabel) ?></td>
|
||||
<td>
|
||||
<?= esc($studentLabel) ?>
|
||||
<?= student_enrollment_status_button($row, $schoolYear ?? null) ?>
|
||||
</td>
|
||||
|
||||
<td class="text-center"><?= esc((string)($row['age'] ?? '—')) ?></td>
|
||||
|
||||
@@ -219,15 +225,15 @@ if (empty($schoolYears) && $schoolYear !== '') {
|
||||
value="<?= esc((string)$schoolYear) ?>">
|
||||
|
||||
<textarea name="notes"
|
||||
class="form-control form-control-sm decision-notes"
|
||||
rows="3"
|
||||
placeholder="Add comments or rationale…"
|
||||
<?= $isEditable ? '' : 'readonly' ?>><?= esc($currentNotes) ?></textarea>
|
||||
class="form-control form-control-sm decision-notes"
|
||||
rows="3"
|
||||
placeholder="Add comments or rationale…"
|
||||
<?= $controlsEditable ? '' : 'readonly aria-disabled="true"' ?>><?= esc($currentNotes) ?></textarea>
|
||||
|
||||
<div class="d-flex gap-2 mt-2 align-items-center">
|
||||
<select name="decision"
|
||||
class="form-select form-select-sm decision-select flex-grow-1"
|
||||
<?= $isEditable ? '' : 'disabled' ?>>
|
||||
<select name="decision"
|
||||
class="form-select form-select-sm decision-select flex-grow-1"
|
||||
<?= $controlsEditable ? '' : 'disabled aria-disabled="true"' ?>>
|
||||
<?php foreach ($decisionOptions as $val => $label): ?>
|
||||
<option value="<?= esc($val) ?>" <?= $currentDecision === $val ? 'selected' : '' ?>>
|
||||
<?= esc($label) ?>
|
||||
@@ -235,9 +241,9 @@ if (empty($schoolYears) && $schoolYear !== '') {
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
|
||||
<button type="submit"
|
||||
class="btn btn-sm btn-primary"
|
||||
<?= $isEditable ? '' : 'disabled' ?>>
|
||||
<button type="submit"
|
||||
class="btn btn-sm btn-primary"
|
||||
<?= $controlsEditable ? '' : 'disabled' ?>>
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
@@ -252,10 +258,10 @@ if (empty($schoolYears) && $schoolYear !== '') {
|
||||
|
||||
<button type="button"
|
||||
class="btn btn-sm btn-outline-primary btn-send-email"
|
||||
data-student-id="<?= (int)($row['student_id'] ?? 0) ?>"
|
||||
data-semester="year"
|
||||
data-school-year="<?= esc((string)$schoolYear) ?>"
|
||||
<?= $isEditable ? '' : 'disabled' ?>>
|
||||
data-student-id="<?= (int)($row['student_id'] ?? 0) ?>"
|
||||
data-semester="year"
|
||||
data-school-year="<?= esc((string)$schoolYear) ?>"
|
||||
<?= $controlsEditable ? '' : 'disabled' ?>>
|
||||
Send Email
|
||||
</button>
|
||||
<?php else: ?>
|
||||
|
||||
Reference in New Issue
Block a user