-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewcart.html
62 lines (56 loc) · 1.75 KB
/
viewcart.html
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
<?php
session_start();
require_once("registration/config.php");
require_once("cart.php");
require_once("templates.inc");
/* user removed vehicle */
if (isset($_POST['remove_button'])) {
cart_remove($_POST['remove_button']);
}
$num_items = cart_num();
if($num_items == 0){
header("location: home.html");
}
?>
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>Shopping Cart</title>
<link href="cartpage.css" type="text/css" rel="stylesheet">
</head>
<body>
<div class="container">
<h1>Shopping Cart</h1>
<form action="checkout.html" method="POST">
<div class="cart">
<div class="products">
<?php $total = get_cart(); ?>
</div>
<!-- Cart info (total price)-->
<div class="cart-total">
<p>
<span>Total Price Per Day</span>
<span>$<?php echo $total ?></span>
</p>
<p>
<span>Number of Cars</span>
<span><?php echo $num_items ?></span>
</p>
<div class="elem-group">
<label for="checkin-date">Check-in Date</label>
<input type="date" id="checkin-date" name="checkin" value="<?php echo date('Y-m-d'); ?>" required>
</div>
<div class="elem-group">
<label for="checkout-date">Check-out Date</label>
<input type="date" id="checkout-date" name="checkout" value="<?php echo date('Y-m-d',time()+(60*60*24*7)); ?>" required>
</div>
<br>
<input type="hidden" name="cost" id="cost" value="<?php echo $total;?>">
<button href="checkout.html">Proceed to Checkout</a>
</form>
</div>
</div>
</div>
</body>
</html>