<?php
session_start();
if (!isset($_SESSION['username'])) { header("location:login"); exit; }
include 'master.php';

$id     = (int)($_GET['id'] ?? 0);
$status = $_GET['status'] ?? '';

if ($id > 0 && in_array($status, ['Approved', 'Rejected', 'Pending'])) {
    $stmt = $conn->prepare("UPDATE tax_refunds SET status = ? WHERE id = ?");
    $stmt->bind_param('si', $status, $id);
    $stmt->execute();
    $stmt->close();
}

header("location:tax-refunds");
exit;
