<?php
session_start();
require "../../config/config.php";
if(!isset($_SESSION['admin_username'])){ header("location: ../login.php"); exit; }

$id     = (int)$_GET['id'];
$status = $_GET['status'] === 'paid' ? 'paid' : 'pending';

$upd = $conn->prepare("UPDATE bookings SET payment_status = :status WHERE id = :id");
$upd->execute([':status' => $status, ':id' => $id]);

header("location: index.php?success=Booking status updated to " . $status);
exit;
