-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbooked.php
88 lines (69 loc) · 2.32 KB
/
booked.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
<?php
include('includes/config.php');
session_start();
// error_reporting(0);
if (isset($_SESSION['admin_loggedin']) && $_SESSION['admin_loggedin'] == true) {
header("location:/admin/dashboard.php");
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="assets/css/table.css">
<link rel="stylesheet" href="assets/css/style.css">
<title>RayBuy.com</title>
</head>
<body>
<?php
include("includes/header.php");
?>
<section class="booking-table">
<div class="rows">
<table>
<tr>
<th>ID</th>
<th>vehicle_id</th>
<th>From Date Point</th>
<th>To Date</th>
<th>Message</th>
<th>Status</th>
</tr>
<?php
$username = $_SESSION['user'];
$sql = "SELECT * from bookings WHERE username=:username";
$query = $dbh->prepare($sql);
$query->bindParam(':username', $username, PDO::PARAM_STR);
$query->execute();
$results = $query->fetchAll(PDO::FETCH_OBJ);
$cnt = 1;
if ($query->rowCount() > 0) {
foreach ($results as $result) {
?>
<tr>
<th><?php echo htmlentities($result->id); ?></th>
<th><?php echo htmlentities($result->vehicle_id); ?></th>
<th><?php echo htmlentities($result->from_date); ?></th>
<th><?php echo htmlentities($result->to_date); ?></th>
<th><?php echo htmlentities($result->message); ?></th>
<th><?php echo htmlentities($result->status); ?></th>
</tr>
<?php
}}
?>
</table>
</div>
<div class="input-group-btn">
<center>
<a href="index.php"><button type="button" class="btn btn-danger"><b>Go back</b></button></a>
</center>
</div>
</section>
<?php
include("includes/footer.php");
?>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>