-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathGDC-Ticket.php
84 lines (79 loc) · 2.13 KB
/
GDC-Ticket.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
<!DOCTYPE html>
<html>
<head>
<title>GDC Airways - Ticket</title>
<link rel="stylesheet" type="text/css" href="GDC-TicketCSS.css">
</head>
<body>
<div class="container">
<h1 id="headst">Ticket</h1>
<table id="tabtk" width="600" border="1" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th>Ticket Number</th>
<th>Passenger ID</th>
<th>Passenger Name</th>
<th>Gender</th>
<th>Flight ID</th>
<th>Class</th>
<th>Terminal</th>
</tr>
</thead>
<tbody>
<?php
$dbhost="localhost";
$dbuser="devang";
$dbpass="qwerty";
$db="gdcairways";
$conn=mysqli_connect($dbhost,$dbuser,$dbpass,$db);
if(!$conn)
{
echo "Connection was failed".mysqli_connect_error();
}
$ticketno=$_POST['ticketno'];
$ticketno=mysqli_real_escape_string($conn,$ticketno);
if($_POST['submit'])
{
$sql="Select * from ticket where TickNo='".$ticketno."'";
if(mysqli_query($conn,$sql))
{
$print=mysqli_query($conn,$sql);
while($row = mysqli_fetch_assoc($print))
{
echo "<tr>";
echo "<td>".$row['TickNo']."</td>";
echo "<td>".$row['PassengerID']."</td>";
$pass=$row['PassengerID'];
$pass=mysqli_real_escape_string($conn,$pass);
$sqlpass="Select Name, Gender from passenger where PassengerID='".$pass."'";
if(mysqli_query($conn,$sqlpass))
{
$p=mysqli_query($conn,$sqlpass);
while($r=mysqli_fetch_assoc($p))
{
echo "<td>".$r['Name']."</td>";
echo "<td>".$r['Gender']."</td>";
}
}
else
{
echo "Something went wrong";
}
echo "<td>".$row['FlightID']."</td>";
echo "<td>".$row['Type']."</td>";
echo "<td>".$row['Terminal']."</td>";
/*echo "<td><a href='GDC-Book.php?varname=<?php echo $var_value ?>'>Book</a></td>";*/
echo "</tr>";
}
}
else
{
echo "Something Went Wrong";
}
}
?>
</tbody>
</table>
</div>
</body>
</html>