-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbilling.html
106 lines (81 loc) · 4.45 KB
/
billing.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
<!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://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<link rel="stylesheet" href="css/bill.css">
<link rel="stylesheet" href="css/loader.css">
<title>Billing</title>
</head>
<body onload="load_loader()">
<div id="loader"><img id="chef-loading" src="img/chef.gif" alt=""></div>
<div id="main">
<div class=" card mb-3 shadow" style="max-width: 25rem;position: relative;margin: auto;top: 15vh;left: 0;right: 0;bottom: 0;">
<div class="card-body">
<a style="position: absolute; background: #222; color: white;float: left;border-radius: 100%;margin-top: -7px;" class="btn" href="index.html" >
<i class="fa fa-angle-double-left" style="font-size:24px"></i>
</a>
<h4 class="card-title text-center">Billing</h4>
<hr>
<div id="base" ><div class="card-text"><span style="padding-left:10px;">Pizza Base</span><b style="float:right;padding-right:10px;">$5</b></div></div>
<div id="sauce" ></div>
<div id="pepporoni" ></div>
<div id="olive" ></div>
<div id="mushroom" ></div>
<hr>
<div id="amount" ></div>
</div>
<button style="background: linear-gradient(to right, #8e2de2, #4a00e0); color: white;float: right;" class="btn " type="button" id="button">Print Bill</button>
</div>
</div>
<script>
jsarray = JSON.parse(sessionStorage.getItem("jsArray"));
console.log(jsarray);
var count = 0;
if (jsarray[0] != null){
var sauce = document.getElementById("sauce");
sauce.innerHTML = '<div class="card-text"><span style="padding-left:10px;">'+jsarray[0]+'</span><b style="float:right;padding-right:10px;">$2</b></div>';
count = 1;
}
if (jsarray[1] != null){
var pepporoni = document.getElementById("pepporoni");
pepporoni.innerHTML = '<div class="card-text"><span style="padding-left:10px;">'+jsarray[1]+'</span><b style="float:right;padding-right:10px;">$2</b></div>' ;
count = count + 1;
}
if (jsarray[2] != null){
var olive = document.getElementById("olive");
olive.innerHTML = '<div class="card-text"><span style="padding-left:10px;">'+jsarray[2]+'</span><b style="float:right;padding-right:10px;">$2</b></div>' ;
count = count + 1;
}
if (jsarray[3] != null){
var mushroom = document.getElementById("mushroom");
mushroom.innerHTML = '<div class="card-text"><span style="padding-left:10px;">'+jsarray[3]+'</span><b style="float:right;padding-right:10px;">$2</b></div>' ;
count = count + 1;
}
total = count * 2 + 5; //Pizza Base amount added
var amount = document.getElementById("amount");
amount.innerHTML = '<div class="card-text "><span style="padding-left:10px;font-weight:bold;">Total</span><b style="float:right;padding-right:10px;">$'+total+'</b></div>' ;
</script>
<script>
function load_loader() {
setTimeout(preloader, 5000);
}
function preloader() {
document.getElementById("loader").style.display = "none";
document.getElementById("main").style.display = "block";
}
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
<script>
$('button').on('click', function () {
print();
});
</script>
</body>
</html>