<?php
require '../functions.php';
// Mendapatkan tanggal yang dikirim dari AJAX
$sql = "SELECT booking_date FROM tb_villa_booking_date";

$result = mysqli_query($conn, $sql);

if (mysqli_num_rows($result) > 0) {
    $blocked_dates = array();
    while ($row = mysqli_fetch_assoc($result)) {
        $blocked_dates[] = $row['booking_date'];
    }
    echo json_encode($blocked_dates);
} else {
    echo json_encode(array());
}

mysqli_close($conn);

?>
