-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShoppingCart.jspx
113 lines (95 loc) · 2.9 KB
/
ShoppingCart.jspx
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
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:my="http://jakarta.apache.org/tomcat/mytaglib">
<head>
<title>Shop Cart</title>
<meta http-equiv="Content-Script-Type" content="text/javascript" />
</head>
<body>
<form action="Cashier" method="POST">
<c:set var="products" value="${sessionScope.cart.items}" />
<table align="left" >
<tr>
<th colspan="2">
<jsp:directive.include file="menu.jspx" />
<font color="red"> ${requestScope.error}</font>
</th>
</tr>
<tr><td valign="top">
<table align="left" >
<tr>
<td>
<div class="messageBox">
<table align="center" width="100%">
<tr class="header">
<th colspan="6">Shopping Cart</th>
</tr>
<tr>
<th>Product ID</th>
<th>Product Name</th>
<th>Unit Price</th>
<th>Quantity</th>
<th>Total Price</th>
<th></th>
</tr>
<c:forEach var="item" items="${products}">
<tr onmouseover="highlight(this)" onmouseout="lowlight(this)">
<input type="hidden"
name="productID" value="${item.value.number}" />
<td align="center">${item.value.number}</td>
<td align="center">${item.value.name}</td>
<td align="center">${item.value.price}</td>
<td align="center">
<input align="right" type="text" size="3"
name="quantity" value="${item.value.quantity}" />
</td>
<td align="center">${item.value.quantity*item.value.price}</td>
<td align="center">
<form action="Cashier" method="POST">
<input type="hidden" name="productID" value="${item.value.number}" />
<input type="hidden" name="quantity" value="0" />
<input type="submit" class="specialButtonBlue" name="update" value="Remove" />
</form>
</td>
</tr>
</c:forEach>
<tr>
<td align="right" colspan="6">
<input type="submit" class="specialButton" name="update" value="Update" />
<input type="submit" class="specialButton" name="checkout" value="Checkout" />
<a href="Catalogue">
<input type="button" class="specialButton" name="continue" value="Continue Shopping" />
</a>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table></td>
<td valign ="top">
<table align="left" width="100%" ><tr><td>
<div class="messageBox">
<table border="0" width="100%">
<tr class="header">
<th>Total</th>
<th>Shipping Cost</th>
<th>GST</th>
<th>PST</th>
<th>Grand-Total</th>
</tr>
<tr>
<td align="center">${sessionScope.cart.total}$</td>
<td align="center">${sessionScope.cart.shippingCosts}$</td>
<td align="center">${sessionScope.cart.GST}$</td>
<td align="center" >${sessionScope.cart.PST}$</td>
<td align="center">${sessionScope.cart.grandTotal}$</td>
</tr>
</table>
</div>
</td></tr></table>
</td></tr></table>
</form>
</body>
</html>