-
Notifications
You must be signed in to change notification settings - Fork 1
/
admin_view_booked_tickets_form_handler.php
124 lines (123 loc) · 3.1 KB
/
admin_view_booked_tickets_form_handler.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
session_start();
?>
<html>
<head>
<title>
View Booked Tickets
</title>
<style>
input {
border: 1.5px solid #030337;
border-radius: 4px;
padding: 7px 30px;
}
input[type=submit] {
background-color: #030337;
color: white;
border-radius: 4px;
padding: 7px 45px;
margin: 0px 390px
}
table {
border-collapse: collapse;
}
tr/*:nth-child(3)*/ {
border: solid thin;
}
</style>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<link rel="stylesheet" href="font-awesome-4.7.0\css\font-awesome.min.css">
</head>
<body>
<img class="logo" src="images/shutterstock_22.jpg"/>
<h1 id="title">
AADITH AIRLINES
</h1>
<div>
<ul>
<li><a href="admin_homepage.php"><i class="fa fa-home" aria-hidden="true"></i> Home</a></li>
<li><a href="admin_homepage.php"><i class="fa fa-desktop" aria-hidden="true"></i> Dashboard</a></li>
<li><a href="logout_handler.php"><i class="fa fa-sign-out" aria-hidden="true"></i> Logout</a></li>
</ul>
</div>
<h2>LIST OF BOOKED TICKETS FOR THE FLIGHT</h2>
<?php
if(isset($_POST['Submit']))
{
$data_missing=array();
if(empty($_POST['flight_no']))
{
$data_missing[]='Flight No.';
}
else
{
$flight_no=trim($_POST['flight_no']);
}
if(empty($_POST['departure_date']))
{
$data_missing[]='Departure Date';
}
else
{
$departure_date=$_POST['departure_date'];
}
if(empty($data_missing))
{
require_once('Database Connection file/mysqli_connect.php');
$query="SELECT pnr,date_of_reservation,class,no_of_passengers,payment_id,customer_id FROM Ticket_Details where flight_no=? and journey_date=? and booking_status='CONFIRMED' ORDER BY class";
$stmt=mysqli_prepare($dbc,$query);
mysqli_stmt_bind_param($stmt,"ss",$flight_no,$departure_date);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt,$pnr,$date_of_reservation,$class,$no_of_passengers,$payment_id,$customer_id);
mysqli_stmt_store_result($stmt);
if(mysqli_stmt_num_rows($stmt)==0)
{
echo "<h3>No booked tickets information is available!</h3>";
}
else
{
echo "<table cellpadding=\"10\"";
echo "<tr><th>PNR</th>
<th>Date of Reservation</th>
<th>Class</th>
<th>No. of Passengers</th>
<th>Payment ID</th>
<th>Customer ID</th>
</tr>";
while(mysqli_stmt_fetch($stmt)) {
echo "<tr>
<td>".$pnr."</td>
<td>".$date_of_reservation."</td>
<td>".$class."</td>
<td>".$no_of_passengers."</td>
<td>".$payment_id."</td>
<td>".$customer_id."</td>
</tr>";
}
echo "</table> <br>";
}
mysqli_stmt_close($stmt);
mysqli_close($dbc);
// else
// {
// echo "Submit Error";
// echo mysqli_error();
// }
}
else
{
echo "The following data fields were empty! <br>";
foreach($data_missing as $missing)
{
echo $missing ."<br>";
}
}
}
else
{
echo "Submit request not received";
}
?>
</body>
</html>