-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpizza.html
380 lines (275 loc) · 12.2 KB
/
pizza.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
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link href='https://fonts.googleapis.com/css?family=Petit Formal Script' rel='stylesheet'>
<style> body {background-color:#000;} .heading{color:#000; padding-bottom: 50px; padding-left: 60px;padding-top: 30px; text-align: center; font-family: verdana; font-size: 30pt; text-decoration: oblique; font-weight: bold; text-decoration:underline overline;} .since{font-weight:30;}h1{text-align: center;font-size: 50pt;} #size{padding-bottom: 30px;} #crust{padding-bottom: 30px;} #meats{padding-bottom: 30px;} #veg{padding-bottom: 30px;} .header{height:500px; width: 72%; margin: 0 auto; padding-bottom: 60px; padding-bottom: 70px;} p{font-size: 20pt; margin-left: 30px;} input[type="radio"] {margin-left: 30px;}
input[type="checkbox"] {margin-left: 30px; margin-top: 20px;} .pad { margin-top:90px; }.float{display: inline-block;}.prices{font-size: 15pt;}
button:hover{color:#000;font-weight:bold;border:2px solid#000;}
#btnOrder {font-weight: bold; font-size:20pt; margin-left: 30px;}
h5 {font-size: 12pt; margin-left: 30px;}
#cart {margin-left: 30px;} .container{ background-color: #FFFFCC; padding-top: 90px; border: 2px dashed #ff0000;} .question{text-align: center; font-family: 'Petit Formal Script'; font-size: 30px; font-weight:bold; margin-top:-30px;} .options {padding-left: 50px; margin-bottom: 20px;}.header { padding-bottom: 100px; margin-top:60px; margin-bottom:50px;}</style>
</head>
<body>
<!-- Content here -->
<div class="header">
<img src="./images/fredspizza7.png" alt="" style="width:100%;height:90%;">
<br>
<div class="container pad">
<p class="question"><i><strong>Choose a Size:</strong><i></p>
<section id="size"
<h5 class="options"><i>Personal $6, Medium $10, Large $14, Xtra Large $16</i></h5>
<br>
<br>
<input class="Size" type="radio" name="size" value="Personal Pizza">Personal</input>  
<input class="Size" type="radio" name="size" value="Medium Pizza">Medium</input>  
<input class="Size" type="radio" name="size" value="Large Pizza">Large</input
>  
<input class="Size" type="radio" name="size" value="Extra Large Pizza">Extra Large</input>
<img src="border.png" alt="" style="width:105%;height:105%;">
<!-- Content here -->
</div>
<br><br><br><br>
<div class="container meat">
<p class="question"><i><strong>Add Meats:</strong></i></p>
<section id="meats"
<h5><i>One free meat, $1 per additional</i></h5>
<br>
<input class="Meat" type="checkbox" name="meat" value="Pepperoni">Pepperoni</input><br>
<input class="Meat" type="checkbox" name="meat" value="Sausage">Sausage</input><br>
<input class="Meat" type="checkbox" name="meat" value="Canadian Bacon">Canadian Bacon</input><br>
<input class="Meat" type="checkbox" name="meat" value="Ground Beef">Ground Beef</input><br>
<input class="Meat" type="checkbox" name="meat" value="Anchovy">Anchovy</input><br>
<input class="Meat" type="checkbox" name="meat" value="Chicken">Chicken</input><br>
</div>
<br><br><br>
<div class="container">
<p class="question"><i><strong>Add Veggies:</strong></i></p>
<section id="veg"
<h5><i>One free veggie, $1 per additional</i></h5>
<br>
<input class="Veggie" type="checkbox" name="veggie" value="Tomatoes">Tomatoes<br>
<input class="Veggie" type="checkbox" name="veggie" value="Onions">Onions<br>
<input class="Veggie" type="checkbox" name="veggie" value="Olives" checked>Olives<br>
<input class="Veggie" type="checkbox" name="veggie" value="Green Peppers">Green Peppers<br>
<input class="Veggie" type="checkbox" name="veggie" value="Mushrooms">Mushrooms<br>
<input class="Veggie" type="checkbox" name="veggie" value="Pineapple">Pineapple<br>
<input class="Veggie" type="checkbox" name="veggie" value="Spinach">Spinach<br>
<input class="Veggie" type="checkbox" name="veggie" value="Jalapeno">Jalapeno<br>
</div>
<br><br><br>
<div class="container">
<p class="question"><i><strong>Choose a Crust:</strong></i></p>
<section id="crust">
<h5><i>$3 charge for Cheese Stuffed Crust</i></h5>
<br>
<input class="Crust" type="radio" name="crust" value="Plain Crust">Plain Crust</input>  
<input class="Crust" type="radio" name="crust"value="Garlic Butter Crust">Garlic Butter Crust</input>  
<input class="Crust" type="radio" name="crust" value="Cheese Stuffed Crust">Cheese Stuffed Crust</input
>  
<input class="Crust" type="radio" name="crust" value="Spicy Crust">Spicy Crust</input>
<input class="Crust" type="radio" name="crust" value="House Special Crust">House Special Crust</input>
</div>
<br>
<br>
<br>
<div class="container">
<p class="question"><i><strong>Choose a Sauce:</strong></i></p>
<br>
<input type="radio" class="Sauce" name="sauce" value="Marinara">Marinara</input>  
<input type="radio" class="Sauce" name="sauce"value="White">White</input>  
<input type="radio" class="Sauce" name="sauce" value="Barbecue">Barbecue</input
>  
<input type="radio" class="Sauce" name="sauce" value="No Sauce">No Sauce</input>
<br>
<br>
</div>
<br>
<br>
<br>
<div class="container">
<p class="question"><i><strong>Customize Cheese:</strong></i></p>
<h5><i>$3 charge for Extra Cheese</i></h5>
<input type="radio" class="Cheese" name="cheese" value="Regular">Regular</input>  
<input type="radio" class="Cheese" name="cheese" value="No Cheese">No Cheese</input
>  
<input type="radio" class="Cheese" name="cheese" value="Extra Cheese">Extra Cheese</input>
<br>
<br>
</div>
<br>
<br><br>
<input id="btnOrder" class="submitbutton" type="button" onclick="Receipt()"
value="Place Order">
<br>
<br>
<div id="cart">
<div id="showText"></div>
<div id="totalPrice"></div>
</div>
</form>
<script>
function Receipt() {
// This initializes our string so it can get passed from
// function to function, growing line by line into a full receipt
var text1 = "<h3>Your Cart:</h3>";
var runningTotal = 0;
var sizeTotal = 0;
var sizeArray = document.getElementsByClassName("Size");
for (var i = 0; i < sizeArray.length; i++) {
if (sizeArray[i].checked) {
var selectedSize = sizeArray[i].value;
text1 = text1+selectedSize+"<br>";
}
}
if (selectedSize === "Personal Pizza") {
sizeTotal = 6;
} else if (selectedSize === "Medium Pizza") {
sizeTotal = 10;
} else if (selectedSize === "Large Pizza") {
sizeTotal = 14;
} else if (selectedSize === "Extra Large Pizza") {
sizeTotal = 16;
}
runningTotal = sizeTotal;
console.log(selectedSize+" = $"+sizeTotal+".00");
console.log("size text1: "+text1);
console.log("subtotal: $"+runningTotal+".00");
getMeat(runningTotal,text1); // All three of these variables will be passed on to each function
};
function getMeat(runningTotal,text1) {
var meatTotal = 0;
var selectedMeat = [];
var meatArray = document.getElementsByClassName("Meat");
for (var j = 0; j < meatArray.length; j++) {
if (meatArray[j].checked) {
selectedMeat.push(meatArray[j].value);
console.log("selected meat item: ("+meatArray[j].value+")");
text1 = text1+meatArray[j].value+"<br>";
}
}
var meatCount = selectedMeat.length;
if (meatCount > 1) {
meatTotal = (meatCount - 1);
} else {
meatTotal = 0;
}
runningTotal = (runningTotal + meatTotal);
console.log("total selected meat items: "+meatCount);
console.log(meatCount+" meat - 1 free meat = "+"$"+meatTotal+".00");
console.log("meat text1: "+text1);
console.log("Purchase Total: "+"$"+runningTotal+".00");
getVeg(runningTotal,text1);
};
function getVeg(runningTotal,text1) {
var vegTotal = 0;
var selectedVeg = [];
var vegArray = document.getElementsByClassName("Veggie");
for (var j = 0; j < vegArray.length; j++) {
if (vegArray[j].checked) {
selectedVeg.push(vegArray[j].value);
console.log("selected veg item: ("+vegArray[j].value+")");
text1 = text1+vegArray[j].value+"<br>";
}
}
var vegCount = selectedVeg.length;
if (vegCount > 1) {
vegTotal = (vegCount - 1);
} else {
vegTotal = 0;
}
runningTotal = (runningTotal+vegTotal);
console.log("total selected veg items: "+vegCount);
console.log(vegCount+" veg - 1 free veg = "+"$"+vegTotal+".00");
console.log("veg text1: "+text1);
console.log("Purchase Total: "+"$"+runningTotal+".00");
getCrust(runningTotal,text1);
};
function getCrust(runningTotal,text1) {
var selectedCrust = [];
var crustTotal = 0;
var crustArray = document.getElementsByClassName("Crust");
var selectedCrust;
var crustArray = document.getElementsByClassName("Crust");
for (var i = 0; i < crustArray.length; i++) {
if (crustArray[i].checked) {
selectedCrust = crustArray[i].value;
text1 = text1+selectedCrust+"<br>";
}
}
if (selectedCrust === "Cheese Stuffed Crust") {
crustTotal=3;
} else if (selectedCrust === "Plain Crust") {
crustTotal=0;
} else if (selectedCrust === "Garlic Butter Crust") {
crustTotal=0;
} else if (selectedCrust === "Spicy Crust") {
crustTotal=0;
} else if (selectedCrust==="House Special Crust") {
crustTotal=0;
}
runningTotal = (runningTotal+crustTotal);
console.log(selectedCrust+" = $"+crustTotal+".00");
console.log("crust text1: "+text1);
console.log("Purchase Total: "+"$"+runningTotal+".00");
getSauce(runningTotal,text1);
};
//sauce
function getSauce(runningTotal,text1) {
var selectedSauce = [];
var sauceTotal = 0;
var sauceArray = document.getElementsByClassName("Sauce");
var selectedSauce;
var sauceArray = document.getElementsByClassName("Sauce");
for (var i = 0; i < sauceArray.length; i++) {
if (sauceArray[i].checked) {
selectedSauce = sauceArray[i].value;
text1 = text1+selectedSauce+"<br>";
}
}
runningTotal = (runningTotal+sauceTotal);
console.log(selectedSauce+" = $"+sauceTotal+".00");
console.log("sauce text1: "+text1);
console.log("Purchase Total: "+"$"+runningTotal+".00");
getCheese(runningTotal,text1);
};
function getCheese(runningTotal,text1) {
var selectedCheese = [];
var cheeseTotal = 0;
var cheeseArray = document.getElementsByClassName("Cheese");
var selectedCheese;
var cheeseArray = document.getElementsByClassName("Cheese");
for (var i = 0; i < cheeseArray.length; i++) {
if (cheeseArray[i].checked) {
selectedCheese = cheeseArray[i].value;
text1 = text1+selectedCheese+"<br>";
}
}
if (selectedCheese === "Extra Cheese") {
cheeseTotal=3;
} else if (selectedCheese === "Regular") {
cheeseTotal=0;
} else if (selectedCheese === "No Cheese") {
cheeseTotal=0;
}
runningTotal = (runningTotal+cheeseTotal);
console.log(selectedCheese+" = $"+cheeseTotal+".00");
console.log("cheese text1: "+text1);
console.log("Purchase Total: "+"$"+runningTotal+".00");
document.getElementById("showText").innerHTML=text1;
document.getElementById("totalPrice").innerHTML = "<h3>Total: <strong>$"+runningTotal+".00"+"</strong></h3>";
document.getElementById("showText").style.color = "#ff0000";
document.getElementById("totalPrice").style.color = "#ff0000";
};
</script>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</body>
</html>