-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcart-table.html
84 lines (80 loc) · 2.97 KB
/
cart-table.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html lang="zxx" class="no-js">
<head>
<!-- Mobile Specific Meta -->
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Favicon-->
<link rel="shortcut icon" href="img/fav.png">
<!-- Author Meta -->
<meta name="author" content="codepixer">
<!-- Meta Description -->
<meta name="description" content="">
<!-- Meta Keyword -->
<meta name="keywords" content="">
<!-- meta character set -->
<meta charset="UTF-8">
<!-- Site Title -->
<title>Restaurant</title>
<link href="https://fonts.googleapis.com/css?family=Poppins:100,200,400,300,500,600,700" rel="stylesheet">
<!--
CSS
============================================= -->
<link rel="stylesheet" href="css/linearicons.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/magnific-popup.css">
<link rel="stylesheet" href="css/nice-select.css">
<link rel="stylesheet" href="css/animate.min.css">
<link rel="stylesheet" href="css/owl.carousel.css">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-5 table-responsive">
<div align="right">
<a href="cart2-action.php?action=clear" class="btn btn-warning" style="color: white;"><b>Clear Cart</b></a>
</div>
<table class="table table-border ">
<thead>
<tr><b>
<th>product name</th>
<th>UP</th>
<th>Qty</th>
<th>Sub-total</th>
</b></tr>
</thead>
<tbody>
<?php if(isset($_COOKIE["shopping_cart"]))
{
$total = 0;
$cookie_data = stripslashes($_COOKIE['shopping_cart']);
$cart_data = json_decode($cookie_data, true);
}
foreach($cart_data as $keys => $values)
{
echo '<tr>
<td>'.$values["item_name"] .'</td>
<td>'.$values["item_price"] .'</td>
<td>'.$values["item_quantity"] .'</td>
<td>'.($values["item_quantity"] * $values["item_price"]).'</td>
</tr>';
$total = $total + ($values["item_quantity"] * $values["item_price"]);
}
?>
</tbody>
<tfoot>
<tr>
<td colspan="2"></td>
<td> <b>Total :</b></td>
<td> GHS 108</td>
</tr>
</tfoot>
</table>
</div>
<div class="col table-responsive">
<h2>check-out form</h2>
</div>
</div>
</body>
</html>