-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorder.html
87 lines (80 loc) · 2.87 KB
/
order.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Your Order</title>
<!-- Add icon library -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- Bootstrap core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/scrolling-nav.css" rel="stylesheet">
</head>
<body>
<div class="here">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto">
<h1>Here's your table's order, please select your dishes.</h2>
<form>
<fieldset>
<legend>Appetizers</legend>
<div>
<input type="checkbox" id="order1" name="salad">
<label for="order1">Green Salad</label>
</div>
<div>
<input type="checkbox" id="order2" name="soup">
<label for="order2">Cream of Mushroom Soup</label>
</div>
</fieldset>
</form>
<form>
<fieldset>
<legend>Main Dishes</legend>
<div>
<input type="checkbox" id="order3" name="salmon">
<label for="order3">Pan-Seared Salmon with Kale and Apple Salad</label>
</div>
<div>
<input type="checkbox" id="order4" name="meat">
<label for="order4">Greek Meat and Chick Pea</label>
</div>
</fieldset>
</form>
<form>
<fieldset>
<legend>Dessert</legend>
<div>
<input type="checkbox" id="order5" name="cake">
<label for="order3">Frozen Caramel-Apple Crunch Cake</label>
</div>
<div>
<input type="checkbox" id="order6" name="brownies">
<label for="order4">Red Velvet Brownies with Cream Cheese Frosting</label>
</div>
</fieldset>
</form>
<button onclick="myFunction()">Done</button>
<p id="demo"></p>
</div>
</div>
</div>
<script>
function myFunction() {
var items = ["order1", "order2", "order3", "order4", "order5", "order6"];
var prices = [7.99, 5.99, 19.99, 21.99, 7.99, 6.99];
var your_total = 0.0;
for (var i=0; i<items.length; i++) {
if (document.getElementById(items[i]).checked) {
your_total += prices[i];
}
}
document.getElementById("demo").innerHTML = "Your individual bill is $"+your_total+".";
}
</script>
</div>
</body>