<?php
require_once __DIR__ . "/../config/db.php";

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $id = $_POST['id'] ?? 0;
    $status = $_POST['status'] ?? 'معلق';

    $stmt = db()->prepare("UPDATE orders SET status=? WHERE id=?");
    $stmt->execute([$status, $id]);
}

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