-
Notifications
You must be signed in to change notification settings - Fork 0
/
results.php
119 lines (97 loc) · 6.21 KB
/
results.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
<?php
require_once 'header.php';
?>
<div class="container">
<!-- <div class="card shadow mb-4">
<div class="card-header">
Search Results...
</div>
<div class="card-body"> -->
<div class="table-responsive">
<table class="table table-striped table-bordered" >
<thead>
<tr>
<th>Sr No</th>
<th>Flight</th>
<th>From</th>
<th>To</th>
<th>Departure Time</th>
<th>Arrival Time</th>
<th>Charges</th>
<th>Book</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Sr No</th>
<th>Flight</th>
<th>From</th>
<th>To</th>
<th>Departure Time</th>
<th>Arrival Time</th>
<th>Charges</th>
<th>Book</th>
</tr>
</tfoot>
<tbody>
<?php
if (isset($_POST['submit'])) {
//Add database connection
include 'data/database.php';
$from = $_POST['from'];
$to = $_POST['to'];
$date = $_POST['date'];
$adult = $_POST['adult'];
$child = $_POST['child'];
// if (empty($from) || empty($to) || empty($date) ||
// empty($adult) || empty($child)) {
// header("Location: ../results.php?error=Fields cannot be empty!");
// exit();
// }
// mysqli_stmt_close($stmt);
// mysqli_close($conn);
// include 'data/database.php';
$select_flight = "SELECT id,flightid, CONCAT(`flightid`,' - ', `flightname`) AS flight,capacity, startdes,finaldes,departuretime,arrivaltime,charges FROM flights having startdes = '$from' and finaldes = '$to' order by (charges)";
$query = mysqli_query($conn,$select_flight);
// $num = mysqli_num_rows($query);
while($res = mysqli_fetch_array($query)) {
?>
<tr>
<td><?php echo $res['id'];?></td>
<td><?php echo $res['flight'];?></td>
<td><?php echo $res['startdes'];?></td>
<td><?php echo $res['finaldes'];?></td>
<td><?php echo $res['departuretime'];?></td>
<td><?php echo $res['arrivaltime'];?></td>
<td><?php echo $res['charges'];?></td>
<td class="text-center">
<form action="book.php" method="post">
<button class="btn btn-success" type="submit" name="book" value="<?php echo $res['flightid'];?>" id="book" title="Book">Book</button>
</form>
</td>
<!-- <td class="text-center">
<form action="update.php" method="post">
<button class=" button-green" type="submit" name="edit" value="<?php echo $res['flightid'];?>" id="edit" title="Book">Edit</button>
</form>
</td>
<td class="text-center">
<form action="delete.php" method="post">
<button class=" button-green" type="submit" name="delete" value="<?php echo $res['flightid'];?>" id="delete" title="Book">Delete</button>
</form>
</td> -->
</tr>
<?php
}
// echo $from;
// echo $to;
}
?>
</tbody>
</table>
</div>
<!-- </div>
</div> -->
</div>
<?php
require_once 'footer.php';
?>