query("SELECT name, role FROM pf_people ORDER BY id ASC"); $familyParents = []; $familyKids = []; while ($row = $stmtPeople->fetch(PDO::FETCH_ASSOC)) { $role = strtolower(trim($row['role'] ?? '')); if ($role === 'parent') { $familyParents[] = $row['name']; } elseif ($role === 'nounou' || $role === 'helper') { // On ignore la nounou dans l'épargne continue; } else { $familyKids[] = $row['name']; } } // Sécurité anti-page blanche si la BDD est mal configurée if (empty($familyParents)) $familyParents = ['Parent 1', 'Parent 2']; $requestedOwner = $_GET['owner'] ?? (!empty($familyKids) ? 'KIDS' : ($familyParents[0] ?? 'KIDS')); $ownersToDisplay = ($requestedOwner === 'KIDS') ? $familyKids : [$requestedOwner]; // --- RÉCUPÉRATION CONFIGURATION DES MOIS --- $cycleConfigs = []; $stmtNotes = $pdo->query("SELECT reference_id, content FROM pf_notes WHERE note_type = 'month_config'"); while ($row = $stmtNotes->fetch(PDO::FETCH_ASSOC)) { $parts = explode('-', $row['reference_id']); if (count($parts) == 2) { $mKey = $parts[1] . '-' . $parts[0] . '-01'; $cycleConfigs[$mKey] = json_decode($row['content'], true); } } function getMonthName($dateString) { $m = date('m', strtotime($dateString)); $y = date('Y', strtotime($dateString)); return tr('month_' . $m) . ' ' . $y; } ?>
= sprintf(tr('bud_sav_no_data'), htmlspecialchars($currentOwner)) ?>
| = tr('bud_sav_post_month') ?> |
= getMonthName($month) ?>
" . sprintf(tr('bud_sav_from_date'), $cStart) . "";
}
?>
|
|---|---|
| = tr('bud_sav_total_bank') ?> |
€
|
| = htmlspecialchars($cat) ?> |
|
| = tr('bud_sav_extra') ?> | = number_format($extra, 0, ',', ' ') ?> € |