".tr('error')."

"; exit; } $stmt = $pdo->prepare(" SELECT h.*, (COALESCE(h.budget_food, 0) + COALESCE(h.budget_extra, 0) + COALESCE((SELECT SUM(amount) FROM pf_holidays_items WHERE holiday_id = h.id), 0)) as total_cost, ( (SELECT COALESCE(SUM(ABS(amount)), 0) FROM pf_expenses WHERE holiday_id = h.id) + (SELECT COALESCE(SUM(amount), 0) FROM pf_holidays_items WHERE holiday_id = h.id AND is_paid = 1) ) as total_paid, (SELECT COALESCE(SUM(amount), 0) FROM pf_savings WHERE holiday_id = h.id) as total_saved FROM pf_holidays h WHERE h.id = ? "); $stmt->execute([$id]); $holiday = $stmt->fetch(PDO::FETCH_ASSOC); $stmtItems = $pdo->prepare("SELECT * FROM pf_holidays_items WHERE holiday_id = ? ORDER BY sort_order ASC, id ASC"); $stmtItems->execute([$id]); $items = $stmtItems->fetchAll(PDO::FETCH_ASSOC); $stmtFav = $pdo->query("SELECT content FROM pf_notes WHERE note_type = 'holiday_favorites'"); $favorites = json_decode($stmtFav->fetchColumn() ?: '[]', true); $steps = []; $generalItems = []; // C'est ici qu'il manquait sΓ»rement une accolade ! foreach ($items as $it) { if ($it['location_name'] !== null) { $orderKey = $it['sort_order']; if (!isset($steps[$orderKey])) { $steps[$orderKey] = [ 'location_name' => $it['location_name'], 'lat' => (float)$it['lat'], 'lng' => (float)$it['lng'], 'sort_order' => $it['sort_order'], 'step_start_date' => $it['step_start_date'], 'step_end_date' => $it['step_end_date'], 'is_return' => (int)$it['is_return'], 'total_amount' => 0, 'items' => [] ]; } $steps[$orderKey]['items'][] = $it; $steps[$orderKey]['total_amount'] += (float)$it['amount']; } else { $generalItems[] = $it; } } ksort($steps); $mapPoints = array_values($steps); $dateDisplay = htmlspecialchars($holiday['period_hint'] ?? ''); if (empty($dateDisplay) && $holiday['start_date']) { $dateDisplay = date('d/m/Y', strtotime($holiday['start_date'])); if ($holiday['end_date']) $dateDisplay .= ' β†’ ' . date('d/m/Y', strtotime($holiday['end_date'])); } $cost = (float)$holiday['total_cost']; $paid = (float)$holiday['total_paid']; $saved = (float)$holiday['total_saved']; $leftToPay = max(0, $cost - $paid); $pctPaid = $cost > 0 ? min(100, ($paid / $cost) * 100) : 0; $pctSaved = $cost > 0 ? min(100 - $pctPaid, ($saved / $cost) * 100) : 0; ?>

πŸ” € | 🎁 €
€
βœ“ : € πŸ’Ό : € ⏳ : €

☰
πŸ“ 🏁
€
'πŸš—', 'accommodation' => '🏨', 'activity' => '🎫', default => '🏷️' }; ?>
€
πŸ“

πŸ“

πŸ“