= $this->extend('layout/management_layout') ?> = $this->section('styles') ?> = $this->endSection() ?> = $this->section('content') ?> 'Assign a class', 'PENDING_MAKE_UP_EXAM_PROMOTION' => 'Makeup exam', 'AGE_EXCEPTION_REQUIRED' => 'Age exception', 'LATE_REGISTRATION_EXCEPTION' => 'Late registration', 'FINANCIAL_REVIEW_REQUIRED' => 'Finance review', 'DEFERRED_DELIBERATION' => 'Decision review', 'RESTRICTED_ADMINISTRATIVE_REVIEW' => 'Restricted review', 'WITHDRAWAL_REVIEW_REQUIRED' => 'Withdrawal review', 'COMPLETION_OR_EXIT_PROCESS_REQUIRED' => 'Exit / completion', 'ADULT_STUDENT_ACTION_REQUIRED', 'ADULT_STUDENT_PARENT_BLOCKED' => 'Adult student', 'SIBLING_LAST_NAME_MISMATCH' => 'Sibling last names', 'NO_FINAL_DECISION' => 'No final decision', 'UNRECOGNIZED_DECISION' => 'Unrecognized decision', 'DEFERRED_DECISION' => 'Deferred decision', 'EXPELLED' => 'Expelled', 'WITHDRAWN' => 'Withdrawn', 'DENIED' => 'Denied', 'MAKE_UP_EXAM' => 'Makeup exam', default => $type !== '' ? ucwords(strtolower(str_replace('_', ' ', $type))) : 'Unknown', }; } } if (!function_exists('enrollment_admin_issue_code')) { function enrollment_admin_issue_code(array $flag): string { $type = strtoupper(trim((string) ($flag['flag_type'] ?? ''))); $details = is_array($flag['details'] ?? null) ? $flag['details'] : []; $ruleCode = strtoupper(trim((string) ($details['rule_code'] ?? ''))); if ($ruleCode !== '') { return $ruleCode; } if ($type === 'DEFERRED_DELIBERATION') { $reason = strtolower((string) ($details['reason'] ?? '')); if (str_contains($reason, 'unrecognized')) { return 'UNRECOGNIZED_DECISION'; } if (str_contains($reason, 'missing') || str_contains($reason, 'no final')) { return 'NO_FINAL_DECISION'; } } return $type; } } if (!function_exists('enrollment_admin_issue_badge_class')) { function enrollment_admin_issue_badge_class(string $code): string { return match (strtoupper($code)) { 'NO_FINAL_DECISION', 'UNRECOGNIZED_DECISION', 'EXPELLED', 'DENIED', 'RESTRICTED_ADMINISTRATIVE_REVIEW' => 'bg-danger', 'DEFERRED_DECISION', 'DEFERRED_DELIBERATION', 'FINANCIAL_REVIEW_REQUIRED', 'OUTSTANDING_BALANCE_BLOCKED', 'FINANCE_APPROVAL_REQUIRED' => 'bg-warning text-dark', 'ADULT_STUDENT_ACTION_REQUIRED', 'ADULT_STUDENT_PARENT_BLOCKED' => 'adult-student', 'PENDING_MAKE_UP_EXAM_PROMOTION', 'MAKE_UP_EXAM', 'AGE_EXCEPTION_REQUIRED' => 'bg-info text-dark', 'CLASS_REASSIGNMENT_REQUIRED' => 'bg-primary', 'WITHDRAWN', 'WITHDRAWAL_REVIEW_REQUIRED', 'COMPLETION_OR_EXIT_PROCESS_REQUIRED' => 'bg-dark', 'SIBLING_LAST_NAME_MISMATCH', 'LATE_REGISTRATION_EXCEPTION' => 'bg-secondary', default => 'bg-secondary', }; } } if (!function_exists('enrollment_admin_placement_label')) { function enrollment_admin_placement_label(string $status): string { return match ($status) { 'automatic_distribution_pending' => 'Awaiting class assignment', 'manual_class_required' => 'Needs a class assigned', 'temporary_manual_class_required' => 'Needs a temporary class', 'same_class_assigned' => 'Same class assigned', 'temporary_same_grade' => 'Temporary same grade', 'exit_required' => 'Exit / completion', 'not_created' => 'Not created', default => $status !== '' ? ucwords(str_replace('_', ' ', $status)) : 'Pending', }; } } if (!function_exists('enrollment_admin_rule_label')) { function enrollment_admin_rule_label(string $code): string { return match ($code) { 'STUDENT_NOT_LINKED' => 'Student is not linked to this parent', 'SOURCE_YEAR_NOT_FOUND' => 'Student was not in the previous year', 'TARGET_YEAR_NOT_FOUND' => 'School year was not found', 'ALREADY_ENROLLED' => 'Already enrolled', 'SIBLING_LAST_NAME_MISMATCH' => 'Sibling last names do not match', 'OUTSTANDING_BALANCE_BLOCKED' => 'Previous-year balance must be paid', 'FINANCE_APPROVAL_REQUIRED' => 'Finance approval required', 'CURRENT_YEAR_INSTALLMENT_OVERRIDE' => 'Allow installments for new-year balance only', 'AGE_RULE_BLOCKED' => 'Age rule not met', 'REGISTRATION_CLOSED' => 'Registration is closed', 'REGISTRATION_NOT_OPEN' => 'Registration is not open yet', 'ADULT_STUDENT_PARENT_BLOCKED' => 'Adult students cannot enroll or re-enroll at the school', 'EXIT_REQUIRED' => 'Exit / completion required', 'EXPELLED' => 'Expelled — administrative review', 'WITHDRAWN' => 'Withdrawn — review required', 'NO_FINAL_DECISION' => 'No final academic decision', 'UNRECOGNIZED_DECISION' => 'Unrecognized academic decision', 'DEFERRED_DECISION' => 'Deferred academic decision', 'REVIEW_REQUIRED' => 'Staff review required', 'LAST_NAME_EXCEPTION_CARRIED_FORWARD' => 'Last-name exception carried forward', 'PASSED' => 'Passed', 'REPEAT_CLASS' => 'Repeat class', 'MAKE_UP_EXAM' => 'Makeup exam', default => enrollment_admin_flag_label($code), }; } } if (!function_exists('enrollment_admin_decision_label')) { function enrollment_admin_decision_label(string $decision): string { return match ($decision) { 'ELIGIBLE' => 'Can enroll', 'ELIGIBLE_WITH_WARNING' => 'Can enroll, with follow-up', 'INELIGIBLE' => 'Cannot enroll', 'REVIEW_REQUIRED' => 'Needs staff review', 'EXCEPTION_ELIGIBLE' => 'Can enroll with exception', 'ALREADY_ENROLLED' => 'Already enrolled', default => $decision !== '' ? ucwords(strtolower(str_replace('_', ' ', $decision))) : 'Pending', }; } } if (!function_exists('enrollment_admin_exception_status_label')) { function enrollment_admin_exception_status_label(string $status): string { return match ($status) { 'active' => 'Active', 'used' => 'Used', 'revoked' => 'Revoked', 'expired' => 'Expired', default => $status !== '' ? ucfirst($status) : 'Unknown', }; } } if (!function_exists('enrollment_admin_audit_action_label')) { function enrollment_admin_audit_action_label(string $action): string { return match ($action) { 'flag_resolved' => 'Closed a work item', 'manual_class_assignment' => 'Assigned a class', 'make_up_exam_promotion_completed' => 'Recorded a passing makeup exam', 'make_up_exam_no_promotion_required' => 'Recorded a failed makeup exam', 'enrollment_exception_created' => 'Granted an exception', 'enrollment_exception_revoked' => 'Revoked an exception', 'initial_transition_applied' => 'Applied year transition', 'transition_evaluation_blocked' => 'Transition blocked', default => $action !== '' ? ucwords(str_replace('_', ' ', $action)) : '', }; } } if (!function_exists('enrollment_admin_reason_label')) { function enrollment_admin_reason_label(string $code, array $reasonCodes): string { if (isset($reasonCodes[$code]) && is_string($reasonCodes[$code]) && $reasonCodes[$code] !== '') { return $reasonCodes[$code]; } return enrollment_admin_rule_label($code); } } $selectedParentId = (int) ($exceptionSelectedParentId ?? 0); $preview = $exceptionPreview ?? null; $nonOverridableCodes = ['STUDENT_NOT_LINKED', 'SOURCE_YEAR_NOT_FOUND', 'TARGET_YEAR_NOT_FOUND', 'ALREADY_ENROLLED']; $previewStudents = is_array($preview['students'] ?? null) ? $preview['students'] : []; $hasGrantableStudent = false; $openFlagCount = (int) ($openFlagCount ?? 0); $activeExceptionCount = 0; foreach (($activeExceptions ?? []) as $exceptionRow) { if (($exceptionRow['status'] ?? '') === 'active') { $activeExceptionCount++; } } $emailExampleCount = count($emailExamples ?? []); $failedEmailCount = count(array_filter($emailExamples ?? [], static fn ($example): bool => ($example['delivery_status'] ?? '') === 'failed')); $launchReady = empty($launchState['missing']); $launchApproved = !empty($launchState['approved']); $defaultTab = 'work'; $emailStepLabel = $launchApproved ? 'Ready' : ($launchReady ? 'Review' : 'Blocked'); $reasonCodes = is_array($exceptionReasonCodes ?? null) ? $exceptionReasonCodes : []; ?>
Work these steps in order: clear today's queue, grant any family exceptions, then send parent emails.
Start here. These are students who currently cannot complete re-enrollment, plus makeup and class follow-ups.
| Student | School ID | Issue | Details | Update by | What to do |
|---|---|---|---|---|---|
| = esc($flag['student_name'] ?? '') ?> = student_enrollment_status_button($flag, $schoolYear ?? null) ?> | = esc($flag['school_id'] ?? '') ?> | = esc(enrollment_admin_flag_label($issueCode)) ?> |
$value): ?>
= esc(ucwords(str_replace('_', ' ', (string) $key))) ?>: = esc(is_scalar($value) ? (string) $value : json_encode($value)) ?>
No extra details
|
= esc($flag['assignee_name'] ?: '') ?> |
= esc($flag['resolution_notes'] ?? '') ?>
|
Use the lookup to grant a family exception after reviewing the matching work queue item. Saved exceptions stay here for audit and revocation.
| Student | Parent | Status | Reason | Bypassed rules | Created by | School year | Action |
|---|---|---|---|---|---|---|---|
|
= esc($exception['student_name'] ?? '') ?>
= student_enrollment_status_button($exception, $schoolYear ?? null) ?>
= esc($exception['school_id'] ?? '') ?>
|
= esc($exception['parent_name'] ?? '') ?> | = esc(enrollment_admin_exception_status_label($exceptionStatus)) ?> |
= esc(enrollment_admin_reason_label((string) ($exception['reason_code'] ?? ''), $reasonCodes)) ?>
= esc($exception['reason_note'] ?? '') ?>
|
= esc($bypassedLabels !== [] ? implode(', ', $bypassedLabels) : 'None') ?> | = esc($exception['created_by_name'] ?? '') ?> | = esc($exception['school_year'] ?? ($schoolYear ?? '')) ?> |
= esc($exception['revocation_reason']) ?>
-
|
Preview one email, approve the launch, then send. Do this after the work queue and exceptions are in good shape.
Open one parent email and confirm the wording, dates, and fees look right.
Preview sample No parent with linked students is available for a sample preview.Approved = esc(local_datetime($launchState['approved_at'], 'm-d-Y H:i')) ?>.
Approve only after the year dates and fees are correct.
This emails parents for = esc((string) ($schoolYear ?? '')) ?>. Use resend only if you need to send again.
| Parent | Recipient | Students | Subject | Delivery | Example |
|---|---|---|---|---|---|
| = esc($example['parent_name'] ?? '') ?> | = esc(implode(', ', $example['recipients'] ?? [])) ?> | $student): ?> = $studentIndex > 0 ? ', ' : '' ?> = esc($student['name'] ?? '') ?> = esc($student['name'] ?? '') ?> = esc($student['name'] ?? '') ?> = esc(implode(', ', $example['student_names'] ?? [])) ?> | = esc($example['subject'] ?? '') ?> |
= esc($deliveryLabel) ?>
= esc(local_datetime($example['sent_at'], 'm-d-Y H:i')) ?>
= esc($example['failure_reason']) ?>
|
View example |
A record of enrollment decisions and exception actions for this school year.
| When | Student | Action | Administrator | Reason |
|---|---|---|---|---|
| = esc(!empty($row['created_at']) ? local_datetime($row['created_at'], 'm-d-Y H:i') : '') ?> | = esc($row['student_name'] ?? '') ?> = student_enrollment_status_button($row, $schoolYear ?? null) ?> | = esc(enrollment_admin_audit_action_label((string) ($row['action'] ?? ''))) ?> | = esc($row['performed_by_name'] ?? '') ?> | = esc($row['reason'] ?? '') ?> |