report cadr and trophy
This commit is contained in:
@@ -73,19 +73,6 @@ class ReportCardsController extends PrintablesBaseController
|
|||||||
$semesters = array_values(array_filter(array_map(static fn($r) => (string)($r['semester'] ?? ''), $rs)));
|
$semesters = array_values(array_filter(array_map(static fn($r) => (string)($r['semester'] ?? ''), $rs)));
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
$rs2 = $this->db->table('student_class')
|
|
||||||
->select('DISTINCT semester', false)
|
|
||||||
->where('school_year', $year)
|
|
||||||
->where('semester IS NOT NULL', null, false)
|
|
||||||
->orderBy('semester', 'ASC')
|
|
||||||
->get()->getResultArray();
|
|
||||||
foreach ($rs2 as $r) {
|
|
||||||
$val = (string)($r['semester'] ?? '');
|
|
||||||
if ($val !== '' && !in_array($val, $semesters, true)) $semesters[] = $val;
|
|
||||||
}
|
|
||||||
} catch (\Throwable $e) {
|
|
||||||
}
|
|
||||||
// Ensure standard options are present even if data is missing (so Spring can be selected)
|
// Ensure standard options are present even if data is missing (so Spring can be selected)
|
||||||
$defaults = array_values(array_filter([(string)($this->semester ?? ''), 'Fall', 'Spring'], static fn($v) => $v !== ''));
|
$defaults = array_values(array_filter([(string)($this->semester ?? ''), 'Fall', 'Spring'], static fn($v) => $v !== ''));
|
||||||
foreach ($defaults as $d) {
|
foreach ($defaults as $d) {
|
||||||
|
|||||||
@@ -362,7 +362,7 @@ $overallAccuracy = $totalPredicted > 0 ? round($totalConfirmed / $totalPredicted
|
|||||||
$rank = 0;
|
$rank = 0;
|
||||||
foreach ($classResults as $cls):
|
foreach ($classResults as $cls):
|
||||||
foreach ($cls['students'] as $s):
|
foreach ($cls['students'] as $s):
|
||||||
if ($s['status'] === 'none') continue;
|
if (!in_array($s['status'], ['confirmed', 'surprise'], true)) continue;
|
||||||
$rank++;
|
$rank++;
|
||||||
$isMale = strtolower($s['gender'] ?? '') === 'male';
|
$isMale = strtolower($s['gender'] ?? '') === 'male';
|
||||||
$statusLabel = match ($s['status']) {
|
$statusLabel = match ($s['status']) {
|
||||||
|
|||||||
Reference in New Issue
Block a user