-
Notifications
You must be signed in to change notification settings - Fork 1
/
viewflights.php
60 lines (56 loc) · 2.24 KB
/
viewflights.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
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="admin.css">
<link rel="stylesheet" href="style.css">
<script>
function darkRedTextColor(obj) {
obj.style.color = "darkred";
}
function blackTextColor(obj) {
obj.style.color = "black";
}
</script>
</head>
<body>
<nav>
<img src="C.png" class="logo" alt="logo">
<ul>
<li><a href="#" onmouseover="darkRedTextColor(this)" onmouseout="blackTextColor(this)">home</a></li>
<li><a href="admin.php" onmouseover="darkRedTextColor(this)" onmouseout="blackTextColor(this)">Flight Update</a></li>
<li><a href="logout.php" onmouseover="darkRedTextColor(this)" onmouseout="blackTextColor(this)">LogOut</a></li>
</ul>
</nav>
<div class="display">
<?php
$conn = mysqli_connect("localhost", "root", "sankeeth72", "test");
if (!$conn) {
die("connection failed" . mysqli_connect_error());
}
$query = "select * from test.flights";
$result = mysqli_query($conn, $query);
if ($result->num_rows) {
echo "<table ><tr><th>FLIGHT NO</th><th>FROM</th>"
. "<th>TO</th><th>DEPART TIME</th>"
. "<th>ARRIVAL TIME</th><th>DEPART DATE</th>"
. "<th>RETURN DATE</th><th>SEATS</th>"
. "<th>FARE</th>";
while ($row = $result->fetch_assoc()) {
echo "<tr><td>" . $row["flightno"] . "</td><td>" . $row["fromcity"] . "</td>"
. "<td>" . $row["tocity"] . "</td><td>" . $row["departtime"] . "</td>"
. "<td>" . $row["arrivaltime"] . "</td><td>" . $row["departdate"] . "</td>"
. "<td>" . $row["returndate"] . "</td><td>" . $row["seats"] . "</td>"
. "<td>" . $row["fare"] . "</td></tr>";
}
echo "</table>";
}
?>
</div>