HEX
Server: LiteSpeed
System: Linux server214.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User: bigisxfd (746)
PHP: 8.4.15
Disabled: NONE
Upload Files
File: /home/bigisxfd/public_html/cowork/checkout_booking.php
<?php
// Include necessary files
include_once("functions.php");

if ($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST["bookingId"])) {
    $bookingId = $_POST["bookingId"];

    // Update the booking status to inactive
    $updateQuery = "UPDATE Bookings SET active = 0 WHERE bookingid = ?";
    $updateStmt = $conn->prepare($updateQuery);
    $updateStmt->bind_param("i", $bookingId);

    if ($updateStmt->execute()) {
        // Booking checkout successful
        echo "Booking checked out successfully.";
    } else {
        // Error occurred while updating the booking
        echo "Error checking out booking.";
    }
    $updateStmt->close();
} else {
    // Invalid request
    echo "Invalid request.";
}

// Close the database connection
$conn->close();
?>
<script>
    // Redirect back to bookings.php after a delay
    setTimeout(function() {
        window.location.href = "bookings.php";
    }, 1000); // Redirect after 2 seconds (adjust as needed)
</script>