forked from deepakChourasiya-aj/Furniture-Stock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomers.js
102 lines (90 loc) · 3.37 KB
/
customers.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
92
93
94
95
96
97
98
99
100
101
102
async function getproducts(){
try {
let data= await fetch("http://localhost:3000/api/users")
let user=await data.json();
appenddetails(user)
} catch (error) {
console.log(error)
}
}
getproducts()
function appenddetails(data){
document.querySelector("tbody").innerHTML="";
data.forEach(ele => {
let box=document.createElement("tr");
let name=document.createElement("td")
name.innerText=`${ele.firstname} ${ele.lastname}`
let mail=document.createElement("td")
mail.innerText=ele.email;
let mobile=document.createElement("td");
mobile.innerText=ele.phone;
let password=document.createElement("td");
password.innerText=ele.password;
let userid=document.createElement("td");
userid.innerText=ele.id
let place=document.createElement("td");
place.innerText=ele.place
box.append(name,userid,mail,mobile,password,place)
document.querySelector("tbody").append(box)
});
}
document.querySelector(".theme-toggler .dark").addEventListener("click",function(){
let cont=document.querySelector(".container")
cont.style.backgroundColor="black";
let dash=document.querySelector(".container main h1")
dash.style.color="white"
let top=document.querySelector("aside .sidebar>a .material-symbols-sharp")
top.style.color="white"
let side=document.querySelector("aside .sidebar>a")
side.style.color="white";
let right=document.querySelector(".right .recent-updates h2")
right.style.color="white";
let right1=document.querySelector(".right .sales-analytics h2")
right1.style.color="white";
let main=document.querySelector(".container main .recentorder h2")
main.style.color="white";
let insight=document.querySelector("main .insights>div ")
insight.style.boxShadow="0 2rem 3rem rgba(104, 110, 164, 0.18);"
let top1=document.querySelector(".container .right>.top>.profile>.profile-name>p")
top1.style.color="white"
let q=theme-toggler.querySelector("span:nth-child(2)")
q.style
})
document.querySelector(".theme-toggler .active").addEventListener("click",function(){
let cont=document.querySelector(".container")
cont.style.backgroundColor=" aliceblue";
let cont1=document.querySelector(".container main h1");
cont1.style.color="black";
let main1=document.querySelector(".container main .recentorder h2")
main1.style.color="black"
let right3=document.querySelector(".right .recent-updates h2")
right3.style.color="black";
let right4=document.querySelector(".right .sales-analytics h2")
right4.style.color="black";
let top1=document.querySelector(".container .right>.top>.profile>.profile-name>p")
top1.style.color="black"
let side=document.querySelector(".sidebar #dash")
side.style.color="grey"
let side1=document.querySelector(".sidebar #dash span")
side1.style.color="grey"
})
let v= document.getElementById("feedback")
v.style.display="none"
function menuitem2(){
if(v.style.display=="none"){
v.style.display="block"
}
else{
v.style.display="none"
}
}
let x2= document.getElementById("feedback")
x2.style.display="none"
function feedbackPage(){
if(x2.style.display=="none"){
x2.style.display="flex"
}
else{
x2.style.display="none"
}
}