@@ -141,7 +141,7 @@ try {
|
||||
// ─── 5. GESTION DES CONGÉS INDIVIDUELS (MEMBRES) ───
|
||||
if ($action === 'get_person_leaves') {
|
||||
$personId = (int)($_GET['person_id'] ?? 0);
|
||||
$stmt = $pdo->prepare("SELECT id, leave_type, allowance, anniversary_date FROM pf_person_leave_meta WHERE person_id = ? ORDER BY leave_type ASC");
|
||||
$stmt = $pdo->prepare("SELECT id, leave_type, allowance, method, anniversary_date FROM pf_person_leave_meta WHERE person_id = ? ORDER BY leave_type ASC");
|
||||
$stmt->execute([$personId]);
|
||||
echo json_encode(['success' => true, 'data' => $stmt->fetchAll(PDO::FETCH_ASSOC)]);
|
||||
exit;
|
||||
|
||||
@@ -3,13 +3,22 @@ header('Content-Type: application/json');
|
||||
require __DIR__ . '/../../../../includes/db.php';
|
||||
|
||||
try {
|
||||
// 🔥 LE FIX : On interroge la NOUVELLE table des quotas individuels !
|
||||
$stmt = $pdo->query("
|
||||
SELECT person_id, leave_type, initial_balance, balance_year
|
||||
FROM pf_leave_balances
|
||||
SELECT
|
||||
person_id,
|
||||
leave_type AS type,
|
||||
allowance,
|
||||
method,
|
||||
anniversary_date AS date
|
||||
FROM pf_person_leave_meta
|
||||
");
|
||||
$balances = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
echo json_encode(['balances' => $balances]);
|
||||
echo json_encode([
|
||||
'status' => 'success',
|
||||
'balances' => $balances
|
||||
]);
|
||||
} catch (PDOException $e) {
|
||||
http_response_code(500);
|
||||
echo json_encode([
|
||||
@@ -17,3 +26,4 @@ try {
|
||||
'message' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user