<?php
include "config.php";

if (isset($_POST['id']) && isset($_POST['status'])) {
    $id = intval($_POST['id']);
    $status = mysqli_real_escape_string($con, $_POST['status']);

    $query = "UPDATE comply_order SET status='$status' WHERE id=$id";
    if (mysqli_query($con, $query)) {
        // Redirect back to KYC page
        header("Location: comply_order.php?msg=Status Updated");
        exit();
    } else {
        echo "Error: " . mysqli_error($con);
    }
}
?>