This commit is contained in:
2025-12-24 14:48:49 +01:00
parent c6793e2473
commit 9beb6e1b43
20 changed files with 1777 additions and 508 deletions
@@ -0,0 +1,20 @@
<?php
header('Content-Type: application/json');
require __DIR__ . '/../includes/db.php';
try {
$stmt = $pdo->query("SELECT id, event_date AS date, event_type AS type, person_id, duration FROM pf_events ORDER BY event_date");
$events = $stmt->fetchAll(PDO::FETCH_ASSOC);
echo json_encode([
'status' => 'success',
'events' => $events,
]);
} catch (Exception $e) {
http_response_code(500);
echo json_encode([
'status' => 'error',
'message' => 'Erreur lors de la récupération des événements : ' . $e->getMessage(),
]);
}