This commit is contained in:
@@ -40,19 +40,6 @@ $queryString = http_build_query(array_filter($queryParams, static function ($val
|
||||
<?php endif; ?>
|
||||
|
||||
<form class="row gy-2 gx-3 align-items-end justify-content-center mb-4" method="get" action="<?= site_url('admin/teacher-attendance/month') ?>">
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">School Year</label>
|
||||
<select name="school_year" class="form-select">
|
||||
<?php
|
||||
$years = isset($schoolYears) && is_array($schoolYears) ? $schoolYears : [];
|
||||
if (empty($years) && !empty($schoolYear)) $years = [$schoolYear];
|
||||
foreach ($years as $y): $val = is_array($y) && isset($y['school_year']) ? $y['school_year'] : (string)$y; ?>
|
||||
<option value="<?= esc($val) ?>" <?= ((string)($schoolYear ?? '') === (string)$val) ? 'selected' : '' ?>>
|
||||
<?= esc($val) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label class="form-label">Semester</label>
|
||||
<select name="semester" class="form-select">
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
<link rel="stylesheet" href="<?= base_url('assets/css/style.css') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('assets/css/landing_page.css?v=1.1') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('assets/css/custom.css') ?>">
|
||||
<?php if (session()->get('is_logged_in')): ?>
|
||||
<link rel="stylesheet" href="<?= base_url('assets/css/session-timeout.css') ?>">
|
||||
<?php endif; ?>
|
||||
<?= $this->renderSection('styles') ?>
|
||||
|
||||
<?php
|
||||
@@ -396,6 +399,9 @@ html, body { overflow-x: hidden; }
|
||||
</script>
|
||||
|
||||
<?= $this->renderSection('scripts') ?>
|
||||
<?php if (session()->get('is_logged_in')): ?>
|
||||
<script src="<?= base_url('assets/js/session_timeout.js') ?>"></script>
|
||||
<?php endif; ?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -40,6 +40,9 @@
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.10/css/dataTables.bootstrap5.min.css">
|
||||
<!-- DataTables FixedHeader (Bootstrap 5 theme) -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/datatables.net-fixedheader-bs5@3.4.0/css/fixedHeader.bootstrap5.min.css">
|
||||
<?php if (session()->get('is_logged_in')): ?>
|
||||
<link rel="stylesheet" href="<?= base_url('assets/css/session-timeout.css') ?>">
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Note: Avoid loading a second Bootstrap build to prevent conflicts with CDN 5.3.3 -->
|
||||
<?php
|
||||
@@ -753,5 +756,8 @@
|
||||
})();
|
||||
</script>
|
||||
<?= $this->renderSection('scripts') ?>
|
||||
<?php if (session()->get('is_logged_in')): ?>
|
||||
<script src="<?= base_url('assets/js/session_timeout.js') ?>"></script>
|
||||
<?php endif; ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
<h5 class="mb-1">Student Promotion Preview</h5>
|
||||
<div class="text-muted small">Promotion decisions must be generated and resolved before this school year can end.</div>
|
||||
</div>
|
||||
<a class="btn btn-outline-primary btn-sm" href="<?= site_url('grading/decisions?' . http_build_query(['school_year' => $source['name'] ?? ''])) ?>">
|
||||
<a class="btn btn-outline-primary btn-sm" href="<?= site_url('grading/below-60/decisions') ?>">
|
||||
Manage Promotion Decisions
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -13,15 +13,9 @@
|
||||
$money = static fn ($value): string => '$' . number_format((float) $value, 2);
|
||||
$activeId = (int) ($activeYear['id'] ?? 0);
|
||||
$nextDraftId = (int) ($nextDraftYear['id'] ?? 0);
|
||||
$defaultNewPreviousYear = $activeYear ?: ($schoolYears[0] ?? null);
|
||||
$newDraftName = (string) ($nextDraftDefaults['name'] ?? '');
|
||||
$defaultNewPreviousYear = $nextDraftDefaults['previous_year'] ?? null;
|
||||
$defaultNewPreviousYearName = (string) ($defaultNewPreviousYear['name'] ?? 'None');
|
||||
$previousYearNameByNewYearName = [];
|
||||
foreach (($schoolYears ?? []) as $existingYear) {
|
||||
$existingName = (string) ($existingYear['name'] ?? '');
|
||||
if (preg_match('/^(\d{4})-(\d{4})$/', $existingName, $matches)) {
|
||||
$previousYearNameByNewYearName[$matches[2] . '-' . ((int) $matches[2] + 1)] = $existingName;
|
||||
}
|
||||
}
|
||||
$closingPreviewUrl = $activeId > 0
|
||||
? site_url('administrator/school-years/' . $activeId . '/closing/preview' . ($nextDraftId > 0 ? '?' . http_build_query(['target_school_year_id' => $nextDraftId]) : ''))
|
||||
: '';
|
||||
@@ -91,7 +85,13 @@
|
||||
<?= csrf_field() ?>
|
||||
<div class="col-md-2">
|
||||
<label class="form-label" for="new_school_year_name">School Year</label>
|
||||
<input class="form-control" id="new_school_year_name" name="name" placeholder="2026-2027" required pattern="\d{4}-\d{4}">
|
||||
<input
|
||||
class="form-control"
|
||||
id="new_school_year_name"
|
||||
type="text"
|
||||
value="<?= esc($newDraftName !== '' ? $newDraftName : 'Not available', 'attr') ?>"
|
||||
readonly
|
||||
>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label class="form-label" for="new_previous_school_year_display">Previous Year</label>
|
||||
@@ -100,7 +100,6 @@
|
||||
id="new_previous_school_year_display"
|
||||
type="text"
|
||||
value="<?= esc($defaultNewPreviousYearName, 'attr') ?>"
|
||||
data-default-previous-year="<?= esc($defaultNewPreviousYearName, 'attr') ?>"
|
||||
readonly
|
||||
>
|
||||
</div>
|
||||
@@ -125,7 +124,7 @@
|
||||
<input class="form-control" id="new_fall_makeup_exam_on" name="fall_makeup_exam_on" type="date">
|
||||
</div>
|
||||
<div class="col-md-2 d-flex gap-2">
|
||||
<button class="btn btn-primary" type="submit">Save Draft</button>
|
||||
<button class="btn btn-primary" type="submit" <?= $newDraftName === '' ? 'disabled' : '' ?>>Save Draft</button>
|
||||
<button class="btn btn-secondary" type="button" data-bs-toggle="collapse" data-bs-target="#schoolYearCreateForm">Cancel</button>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
@@ -435,21 +434,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
order: [[0, 'desc']]
|
||||
});
|
||||
}
|
||||
|
||||
const newYearInput = document.getElementById('new_school_year_name');
|
||||
const previousYearDisplay = document.getElementById('new_previous_school_year_display');
|
||||
const previousYearByNewYear = <?= json_encode($previousYearNameByNewYearName, JSON_UNESCAPED_SLASHES) ?>;
|
||||
|
||||
if (newYearInput && previousYearDisplay) {
|
||||
const defaultPreviousYear = previousYearDisplay.dataset.defaultPreviousYear || 'None';
|
||||
const updatePreviousYear = function () {
|
||||
const newYearName = newYearInput.value.trim();
|
||||
previousYearDisplay.value = previousYearByNewYear[newYearName] || defaultPreviousYear;
|
||||
};
|
||||
|
||||
newYearInput.addEventListener('input', updatePreviousYear);
|
||||
updatePreviousYear();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
@@ -21,19 +21,6 @@
|
||||
<label>Phone Number</label>
|
||||
<input type="tel" name="phone" class="form-control" value="<?= esc($user['phone'] ?? '') ?>" placeholder="Enter phone number">
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div class="mb-3">
|
||||
<label>Role</label>
|
||||
<select name="role_id" class="form-control" required>
|
||||
<?php foreach ($roles as $role): ?>
|
||||
<option value="<?= $role['id'] ?>" <?= $roleId == $role['id'] ? 'selected' : '' ?>>
|
||||
<?= esc($role['name']) ?>
|
||||
</option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</div>
|
||||
-->
|
||||
<button type="submit" class="btn btn-primary">Update</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -32,15 +32,15 @@
|
||||
<?php foreach ($staff as $s): ?>
|
||||
<tr class="<?= !empty($s['verification_issue']) ? 'table-warning' : '' ?>">
|
||||
<td style="text-align: center;"><?= esc($order++); ?></td>
|
||||
<td><?= esc($s['school_id']) ?></td>
|
||||
<td><?= esc($s['firstname']) ?></td>
|
||||
<td><?= esc($s['lastname']) ?></td>
|
||||
<td><?= esc($s['email']) ?></td>
|
||||
<td><?= esc($s['phone'] ?? '') ?></td>
|
||||
<td><?= esc($s['active_role']) ?></td>
|
||||
<td><?= esc($s['school_id'] ?? '') ?></td>
|
||||
<td><?= esc($s['firstname'] ?? '') ?></td>
|
||||
<td><?= esc($s['lastname'] ?? '') ?></td>
|
||||
<td><?= esc($s['work_email'] ?? '') ?></td>
|
||||
<td><?= esc($s['cellphone'] ?? '') ?></td>
|
||||
<td><?= esc($s['roles'] ?? ($s['active_role'] ?? '')) ?></td>
|
||||
<td><?= esc($s['class_section']) ?></td>
|
||||
<td>
|
||||
<a href="<?= site_url('staff/edit/' . $s['id']) ?>" class="btn btn-sm btn-warning">Edit</a>
|
||||
<a href="<?= site_url('staff/edit/' . (int) ($s['staff_id'] ?? 0)) ?>" class="btn btn-sm btn-warning">Edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user