-
Notifications
You must be signed in to change notification settings - Fork 0
/
showhistory.php
204 lines (139 loc) · 5.5 KB
/
showhistory.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<?php
// Start the session
session_start();
$user = $_SESSION['user'];
?>
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<title>History</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/x-icon" href="https://lh3.googleusercontent.com/-HtZivmahJYI/VUZKoVuFx3I/AAAAAAAAAcM/thmMtUUPjbA/Blue_square_A-3.PNG" />
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="forcompany.css">
<link rel="stylesheet" href="homepage.css">
<link rel="stylesheet" href="AdminSignin.css">
<script src="login.js"> </script>
<script src="jump.js"> </script>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="homepage.html"><span class="glyphicon glyphicon-home"></span> Home</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right">
<li id = "cart">
<a class="navbar-brand" href="cartshow.php"><span class="glyphicon glyphicon-shopping-cart"></span> Shopping Cart</a>
</li>
<li class="dropdown" id = "new">
<a class="dropdown-toggle" data-toggle="dropdown" href="#"><span class="glyphicon glyphicon-user"> Sign in </span><span class="caret"></span>
</a>
<ul class="dropdown-menu multi-level" role="menu" aria-labelledby="dropdownMenu">
<li><a href="signup.html">Register</a></li>
<li class="dropdown-submenu">
<a tabindex="-1" href="#">Sign in</a>
<ul class="dropdown-menu">
<li><a tabindex="-1" href="Adminpage.html">Manager Sign in</a></li>
<li><a href="customersignin.html">Customer Sign in</a></li>
</li>
</ul>
</li>
</ul>
</li>
<li class="dropdown" id = "old">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" ><span class="glyphicon glyphicon-user" id="wuser">Welcom!</span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu multi-level" role="menu" aria-labelledby="dropdownMenu">
<li><a href="showhistory.php">History</a></li>
<li><a href="#" id="logout">Sign out</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<div class="jumbotron text-center">
<h1>Airprice.com</h1>
<p>We specialize in your air plan!</p>
</div>
<div class="container-fluid text-center">
<div class="row content">
<div class="col-sm-2 sidenav">
</div>
<div class="col-sm-8 text-left">
<h1>Show History</h1>
<?php
include_once 'dbconnect2.php';
$sql = "SELECT FL.number AS FLnumber, company, type, time, B.date, departure, d_time, arrival, a_time, C.name AS classname, price, paid
FROM flight FL, class C, airplane AP , book B
WHERE (FL.number = C.number) AND (B.flightno = c.number) AND (classtype = C.name) AND (FL.airplane_id = AP.ID)
AND B.username = '$user' AND paid = '1'
ORDER BY time";
$result = mysqli_query($con,$sql);
$rowcount = mysqli_num_rows($result);
if($rowcount == 0){
echo "<div class='alert alert-info'><strong>Nothing in the history.</strong></div>";
}
else{
echo "<div class='alert alert-info'>History:</div>";
echo "<table class='table table-bordered table-striped table-hover'>
<thead>
<tr>
<th>Time</th>
<th>Flight</th>
<th>Aircraft</th>
<th>Date</th>
<th>Departure</th>
<th>Departure Time</th>
<th>Arrival</th>
<th>Arrival Time</th>
<th>Class</th>
<th>Price</th>
<th>Pay</th>
</tr>
</thead>";
while($row = mysqli_fetch_array($result)) {
echo "<tbody><tr>";
echo "<td>" . $row['time'] . "</td>";
echo "<td>" . $row['FLnumber'] . "</td>";
echo "<td>" . $row['company']." ".$row['type']. "</td>";
echo "<td>" . $row['date'] . "</td>";
echo "<td>" . $row['departure'] . "</td>";
echo "<td>" . $row['d_time'] . "</td>";
echo "<td>" . $row['arrival'] . "</td>";
echo "<td>" . $row['a_time'] . "</td>";
echo "<td>" . $row['classname'] . "</td>";
echo "<td>" . $row['price'] . "</td>";
if($row['paid'] == 1){
echo "<td>YES</td>";
}
echo "</tr>";
}
echo " </tbody></table>";
}
mysqli_close($con);
?>
</div>
</div>
</div>
<footer class="container-fluid text-center">
<a href="#signUpPage" title="To Top">
<span class="glyphicon glyphicon-chevron-up"></span>
</a>
<p>Airprice.com</p>
</footer>
</body>
</html>