<?php
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Max-Age: 3600");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");

include_once '../config/database.php';
include_once '../objects/reservation.php';

$database = new Database();
$db = $database->getConnection();

$reservation = new Reservation($db);
$next_reservation_no = $reservation->generateNextBookingNo();

$arr = array(
    "reservation_no" => $next_reservation_no,
);

echo json_encode($arr);

?>
