This commit is contained in:
@@ -30,13 +30,6 @@
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php $semVal = (string)($semester ?? ($_GET['semester'] ?? '')); ?>
|
||||
<label for="tcaSemesterSelect" class="col-form-label">Semester</label>
|
||||
<select id="tcaSemesterSelect" name="semester" class="form-select form-select-sm" style="min-width: 140px;">
|
||||
<option value="">—</option>
|
||||
<option value="Fall" <?= (strcasecmp($semVal,'Fall')===0?'selected':'') ?>>Fall</option>
|
||||
<option value="Spring" <?= (strcasecmp($semVal,'Spring')===0?'selected':'') ?>>Spring</option>
|
||||
</select>
|
||||
<button type="submit" class="btn btn-secondary btn-sm">Apply</button>
|
||||
</form>
|
||||
<?php if (isset($isCurrentYear) && !$isCurrentYear): ?>
|
||||
@@ -183,9 +176,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
position = label.toLowerCase() === 'ta' ? 'ta' : 'main';
|
||||
}
|
||||
btn.setAttribute('data-position', position);
|
||||
var assignmentSemester = assignment.semester || '';
|
||||
var assignmentSchoolYear = assignment.school_year || selectedYear || '';
|
||||
btn.setAttribute('data-semester', assignmentSemester);
|
||||
btn.setAttribute('data-school-year', assignmentSchoolYear);
|
||||
li.appendChild(btn);
|
||||
|
||||
@@ -488,7 +479,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
var teacherId = removeBtn.getAttribute('data-teacher-id');
|
||||
var classSectionId = removeBtn.getAttribute('data-class-section-id');
|
||||
var position = removeBtn.getAttribute('data-position');
|
||||
var semester = removeBtn.getAttribute('data-semester') || '';
|
||||
var schoolYear = removeBtn.getAttribute('data-school-year') || '';
|
||||
var className = removeBtn.getAttribute('data-class-name') || 'this class';
|
||||
var teacherName = removeBtn.getAttribute('data-teacher-name') || 'this teacher';
|
||||
@@ -498,7 +488,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
teacher_id: teacherId,
|
||||
class_section_id: classSectionId,
|
||||
position: position,
|
||||
semester: semester,
|
||||
school_year: schoolYear
|
||||
});
|
||||
}
|
||||
|
||||
@@ -49,14 +49,15 @@ switch ($role) {
|
||||
try {
|
||||
$studentModel = new \App\Models\StudentModel();
|
||||
if (in_array($role, ['parent', 'parent_dashboard'], true)) {
|
||||
$configModel = new \App\Models\ConfigurationModel();
|
||||
try {
|
||||
$schoolYear = service('schoolYearContext')->resolve(service('request'))->yearName();
|
||||
} catch (\Throwable $e) {
|
||||
$schoolYear = session()->get('school_year') ?? $configModel->getConfig('school_year');
|
||||
}
|
||||
$parentId = (int)(session()->get('user_id') ?? 0);
|
||||
if ($parentId > 0) {
|
||||
$scoreCardStudents = $studentModel
|
||||
->select('id, school_id, firstname, lastname')
|
||||
->where('parent_id', $parentId)
|
||||
->orderBy('lastname', 'ASC')
|
||||
->orderBy('firstname', 'ASC')
|
||||
->findAll();
|
||||
if ($parentId > 0 && !empty($schoolYear)) {
|
||||
$scoreCardStudents = $studentModel->getByParentAndYear($parentId, (string) $schoolYear);
|
||||
}
|
||||
} else {
|
||||
$configModel = new \App\Models\ConfigurationModel();
|
||||
@@ -85,7 +86,7 @@ switch ($role) {
|
||||
)), static fn($v) => $v > 0));
|
||||
if (!empty($sectionIds)) {
|
||||
$studentClassModel = new \App\Models\StudentClassModel();
|
||||
$rows = $studentClassModel->getStudentsByClassSectionIds($sectionIds);
|
||||
$rows = $studentClassModel->getStudentsByClassSectionIds($sectionIds, (string) $schoolYear);
|
||||
$unique = [];
|
||||
foreach ($rows as $r) {
|
||||
$sid = (int)($r['student_id'] ?? 0);
|
||||
|
||||
Reference in New Issue
Block a user