query($sql)->fetchAll(PDO::FETCH_ASSOC);
// Tri par statut
$active = array_filter($holidays, fn($h) => in_array($h['status'], ['draft', 'planned', 'booked']));
$history = array_filter($holidays, fn($h) => in_array($h['status'], ['passed', 'archived']));
?>
Mes Vacances ✈️
Aucun voyage en cours. Planifions quelque chose !
prepare("SELECT * FROM pf_holidays_items WHERE holiday_id = ?");
$stmt->execute([$h['id']]);
$items = $stmt->fetchAll(PDO::FETCH_ASSOC);
// JSON pour le JS
$json = htmlspecialchars(json_encode(['main' => $h, 'items' => $items]), ENT_QUOTES, 'UTF-8');
// Affichage des dates
$dateDisplay = htmlspecialchars($h['period_hint'] ?? '');
// MODIFICATION ICI : Format d/m/Y (jj/mm/aaaa)
if (empty($dateDisplay) && $h['start_date']) {
$dateDisplay = date('d/m/Y', strtotime($h['start_date']));
if ($h['end_date']) $dateDisplay .= ' → ' . date('d/m/Y', strtotime($h['end_date']));
}
$statusClass = match($h['status']) {
'booked' => 'bg-green-100 text-green-800',
'planned' => 'bg-blue-100 text-blue-800',
'passed' => 'bg-gray-100 text-gray-600',
default => 'bg-yellow-50 text-yellow-800'
};
echo "
".htmlspecialchars($h['title'])."
".strtoupper($h['status'])."
🗓️ ".($dateDisplay ?: 'Dates à définir')."
Budget Total
".number_format($h['total_cost'], 0, ',', ' ')." €
";
}
?>