<?php
require '../includes/config.php';

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $officer_id = $_POST['officer_id'];
    $action = $_POST['action'];

    $status = $action === 'approve' ? 'approved' : 'rejected';
    $stmt = $pdo->prepare("UPDATE officers SET biometric_status = ? WHERE id = ?");
    $stmt->execute([$status, $officer_id]);

    header("Location: biometric_requests.php");
    exit();
}
