0,'total_amount'=>0,'paid_amount'=>0,'balance'=>0]; // Title: prefer provided household_name unless it's generic like "Family of User 53" or empty. $titleRaw = trim((string)($f['household_name'] ?? '')); $title = $titleRaw; if ($title === '' || preg_match('/^\s*Family\s+of\s+User\s*\d+\s*$/i', $title)) { // Derive from primary guardian last name, else first guardian's last name $lastName = ''; $primary = null; foreach (($f['guardians'] ?? []) as $g) { if (!empty($g['is_primary'])) { $primary = $g; break; } } $pick = $primary ?: (($f['guardians'][0] ?? null) ?: null); if ($pick) { $ln = trim((string)($pick['lastname'] ?? '')); if ($ln !== '') $lastName = $ln; } $title = $lastName !== '' ? ('Family of ' . $lastName) : 'Family'; } $returnUrl = trim((string)service('request')->getServer('HTTP_REFERER')); if ($returnUrl === '') { $returnUrl = site_url('family'); } ?>
Guardians: Students: Invoices: Balance: $
Students
No students linked.
Guardians
Total:
No guardians yet.
Guardian Contact Address
Primary
Relation:
' . esc($gEmail) . '') : '' ?>
'.esc($g['cellphone']).'') : '' ?>
trim((string)$x) !== ''); ?>
Emergency Contacts
Linked to parents/guardians
No emergency contacts on file.
Parent Contact Name Relation Phone Email Updated
'.esc($ph).'') : '' ?> '.esc($em).'') : '' ?>
Invoices
Total
$
Paid
$
Balance
$
Invoices
No invoices on record.
#StatusTotalPaidBalanceDate
$ $ $
Recent Payments
No payments on record.
InvoiceAmountBalanceMethodDateStatus
$ $