-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.html
171 lines (146 loc) · 3.55 KB
/
admin.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Panel</title>
<style>
body{
font-family: Roboto, Rubik, Noto Kufi Arabic, Noto Sans JP, sans-serif;
color: #323338;
font-size: 14px;
}
#container{
width: 90%;
margin: auto;
height: 600px;
border: 1px solid #c3c6d4;
border-radius: 8px;
padding: 30px;
}
#main{
display: flex;
}
#main>div:nth-child(1){
width: 25%;
border-right: 1px solid #c3c6d4;
}
#main>div:nth-child(2){
width: 75%;
padding: 0px 20px;
}
#title{
text-align: center;
border-bottom: 1px solid #c3c6d4;;
}
#select1{
margin: auto;
width:60%;
height: 40px;
border: 1px solid #c3c6d4;
font-size: 14px;
}
#search>h5{
font-size: 14px;
}
table{
font-size: 14px;
width: 100%;
margin: auto;
margin-top: 50px;
margin-bottom: 50px;
text-align: center;
border-collapse: collapse;
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
}
thead tr{
background-color:#0060B9;
color: white;
}
th{
font-size: 14px;
}
td{
font-size: 13px;
}
th,td{
padding: 8px 5px;
}
tr{
border-bottom: 1px solid #c3c6d4;
}
th{
border: 1px solid #c3c6d4;
}
</style>
</head>
<body>
<div id="container">
<div id="title">
<h2>Admin Dashoard</h2><br>
</div>
<div id="main">
<div id="search">
<h5 for="">Select to see the filtered data</h5>
<select id="select1">
<option value="">All</option>
<option value="Subscribed">Subscribed</option>
<option value="Not Subscribed">Not Subscribed</option>
</select>
</div>
<div id="showtable">
<table>
<thead>
<tr>
<th>Name</th>
<th>Email Address</th>
<th>Phone Number</th>
<th>Password</th>
<th>Delete User</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
</body>
</html>
<script>
let signupdataJS = JSON.parse(localStorage.getItem("signupdata")) || [];
show=(signupdataJS)=>{
document.querySelector("tbody").innerHTML="";
signupdataJS.forEach((item,i)=>{
let name=document.createElement("td");
name.innerText=item.name;
let email=document.createElement("td");
email.innerText=item.email;
let phone=document.createElement("td");
phone.innerText=item.phone;
let password=document.createElement("td");
password.innerText=item.pass;
let delet= document.createElement("td");
delet.style.backgroundColor= "red";
delet.addEventListener("click", deleter);
let tr=document.createElement("tr");
tr.append(name,email,phone,password,delet);
document.querySelector("tbody").append(tr);
})
}
show(signupdataJS);
document.querySelector("#select1").addEventListener("change",function(){
filterit=document.querySelector("#select1").value;
console.log(filterit);
if(filterit!=="")
{
let filtered_Data=signupdataJS.filter((item)=>{;
return item.subscribed==filterit;
})
show(filtered_Data);
}
else{
show(signupdataJS);
}
})
</script>