prepare("SELECT * FROM pf_salary_config WHERE year = ?"); $stmt->execute([$currentYear]); while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $salaryConfig[$row['person']] = $row; } // Init si vide foreach (['Alex', 'Laia'] as $p) { if (!isset($salaryConfig[$p])) { $salaryConfig[$p] = ['salary'=>0, 'mensualite'=>0, 'frais_func'=>0, 'eco_perso'=>0, 'eco_family'=>0]; } } // 2. Récupération Catégories $cats = $pdo->query("SELECT * FROM pf_alloc_categories ORDER BY sort_order ASC, id ASC")->fetchAll(PDO::FETCH_ASSOC); // 3. Gestion du mois FOCUS et Navigation $focusDate = isset($_GET['focus_date']) ? $_GET['focus_date'] : date('Y-m-01'); $focusTs = strtotime($focusDate); // On affiche 6 mois (Timeline inversée) $months = []; for ($i = 0; $i < 6; $i++) { $months[] = date('Y-m-01', strtotime("-$i months", $focusTs)); } // Liens navigation $prevMonthLink = date('Y-m-01', strtotime("-1 month", $focusTs)); $nextMonthLink = date('Y-m-01', strtotime("+1 month", $focusTs)); // 4. Récupération Valeurs Répartition $inQuery = implode(',', array_fill(0, count($months), '?')); $stmt = $pdo->prepare("SELECT * FROM pf_alloc_values WHERE month_date IN ($inQuery)"); $stmt->execute($months); $allocs = []; while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $allocs[$row['month_date']][$row['cat_id']] = $row; } ?>

Revenus

Personne Salaire Mensualité
(Cpt Commun)
Frais Func. Eco Perso Eco Family
(Dispo)
Restant Perso

Répartition Budgétaire

0, 'amount_laia'=>0]; ?>
Global Alex Laia
Total 0 0 0
Restant (Eco Family) - 0 0
Info
×
0
Virements à effectuer -
Destination Alex Laia Global
0 € 0 € 0 €
GRAND TOTAL 0 € 0 € 0 €

Modifier la ligne