<?php
include("connection.php");

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $itemId = $_POST['item_id'];
    
    if (isset($_POST['Complete'])) {
        $status = 1;
    } elseif (isset($_POST['Reject'])) {
        $status = 0;
    }
    
    $updateQuery = "UPDATE panel_usdt_request SET status = $status WHERE id = $itemId";
    mysqli_query($conn, $updateQuery);
    
    // Redirect back to the view table page
    header('Location: usdt_request.php');
    exit();
}

?>
