<?php
require '../includes/db_config.php';
header('Content-Type: application/json');

$data = json_decode(file_get_contents("php://input"), true);

$officer_id = $data['officer_id'];
$status = $data['status']; // 'approved' or 'rejected'

$stmt = $pdo->prepare("UPDATE officers SET biometric_status = ? WHERE id = ?");
if ($stmt->execute([$status, $officer_id])) {
    echo json_encode(["status" => "success"]);
} else {
    echo json_encode(["status" => "error", "message" => "Failed to update"]);
}
