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

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $reservation_id = $_POST['reservation_id'];
    $new_status = $_POST['status'];

    $stmt = $conn->prepare("UPDATE Reservations SET status = ? WHERE reservation_id = ?");
    $stmt->bind_param("si", $new_status, $reservation_id);

    if ($stmt->execute()) {
        header("Location: reservation_manage.php");
        exit();
    } else {
        echo "상태 변경 실패: " . $stmt->error;
    }

    $stmt->close();
}
?>
