-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAirlinedisplay.php
91 lines (78 loc) · 2.8 KB
/
Airlinedisplay.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
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Airlines Reservation System</title>
<link rel="stylesheet" href="./css/style_reset.css" type="text/css">
<link rel="stylesheet" href="./css/help.css" type="text/css">
<link rel="stylesheet" href="./css/openflights.css" type="text/css">
<style type="text/css"></style>
<link href="jquery-ui.min.css" rel="stylesheet" type="text/css" />
<!-- load jquery library -->
<script src="jquery-1.11.3.min.js"></script>
<!-- load jquery ui js file -->
<script src="jquery-ui.min.js"></script>
<style>
table, th, td {
border: 1px solid black;
}
</style>
</head>
<body>
<div id="mainContainer">
<div id="sideBarContentWrapper">
<div id="contentContainer">
<div id="nonmap">
<h1>Airlines Reservation System</h1>
<a href="Home.php">
Home</a> | <a href="view.php">
View Reservation</a> |<a href="Airport.php">
Airport</a> | <a href="Airline.php">
Airline</a> | <a href="Route.php">
Route</a> | <a href="Analytical.php">
Analytical Operations</a>
<a name="airport Information"></a>
<h2>Airline Information</h2>
<?php
/* $connection = mysqli_connect("localhost","username","password","employee") or die("Error " . mysqli_error($connection));
//fetch department names from the department table
$sql = "select department_name from department";
$result = mysqli_query($connection, $sql) or die("Error " . mysqli_error($connection));
*/
$name = filter_input(INPUT_POST,"airlinename");
$con = new PDO("mysql:host=localhost; dbname=projectinclude",
"root","root");
$con->setAttribute(PDO::ATTR_ERRMODE,
PDO::ERRMODE_EXCEPTION);
try
{
$sql = "SELECT * from airlines where name = '$name' ";
$result = $con->query($sql);
}
catch (PDOException $e)
{
$output = 'There is a problem: '.$e->getMessage();
echo $output;
exit();
}
$temp = array();
while($row = $result->fetch(PDO::FETCH_ASSOC))
{
$temp[] = $row;
}
echo "<br>";
echo '<table style="width:80%">';
echo '<tr><th>Airline ID</th><th> Name </th><th> IATA </th><th>ICAO</th><th>Country</th></tr>';
foreach($temp as $key => $value)
{
echo '<tr><td>'.$value['Airline ID'].'</td><td>'.$value['Name'].'</td><td>'.$value['IATA'].'</td><td>'.$value['ICAO'].'</td><td>'.$value['Country'].'</td></tr>';
};
echo '</table>';
?>
<br><button onclick="location.href='Airline.php'">Go Back</button>
</div>
</div>
</div>
</div>
</body>
</html>