= $this->extend('layout/management_layout') ?> = $this->section('content') ?> [], 'rows' => []]; $promotionSummary = $promotion['summary'] ?? []; $promotionRows = $promotion['rows'] ?? []; $promotionTotal = count($promotionRows); $blockers = $preview['blockers'] ?? []; $warnings = $preview['warnings'] ?? []; $carryForward = $preview['carry_forward'] ?? []; $status = (string) ($source['status'] ?? ''); $batchStatus = (string) ($latestBatch['status'] ?? ''); $missingCarryForwardInvoices = (int) ($missingCarryForwardInvoices ?? 0); $money = static fn ($value): string => '$' . number_format((float) $value, 2); $score = static fn ($value): string => is_numeric($value) ? number_format((float) $value, 2) : '-'; $ageBySchoolYearSecondSeptember = static function (array $row) use ($source): string { $dob = trim((string) ($row['dob'] ?? '')); $schoolYear = (string) ($source['name'] ?? ''); if ($dob === '' || preg_match('/^\d{4}-(\d{4})$/', $schoolYear, $matches) !== 1) { return ''; } try { $birthDate = new DateTimeImmutable($dob); $cutoff = new DateTimeImmutable($matches[1] . '-09-01'); } catch (Throwable) { return ''; } if ($birthDate > $cutoff) { return ''; } return (string) $birthDate->diff($cutoff)->y; }; $kgPlacementFallback = static function (array $row) use ($target): string { $classText = strtoupper(trim( (string) ($row['class_name'] ?? '') . ' ' . (string) ($row['class_section_name'] ?? '') )); if (preg_match('/(^|[^A-Z0-9])KG([^A-Z0-9]|$)/', $classText) !== 1 && ! str_contains($classText, 'KINDERGARTEN')) { return ''; } $dob = trim((string) ($row['dob'] ?? '')); if ($dob === '') { return ''; } try { $targetName = (string) ($target['name'] ?? ''); if (preg_match('/^(\d{4})-\d{4}$/', $targetName, $matches) === 1) { $cutoff = new DateTimeImmutable($matches[1] . '-09-01'); } else { $today = new DateTimeImmutable('today'); $cutoff = new DateTimeImmutable($today->format('Y') . '-09-01'); if ($today > $cutoff) { $cutoff = $cutoff->modify('+1 year'); } } $birthDate = new DateTimeImmutable($dob); } catch (Throwable) { return ''; } if ($birthDate > $cutoff) { return ''; } return $birthDate->diff($cutoff)->y >= 6 ? '1' : 'KG'; }; ?> getFlashdata('success')): ?>
No blocking issues found.
No warnings found.
| Student | School ID | Class | Age Sep 1 | Year Score | Decision | Source | Next Year Placement | Status |
|---|---|---|---|---|---|---|---|---|
| = esc($row['student_name'] ?? ('Student #' . (int) ($row['student_id'] ?? 0))) ?> | = esc($row['school_id'] ?? '') ?> | = esc($row['class_section_name'] ?? '') ?> | = esc($ageSepOne !== '' ? $ageSepOne : '-') ?> | = esc($score($row['year_score'] ?? null)) ?> | = esc(($row['decision'] ?? '') !== '' ? $row['decision'] : '-') ?> | = esc($sourceLabel) ?> | = esc($targetLabel !== '' ? $targetLabel : '-') ?> | = esc(ucfirst($rowStatus)) ?> |
| Family | Parent | Source Balance | Credits | Adjustments | Net Carry-Forward |
|---|---|---|---|---|---|
| = esc($row['family']) ?> |
= esc($row['parent'] ?? ('Parent #' . (int) ($row['family_id'] ?? 0))) ?>
= esc($row['parent_email']) ?>
|
= esc($money($row['source_balance'])) ?> | = esc($money($row['credit_amount'])) ?> | = esc($money($row['adjustment_amount'])) ?> | = esc($money($row['carry_forward_amount'])) ?> |