-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathAdminsignup.html
More file actions
227 lines (177 loc) · 4.4 KB
/
Adminsignup.html
File metadata and controls
227 lines (177 loc) · 4.4 KB
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<!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 Signup</title>
<style>
.signup2box{
width: 45%;
margin:1rem auto;
padding: 2rem;
box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
height: 45rem;
}
.signup2box input{
width: 100%;
margin-top: 0px;
margin-bottom: 8px;
height: 2.2rem;
}
.signup2box p{
font-size: 15px;
margin: 0;
}
.end{
text-align: center;
font-size: 20px;
margin-top: 1rem;
}
.end a{
font-size: 20px;
color: #25b4e4;
font-weight: 700;
text-decoration: none;
margin-left:5px;
}
.signup2box h3{
margin-bottom: 0px;
}
.signup2box #signup{
background-color: #1c1616;
color: white;
font-weight: 700;
border: 0px solid white;
padding: 15px auto;
}
.signup2box #signup:hover{
background-color: #003380;
}
.mobileregister{
display:flex;
width: 100%;
justify-content: space-evenly;
}
.mobileregister img{
width: 100%;
}
.mobileregister .banner1{
width: 47%;
}
.mobileregister .parent1{
width: 47%;
text-align: center;
box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
margin:2rem 0;
padding-top: 2rem;
}
.mobileregister input{
width: 80%;
margin: auto;
margin-top: 1.5rem;
}
#btnx{
background-color: #e42529;
color: white;
border: 0px;
font-size: 20px;
font-weight: 700;
padding: 5px 10px;
}
#btnx:hover{
background-color: #003380;
}
.heading{
text-align: center;
font-size: 30px;
}
</style>
</head>
<body>
<div class="signup2box">
<div class="heading">
<h3>Register New Account</h3>
</div>
<hr>
<div id="child">
<form>
<label for="name"> Enter First Name*</label>
<input type="text" id="name" />
<br>
<label for="lastname"> Enter Last Name*</label>
<input type="text" id="lastname" />
<br>
<label for="email"> Enter Email Address*</label>
<input type="email" id="email" />
<br>
<label for="mobile">Enter Mobile Number*</label>
<input type="number" id="mobile" min="1000000000" max="9999999999">
<br>
<label for="password"> Set Your Password*</label>
<input type="password" id="password" />
<br><br>
<input type="button" id="signup"value="PROCEED">
<br>
<div class="end">
Already Have Account?
<a href="adminlogin.html">LOGIN</a>
</div>
</form>
</div>
</div>
<script>
let createaccountBtn = document.getElementById("signup")
createaccountBtn.addEventListener("click",()=>{
let AdminData=JSON.parse(localStorage.getItem("AdminData")) || []
let isNem=true
let firstName= document.getElementById("name").value
let lastName= document.getElementById("lastname").value
let email =document.getElementById("email").value
let mobile=document.getElementById("mobile").value
let password = document.getElementById("password").value
for(let i=0;i<AdminData.length;i++){
if(AdminData[i].email==email){
isNem=false
}
}
if(isNem){
AdminData.push(
{
firstName:firstName,
lastName:lastName,
email:email,
mobile:mobile,
password:password
}
)
localStorage.setItem("AdminData",JSON.stringify(AdminData))
alert(`${firstName} Wellcome to Cool Cloth`)
window.location.href = "adminlogin.html"
}else{
alert(`Sorry ${firstName} you are allready Registerd`)
}
})
//Admin signup token
createaccountBtn.addEventListener("click", function () {
registerData()
});
async function registerData(){
let obj={
firstname:firstName.value,
lastname:lastName.value,
email:email.value,
mobile:mobile.value,
password:password.value,
}
let resp=await fetch(`${"https://upset-red-outfit.cyclic.app/"}/adminLogin`,{
method:"POST",
body:JSON.stringify(obj),
headers:{'Content-Type': 'application/json'}
})
let data=await resp.json()
console.log(data)
}
</script>
</body>
</html>