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'); } ?>
| Guardian | Contact | Address |
|---|---|---|
|
Relation: = esc($relLabel) ?>
|
= $gEmail !== '' ? ('' . esc($gEmail) . '') : '—' ?>
= !empty($g['cellphone']) ? (''.esc($g['cellphone']).'') : '—' ?>
|
trim((string)$x) !== ''); ?> = esc(implode(', ', $addrParts) ?: '—') ?> |
| Parent | Contact Name | Relation | Phone | Updated | |
|---|---|---|---|---|---|
| = esc($pl ?: ('Parent #'.$pid)) ?> | = esc($ec['emergency_contact_name'] ?? '') ?> | = esc($ec['relation'] ?? '') ?> | = $ph !== '' ? (''.esc($ph).'') : '—' ?> | = $em !== '' ? (''.esc($em).'') : '—' ?> | = esc($ud ? local_date($ud, 'm-d-Y') : '—') ?> |
| # | Status | Total | Paid | Balance | Date |
|---|---|---|---|---|---|
| = esc($iv['invoice_number']) ?> | = esc($iv['status']) ?> | $= number_format((float)($iv['total_amount'] ?? 0), 2) ?> | $= number_format((float)($iv['paid_amount'] ?? 0), 2) ?> | $= number_format((float)($iv['balance'] ?? 0), 2) ?> | = esc(!empty($iv['issue_date']) ? local_date($iv['issue_date'], 'm-d-Y') : '') ?> |
| Invoice | Amount | Balance | Method | Date | Status |
|---|---|---|---|---|---|
| $= number_format((float)($p['paid_amount'] ?? 0), 2) ?> | $= number_format((float)($p['balance'] ?? 0), 2) ?> | = esc($p['payment_method'] ?? '') ?> | = esc(!empty($p['payment_date']) ? local_date($p['payment_date'], 'm-d-Y') : '') ?> | = esc($p['status'] ?? '') ?> |