45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
|
|
<?php
|
|
include "../../ConnectDB.php";
|
|
$id = $_REQUEST["id"];
|
|
|
|
$sql = "SELECT
|
|
transport_flight.flight_id,
|
|
transport_flight.flight_code,
|
|
departure_city.name AS from_name,
|
|
arrival_city.name AS dest_name,
|
|
departure_airport.name AS departure_airport_name,
|
|
arrival_airport.name AS arrival_airport_name,
|
|
flight_class_id,
|
|
week_routine,
|
|
takeoff_time,
|
|
class,
|
|
fee,
|
|
landing_time
|
|
FROM
|
|
transport_flight
|
|
JOIN
|
|
transport_airport AS departure_airport ON transport_flight.from_airport_id = departure_airport.airport_id
|
|
JOIN
|
|
transport_airport AS arrival_airport ON transport_flight.dest_airport_id = arrival_airport.airport_id
|
|
JOIN
|
|
transport_airline ON transport_flight.airline_id = transport_airline.airline_id
|
|
JOIN
|
|
cities AS departure_city ON departure_airport.city_id = departure_city.id
|
|
JOIN transport_flight_class USING (flight_id)
|
|
JOIN cities AS arrival_city ON arrival_airport.city_id = arrival_city.id
|
|
WHERE flight_id=".$id;
|
|
|
|
$result = $conn->query($sql);
|
|
$attractionDetail = array();
|
|
if ($result->num_rows > 0) {
|
|
while($row = $result->fetch_assoc()) {
|
|
$attractionDetail [] = $row;
|
|
}
|
|
} else {
|
|
$attractionDetail [] = "No result";
|
|
}
|
|
echo json_encode($attractionDetail);
|
|
?>
|
|
|