-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
91 lines (90 loc) · 2.53 KB
/
script.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//shop script
s = 0;
x = 0;
c = 0;
max = 300;
function add(ch1, ch) {
c = Number(ch);
s = s + Number(ch);
table = document.getElementById("tab");
row = table.insertRow(1);
cell1 = row.insertCell(0);
cell2 = row.insertCell(1);
cell1.innerHTML = ch1;
cell2.innerHTML = ch + " DT";
document.getElementById("total").innerHTML = s;
x = x + 1;
document.getElementById("quantity").innerHTML = x;
if (s > max && x > 5) {
alert("you get a 50dt discount");
max = max * 2;
}
}
function change(a, b, c, d, e, f) {
if (document.getElementById(a).hidden == true) {
document.getElementById(a).hidden = false;
} else {
document.getElementById(a).hidden = true;
}
if (document.getElementById(b).hidden == false) {
document.getElementById(b).hidden = true;
} else {
document.getElementById(b).hidden = true;
}
if (document.getElementById(c).hidden == false) {
document.getElementById(c).hidden = true;
} else {
document.getElementById(c).hidden = true;
}
if (document.getElementById(d).hidden == false) {
document.getElementById(d).hidden = true;
} else {
document.getElementById(d).hidden = true;
}
if (document.getElementById(e).hidden == false) {
document.getElementById(e).hidden = true;
} else {
document.getElementById(e).hidden = true;
}
if (document.getElementById(f).hidden == false) {
document.getElementById(f).hidden = true;
} else {
document.getElementById(f).hidden = true;
}
if (
document.getElementById(a).hidden == true &&
document.getElementById(b).hidden == true &&
document.getElementById(c).hidden == true &&
document.getElementById(d).hidden == true &&
document.getElementById(e).hidden == true &&
document.getElementById(f).hidden == true
) {
document.getElementById("card").hidden = false;
}else{
document.getElementById("card").hidden = true;
}
}
function delet() {
con = confirm("are you sure that you wont to delete your last order");
if (con == true) {
document.getElementById("tab").deleteRow(1);
x = x - 1;
s = s - c;
document.getElementById("quantity").innerHTML = x;
document.getElementById("total").innerHTML = s;
if (x == 0 || s < 0) {
document.getElementById("total").innerHTML = 0;
}
}
}
/*singup-in script*/
verif = false;
function verifier() {
verif = true;
}
/*index script*/
function check() {
if ((verif = true)) {
document.getElementById("az").checked == verif;
}
}