<?php
require_once '../../models/Database.php';
use Models\Database;

header('Content-Type: application/json');
$pdo = Database::getInstance()->getConnection();

$id = intval($_GET['employee_id'] ?? 0);
$stmt = $pdo->prepare("SELECT taux_impot FROM employees WHERE id = ?");
$stmt->execute([$id]);

echo json_encode(['taux_impot' => floatval($stmt->fetchColumn())]);
