<?php
require_once('../../includes/db_connect.php');

$declaration_id = $_POST['declaration_id'];
$action = $_POST['action'];

$new_status = ($action === 'approve') ? 'approved' : 'rejected';

$sql = "UPDATE Declarations SET status = ? WHERE declaration_id = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("si", $new_status, $declaration_id);
$stmt->execute();

header("Location: declaration_review_manage.php");
exit();
