$ba; if ($cmp !== 0) { return $cmp; } return strcmp((string) ($a['name'] ?? ''), (string) ($b['name'] ?? '')); }); $nameById = []; foreach ($people as $p) { if (!empty($p['id'])) { $nameById[(string) $p['id']] = (string) ($p['name'] ?? ''); } } $expenses = normalizeExpensesList(readJsonFile('expenses.json')); usort($expenses, static function ($a, $b) { $da = (string) ($a['date'] ?? ''); $db = (string) ($b['date'] ?? ''); if ($db !== $da) { return strcmp($db, $da); } return strcmp((string) ($b['created_at'] ?? ''), (string) ($a['created_at'] ?? '')); }); $recentExpenses = array_slice($expenses, 0, 50); $today = gmdate('Y-m-d'); ?>
Leaderboard and expenses use the family currency from Family settings.
Add people in Family settings to see balances.
| # | Name | Balance |
|---|---|---|
| = (int) $rank + 1 ?> | = sanitizeInput($p['name'] ?? '') ?> You | = htmlspecialchars(number_format($bal, 2, '.', ''), ENT_QUOTES, 'UTF-8') ?> = htmlspecialchars($sym, ENT_QUOTES, 'UTF-8') ?> |
Deducts from one person’s balance (e.g. spent allowance). Requires enough balance.
Switch to a verified Head of household to record expenses.
No expenses recorded yet.
| Date | Title | To | Amount |
|---|---|---|---|
| = sanitizeInput((string) ($ex['date'] ?? '')) ?> | = sanitizeInput((string) ($ex['title'] ?? '')) ?> | = sanitizeInput($nameById[(string) ($ex['assignee_id'] ?? '')] ?? '') ?> | −= htmlspecialchars(number_format((float) ($ex['value'] ?? 0), 2, '.', ''), ENT_QUOTES, 'UTF-8') ?> = htmlspecialchars($sym, ENT_QUOTES, 'UTF-8') ?> |