This commit is contained in:
FeFeClochette committed 2026-01-07 18:41:12 +01:00
1 parent eee36e4034
commit b7533a4d05
3 files changed
+606 -73

No files matched your search

@@ -0,0 +1,20 @@
<?php
header('Content-Type: application/json');
require __DIR__ . '/../../../../includes/db.php';
try {
$stmt = $pdo->query("
SELECT person_id, leave_type, snapshot_date, remaining_balance
FROM pf_leave_snapshots
ORDER BY snapshot_date ASC
");
$snapshots = $stmt->fetchAll(PDO::FETCH_ASSOC);
echo json_encode(['snapshots' => $snapshots]);
} catch (PDOException $e) {
http_response_code(500);
echo json_encode([
'status' => 'error',
'message' => $e->getMessage(),
]);
}