<?php
include("cn.php");
$sql = "Select booking.* FROM booking";
   
$result = mysqli_query($connect, $sql);

    
    $eventArray = array();
    while ($row = mysqli_fetch_assoc($result)) {
        $date = $row['rent_start_date'];
        $row['rent_start_date'] = date('Y-m-d', strtotime("$date"));
        $edate = $row['rent_end_date'];
        $row['rent_start_date'] = date('Y-m-d', strtotime("$date"));
        $row['title'] = $row["BookingNumber"];
        // unset($row['endtime']);
        // unset($row['starttime']);
        // unset($row['enddate']);
        // unset($row['startdate']);
        array_push($eventArray, $row);
    }
    echo json_encode($eventArray);


?>