-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
74 lines (71 loc) · 3.11 KB
/
index.js
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
let name = prompt("Enter Your Name", "Guest");
setTimeout(() => {
let time = new Date();
if(time.getHours()<12 && time.getHours()>=0){
alert("Good Morning " + name + ", Hope You are doing well. Welcome to our site, We provide best quality food at such an affordable price that you will not regret after ordering from our site.")
}
else if(time.getHours()>=12 && time.getHours()<=16){
alert("Good Afternoon " + name + ", We hope You are doing well. Welcome to our site, We provide best quality food at such an affordable price that you will not regret after ordering from our site.")
}
else if(time.getHours()>=16 && time.getHours()<=22){
alert("Good Evening " + name + ", Hope You are doing well. Welcome to our site, We provide best quality food at such an affordable price that you will not regret after ordering from our site.")
}
else if(time.getHours()>=22 && time.getHours()<24){
alert("Hello " + name + ",We Hope You are doing well. Welcome to our site, We provide best quality food at such an affordable price that you will not regret after ordering from our site.")
}
}, 4500);
let total = 0;
function explore(){
let show = document.getElementById('intca')
if(show.style.display!='none'){
show.style.display = 'none';
}else{
show.style.display = 'flex';
}
}
function none(id1, id2,id3, price){
let a = document.getElementById('amtbtn');
let b = document.getElementById(id1);
let c = document.getElementById(id2);
let d = document.getElementById(id3);
d.style.display = 'none';
c.style.display = 'flex';
b.innerHTML = parseInt(b.innerHTML) + 1;
total = total + price;
a.innerHTML = total
}
function pay(id, id1,id2, ele , price){
let b = document.getElementById(id1);
let c = document.getElementById(id);
let d = document.getElementById(id2);
if(parseInt(b.innerHTML)>0){
b.innerHTML = parseInt(b.innerHTML) + ele;
let a = document.getElementById('amtbtn');
total+=price;
a.innerHTML = total
}
if(parseInt(b.innerHTML)==0){
c.style.display = 'none';
d.style.display = 'block';
}
}
function apay(){
let reference = Math.random()*10000000;
let d = parseInt(reference)
alert("Rs " + total + " Paid Succesfully, Thanks for choosing us. Your order will be delivered shortly with reference number: QO" + d);
total = 0;
let a = document.getElementsByClassName('Reitem');
let b = document.getElementsByClassName('mbutton')
let c = document.getElementsByClassName('display')
let e = document.getElementById('amtbtn');
e.innerHTML = total;
for(let i = 0; i<a.length; i++){
a[i].style.display= 'none';
}
for(let j = 0; j<b.length; j++){
b[j].style.display= 'block';
}
for(let j = 0; j<c.length; j++){
c[j].innerHTML= 0;
}
}