-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreservation-without-success.php
98 lines (84 loc) · 3.98 KB
/
reservation-without-success.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
<?php
include('session_customer.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.0">
<title>Reservation | Accel</title>
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<!-- font -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css">
<!-- css files -->
<link rel="stylesheet" href="assets/css/w3.css">
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/custom/style.css">
</head>
<body style="padding-top: 80px;">
<?php include 'includes/header.php';
$id = $_GET['id'];
$sql1 = "SELECT * FROM cars c, reservation r WHERE reservation_id = '$id' AND c.car_id = r.car_id";
$result1 = $conn->query($sql1);
function dateDiff($start, $end) {
$start_ts = strtotime($start);
$end_ts = strtotime($end);
$diff = $end_ts - $start_ts;
return round($diff / 86400);
}
if (mysqli_num_rows($result1) > 0) {
while($row = mysqli_fetch_assoc($result1)) {
$rent_start_date = $row['rent_start_date'];
$rent_end_date = $row['rent_end_date'];
$car_name = $row["car_name"];
$fare = $row['rent_price'];
$err_date = dateDiff("$rent_start_date", "$rent_end_date");
$total_amount = $fare * $err_date;
}
}
?>
<div class="container">
<div class="jumbotron">
<h1 class="text-center" style="color: green;"><span class="glyphicon glyphicon-ok-circle"></span> Reservation Confirmed.</h1>
</div>
</div>
<div class="container">
<h5 class="text-center">Please read the following information about your reservation.</h5>
<div class="box">
<div class="col-md-10" style="float: none; margin: 0 auto; text-align: center;">
<h3 style="color: orange;">Your reservation has been received and placed into our reservation processing system.</h3>
<br>
<h2 class="text-center"> <strong>Your Reservation Number:</strong> <span style="color: #1ba39c;"><strong><?php echo "$id"; ?></strong></span> </h2>
<br>
<h4>Please make a note of your <strong>reservation number</strong> now and keep in the event you need to communicate with us about your reservation.</h4>
<br>
<h3 style="color: orange;">Invoice</h3>
<br>
</div>
<div class="col-md-10" style="float: none; margin: 0 auto; ">
<h4> <strong>Car Name: </strong> <?php echo $car_name; ?></h4>
<br>
<h4> <strong>Rent Price:</strong> ₱ <?php echo $fare; ?>/day</h4>
<br>
<h4> <strong>Total Rent Amount:</strong> ₱ <?php echo $total_amount; ?></h4>
<br>
<br>
<h4> <strong>Reservation Date: </strong> <?php echo date("Y-m-d"); ?> </h4>
<br>
<h4> <strong>Start Date: </strong> <?php echo $rent_start_date; ?></h4>
<br>
<h4> <strong>Return Date: </strong> <?php echo $rent_end_date; ?></h4>
<br>
</div>
</div>
<?php
include 'includes/footer.php';
?>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/jquery.easing.min.js"></script>
<script src="assets/js/theme.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
</body>
</html>