<?php
// array for JSON response
  $response= array();

    // include db connect class
   require_once __DIR__ . '/../DBConnect.php';

      $sql = "SELECT * FROM Vehicle3Booking";
      $stmt = $conn->prepare($sql);
			$stmt->execute();
			$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
	if($result!=null &&  $result>0){
        $response["Vehicle3Booking"] = array();
       
	foreach($result as $row) { 
          $Vehicle3Booking["BookingID"] = $row["BookingID"];
          $Vehicle3Booking["VehicleID"] = $row["VehicleID"];
          $Vehicle3Booking["BookingDate"] = $row["BookingDate"];
		  $Vehicle3Booking["BookingDetail"] = $row["BookingDetail"];
		  $Vehicle3Booking["BookingCharges"] = $row["BookingCharges"];
		  $Vehicle3Booking["SerialNo"] = $row["SerialNo"];
		  $Vehicle3Booking["ClientID"] = $row["ClientID"];
		  $Vehicle3Booking["ClientUserID"] = $row["ClientUserID"];
		  $Vehicle3Booking["UpdatedDate"] = $row["UpdatedDate"];
		  $Vehicle3Booking["NetCode"] = $row["NetCode"];
		  $Vehicle3Booking["SysCode"] = $row["SysCode"];
		  
          // push single product into final response array
          array_push($response["Vehicle3Booking"], $Vehicle3Booking);
        }
        // success
        $response["success"] = 1;
        // echoing JSON response
        echo json_encode($response);
      }else {
        // success
        $response["success"] = 0;
        $response["message"] = "No Data Availaible";
        // echoing JSON response
    		echo json_encode($response);
      }
?>
