-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcancelreservation.php
110 lines (100 loc) · 5.51 KB
/
cancelreservation.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
<?php
include('session.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Regal Airways</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/sb-admin.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrapper">
<!-- Navigation -->
<?php
include('navbar.php');
?>
<div id="page-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">
Cancel Reservation
</h1>
</div>
</div>
<div class="row">
<div class="col-lg-10">
<div class="panel panel-red">
<div class="panel-heading">
<div class="row">
<div class="col-xs-10">
<span>Please select a reservation below to cancel.</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class ="row">
<div class="col-lg-10 col-xs-12">
<form action = "cancelreservationpush.php" name="cancel" id="cancel" method = "post" onsubmit="return confirm('Are you sure you want to cancel this reservation?');">
<div class="table-responsive">
<table class="table table-hover table-striped">
<thead>
<tr>
<th>Flight ID</th>
<th>Origin</th>
<th>Destination</th>
<th>Depart Date</th>
<th>Depart Time</th>
<th>Arrival Date</th>
<th>Arrival Time</th>
<th>Price ($USD)</th>
<th>Cancel?</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT RID, R.FID, B1.NAME AS B1, B2.NAME AS B2, DEPARTDATE, DEPARTTIME, ARRIVALDATE, ARRIVALTIME, PRICE FROM RESERVE R LEFT JOIN FLIGHT F ON R.FID = F.FID LEFT JOIN BRANCH B1 ON ORIGIN_BID = B1.BID LEFT JOIN BRANCH B2 ON DEST_BID = B2.BID WHERE R.USER_ID = '{$_SESSION['cur_user_id']}' ORDER BY DEPARTDATE, DEPARTTIME";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query)){
echo "<tr class = 'danger'>";
echo "<td>" . $row['FID'] . "</td>";
echo "<td>" . $row['B1'] . "</td>";
echo "<td>" . $row['B2'] . "</td>";
echo "<td>" . $row['DEPARTDATE'] . "</td>";
echo "<td>" . $row['DEPARTTIME'] . "</td>";
echo "<td>" . $row['ARRIVALDATE'] . "</td>";
echo "<td>" . $row['ARRIVALTIME'] . "</td>";
echo "<td>" . $row['PRICE'] . "</td>";
echo "<td>" . "<button type=\"submit\" name=\"btn-cancel\" class=\"btn btn-default\" value=\"{$row['RID']}\"><i class=\"fa fa-fw fa-times\"></i></button>" . "</td>";
echo "</tr>";
}
?>
</tbody>
</table>
</div>
</form>
</div>
</div>
<br>
</div>
</div>
</div>
<!-- /#wrapper -->
<!-- jQuery -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>