-
Notifications
You must be signed in to change notification settings - Fork 2
/
bookings.php
57 lines (54 loc) · 3.18 KB
/
bookings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
include $_SERVER["DOCUMENT_ROOT"].'AirX/core/init.php';
include $_SERVER["DOCUMENT_ROOT"].'AirX/includes/overall/header.php';
if(isset($_GET['success']) === true && empty($_GET['success']) === true) {
echo "<script>alert('Booking Successfull');</script>";
}
?>
<legend>My Bookings</legend>
<?php
$uid=$u_data['u_id']; //Assigns logged in id to a variable
$query="SELECT * FROM `passenger_details` WHERE `u_id` = '$uid'";
$result=mysql_query($query);
if($result) {
while($row=mysql_fetch_assoc($result))
{
if($uid===$row['u_id']) //Checks if the logged in id matches with id in DB
{
$pnr = $row['p_pnr'];
$fno = $row['p_fno'];
$r2=mysql_fetch_assoc(mysql_query("SELECT * FROM `flight_search` WHERE `fno`='$fno'"));
echo '<form action="cancel.php" method="POST">';
echo 'Flight No: '.$r2['fno'].' ';
echo 'From: '.$r2['from_city'].' ';
echo 'To: '.$r2['to_city'].' ';
echo 'Class: '.$row['p_class'].' ';
echo 'PNR Number: '.$row['p_pnr'].' '.'<br/>';
echo 'Departure Date: '.$r2['departure_date'].' ';
echo 'Departure Time: '.$r2['departure_time'].' ';
echo 'Arrival Date: '.$r2['arrival_date'].' ';
echo 'Arrival Time: '.$r2['arrival_time'].' '.'<br/>';
echo 'Passenger Name: '.$row['p_name'].' '.'<br>';
echo 'Passenger Age: '.$row['p_age'].' '.'<br>';
echo 'Passenger Sex: '.$row['p_sex'].' '.'<br>';
echo 'Passenger Aadhar: '.$row['p_aadhar'].' '.'<br>';
echo 'Boarding Pass Type: '.$row['p_passtype'].' '.'<br><br>';
echo "<input type='hidden' value='".$row['p_name']."' id='p_name' name='p_name' />";
echo "<input type='hidden' value='".$row['p_age']."' id='p_age' name='p_age' />";
echo "<input type='hidden' value='".$row['p_sex']."' id='p_sex' name='p_sex' />";
echo "<input type='hidden' value='".$row['p_aadhar']."' id='p_aadhar' name='p_aadhar' />";
echo "<input type='hidden' value='".$pnr."' id='p_pnr' name='p_pnr' />";
echo "<input type='hidden' value='".$fno."' id='p_fno' name='p_fno' />";
if($row['p_status']==='booked') {
echo '<button type="submit" value="cancel" name="cancel" class="btn btn-primary">Cancel Bookings</button>';
echo '<br/><hr>';
echo '</form>';
} else {
echo '<br/><hr>';
echo '</form>';
}
}
}
}
?>
<?php include $_SERVER["DOCUMENT_ROOT"].'AirX/includes/overall/footer.php'; ?>