-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathClassic.jsp
197 lines (172 loc) · 5.41 KB
/
Classic.jsp
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<%@ page import="java.util.*" %>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Shop</title>
<link rel="stylesheet" type="text/css" href="StyleSheet.css"/>
</head>
<body>
<% if ( session.getAttribute("list") == null ){
session.setAttribute("list", new Vector());
}
Vector list = (Vector)session.getAttribute("list");
String item = request.getParameter("item");
if ( item != null && ! item.equals("") ){
list.addElement(item);}
String pick = request.getParameter("pick");
if ( pick != null && pick.equals("on") ) {
%>
<div id="header">
<a href="Shop.xhtml">
<h1 class="head">Big O Doughnuts</h1>
</a>
</div>
<div id="main">
<div id="NavBar">
<ul>
<a href="Shop.xhtml">
<li>Main Shop</li>
</a>
<a href="New2017Collection.xhtml">
<li>New 2017 Collection</li>
</a>
<a href="WeddingCollection.xhtml">
<li>Wedding Collection</li>
</a>
<a href="Delivery.xhtml">
<li>Delivery</li>
</a>
<a href="AboutUs.xhtml">
<li>About Us</li>
</a>
</ul>
</div>
<h1 style="text-align:center;">Explore our "Classic" range</h1>
<img id="home" src="home.jpg"/>
<table class="reflow">
<tbody>
<tr>
<td>
<span>Glazed</span>
<p>Original glazed nuts.</p>
<form action="http://www2.macs.hw.ac.uk:8080/demo/list.jsp" method="post">
<select name="buy">
<option name="item"> 1 </option>
<option> 2 </option>
<option> 3 </option>
</select>
<input type="submit" value="add to cart"/>
</form>
<img class="reflow" src="krispy-kreme-donuts.jpg"/>
</td>
<td>
<span>Chocolate</span>
<p>Smooth chocolate coated nuts.</p>
<form action="http://www2.macs.hw.ac.uk/~ns53/WebProgram/Cart" method="post">
<select name="buy">
<option> 1 </option>
<option> 2 </option>
<option> 3 </option>
</select>
<input type="submit" value="add to cart"/>
</form>
<img class="reflow" src="krispy-kreme-donuts.jpg"/>
</td>
<td>
<span>Sprinkles</span>
<p>Colourful sprinkled nuts.</p>
<form action="http://www2.macs.hw.ac.uk/~ns53/WebProgram/Cart" method="post">
<select name="buy">
<option> 1 </option>
<option> 2 </option>
<option> 3 </option>
</select>
<input type="submit" value="add to cart"/>
</form>
<img class="reflow" src="krispy-kreme-donuts.jpg"/>
</td>
<td>
<span>Iced</span>
<p>Nuts covered in delicate icing.</p>
<form action="http://www2.macs.hw.ac.uk/~ns53/WebProgram/Cart" method="post">
<select name="buy">
<option> 1 </option>
<option> 2 </option>
<option> 3 </option>
</select>
<input type="submit" value="add to cart"/>
</form>
<img class="reflow" src="krispy-kreme-donuts.jpg"/>
</td>
</tr>
<tr>
<td>
<span>Oreo</span>
<p>Nuts with an oreo twist.</p>
<form action="http://www2.macs.hw.ac.uk/~ns53/WebProgram/Cart" method="post">
<select name="buy">
<option> 1 </option>
<option> 2 </option>
<option> 3 </option>
</select>
<input type="submit" value="add to cart"/>
</form>
<img class="reflow" src="krispy-kreme-donuts.jpg"/>
</td>
<td>
<span>Sugared</span>
<p>Nuts sprinkled with a fine sugar.</p>
<form action="http://www2.macs.hw.ac.uk/~ns53/WebProgram/Cart" method="post">
<select name="buy">
<option> 1 </option>
<option> 2 </option>
<option> 3 </option>
</select>
<input type="submit" value="add to cart"/>
</form>
<img class="reflow" src="krispy-kreme-donuts.jpg"/>
</td>
<td>
<span>Choco Frosted</span>
<p>Nuts with a fine frosting.</p>
<form action="http://www2.macs.hw.ac.uk/~ns53/WebProgram/Cart" method="post">
<select name="buy">
<option> 1 </option>
<option> 2 </option>
<option> 3 </option>
</select>
<input type="submit" value="add to cart"/>
</form>
<img class="reflow" src="krispy-kreme-donuts.jpg"/>
</td>
<td>
<span>Strawberry</span>
<p>Juicy strawberry nuts.</p>
<form action="http://www2.macs.hw.ac.uk/~ns53/WebProgram/Cart" method="post">
<select name="buy">
<option> 1 </option>
<option> 2 </option>
<option> 3 </option>
</select>
<input type="submit" value="add to cart"/>
</form>
<img class="reflow" src="krispy-kreme-donuts.jpg"/>
</td>
</tr>
</tbody>
</table>
</div>
<jsp:forward page="pick.jsp" />
<%} else {%>
<% if ( list != null ){
for (int i=0; i<list.size(); i++)
out.println((String)list.elementAt(i) + "<br>");
}}%>
<p>
<form action=http://www2.macs.hw.ac.uk:8080/jpm5/list.jsp
method=post>
Add <input name=item size=20> <p>
Is list complete? <input type=checkbox name=pick> <p>
<input type=submit value=Continue>
</form>
</body>
</html>