<?php
include("cn.php");
$user = $_SESSION["userid"];
$sql = "Select booking.* FROM booking where User='$user'";
   
$result = mysqli_query($connect, $sql);

    
    $eventArray = array();
    while ($row = mysqli_fetch_assoc($result)) {
        $date = $row['JourneyDate'];
        $row['start'] = date('Y-m-d', strtotime("$date"));
        $edate = $row['JourneyDate'];
        $row['end'] = 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);


?>