-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathregistrationform.html
More file actions
566 lines (455 loc) · 13.4 KB
/
Copy pathregistrationform.html
File metadata and controls
566 lines (455 loc) · 13.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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="shortcut icon" href="icon.ico">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<link href='https://fonts.googleapis.com/css?family=Permanent+Marker:400' rel='stylesheet' type='text/css'>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<!-- <link rel="stylesheet" href="style.css" /> -->
<title>Registration Form</title>
</head>
<style type="text/css">
* {
box-sizing: border-box;
}
.header ul {
margin: 0;
padding: 0;
list-style: none;
overflow: hidden;
color: white;
background:transparent;
;
}
.header li a {
display: block;
padding: 20px 20px;
font-weight:900;
color:black;
border-right: 1px solid #f4f4f4;
text-decoration: none;
}
.header li a:hover,
.header .menu-btn:hover {
background-color:#eee;
}
.header .logo {
display: block;
float: left;
font-size:0.8em;
font-weight:800;
color:black;
padding:20px 20px;
text-decoration: none;
}
/* menu */
.header .menu {
clear: both;
max-height:0;
transition: max-height .2s ease-out;
background:transparent;
}
/* menu icon */
.header .menu-icon {
cursor: pointer;
display: inline-block;
float: right;
padding: 30px 10px;
position: relative;
user-select: none;
}
.header .menu-icon .navicon {
background:#999;
display: block;
height: 2px;
position: relative;
transition: background .2s ease-out;
width:24px;
background-color:gray;
}
.header .menu-icon .navicon:before,
.header .menu-icon .navicon:after {
background: #999;
content: '';
display: block;
height: 100%;
position: absolute;
transition: all .2s ease-out;
width: 100%;
}
.header .menu-icon .navicon:before {
top: 5px;
}
.header .menu-icon .navicon:after {
top: -5px;
}
/* menu btn */
.header .menu-btn {
display: none;
}
.header .menu-btn:checked ~ .menu {
max-height:500px;
background-color:#eee;
color:black;
text-decoration-color:black;
}
.header .menu-btn:checked ~ .menu-icon .navicon {
background: transparent;
}
.header .menu-btn:checked ~ .menu-icon .navicon:before {
transform: rotate(-45deg);
}
.header .menu-btn:checked ~ .menu-icon .navicon:after {
transform: rotate(45deg);
}
.header .menu-btn:checked ~ .menu-icon:not(.steps) .navicon:before,
.header .menu-btn:checked ~ .menu-icon:not(.steps) .navicon:after {
top: 0;
}
.header {
opacity:0.9;
box-shadow: 1px 1px 4px 0 rgba(0,5,0,1);
position: fixed;
width: 100%;
z-index: 3;
background:transparent;
}
/* 48em = 768px */
@media (min-width: 48em) {
.header li {
float: left;
}
.header li a {
padding: 20px 30px;
}
.header .menu {
clear: none;
float: right;
max-height: none;
}
.header .menu-icon {
display: none;
}
}
body {
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande',
'Lucida Sans', Arial, sans-serif;
color: bisque;
background:url("event1.jpg");
height:200%;
}
form {
max-width: 400px;
margin: 35px auto;
border-radius: 10px;
padding: 10px 15px;
background:url("loader2.jpeg");
}
h1 {
margin: 0 0 30px 0;
text-align: center;
margin-top: 5px;
}
.alert {
text-align: center;
padding: 10px;
background: rgb(168, 240, 177);
color: green;
margin-bottom: 10px;
display: none;
}
.alert2 {
text-align: center;
padding: 10px;
background: rgb(168, 240, 177);
color: green;
margin-bottom: 0px;
display: none;
}
input[type='text'],
input[type='email'],
input[type='password'],
textarea,
select {
background: lightsteelblue;
border: 1px;
margin-bottom: 25px;
box-shadow: 2px;
color: beige;
background-color: rgb(142, 143, 223);
width: 100%;
padding: 15px;
margin: 0;
height: auto;
font-size: 15px;
}
select {
padding: 6px;
height: 32px;
border-radius: 2px;
}
fieldset {
margin-bottom: 30px;
border: none;
}
legend {
display: block;
margin-bottom: 8px;
}
label.light {
font-weight: 300;
display: inline;
}
.section {
background-color: rgb(68, 114, 221);
color: white;
height: 29px;
display: inline-block;
width: 29px;
border-radius: 100%;
text-align: center;
line-height: 30px;
margin-right: 4px;
font-size: 0.7em;
}
label {
display: block;
margin-bottom: 8px;
}
button {
padding: 25px 40px;
color: whitesmoke;
background-color: rgb(36, 159, 235);
font-size: 15px;
margin: 30px 0px 0px;
width: 100%;
text-align: center;
border-radius: 5px;
}
@media screen and (min-width: 480px) {
form {
max-width: 480px;
}
}
</style>
<body>
<header class="header">
<a href="http://saividya.ac.in/" class="logo">
Sai Vidya Institute Of Technology
</a>
<input class="menu-btn" type="checkbox" id="menu-btn" />
<label class="menu-icon" for="menu-btn"><span class="navicon"></span></label>
<ul class="menu">
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="Events.html">Events</a></li> <li><a href="">Tech Gallery</a></li>
<li><a href="#contact">Conatct</a></li>
</ul>
</header>
<br><br><br><br>
<p>
<ol id="datadisplay">
</ol>
</p>
<div id="id01" class="w3-modal">
<div class="w3-modal-content w3-card-4 w3-animate-zoom w3-light-blue" style="max-width:600px">
<h2 style="color: red;"></h2>
<div class="w3-center"><br>
<span onclick="document.getElementById('id01').style.display='none'" class="w3-button w3-xlarge w3-transparent w3-display-topright" title="Close Modal">×</span>
<h3 style="width:30%" class="w3-circle w3-margin-top">Confiramtion</h3>
</div>
<form class="w3-container" action="registrationform.html">
<div class="w3-section alert">
<p><li>You have successfully confirmed your slot for the event</li>
<li>Visit your nearer desk for the payment</li>
<button class="w3-button w3-blue w3-section w3-padding" type="submit"><a href="Events.html">Register for another event</button></a> <button class="w3-button w3-block w3-blue w3-section w3-padding" type="submit"><a href="index.html">Home</button></a>
</div>
</form>
</div>
</div>
<form action="" method="POST" id="registrationform">
<h2>TechVidya(Register)</h2>
<div class="alert">Registration Successfull</div>
<fieldset>
<!-- Section 1 -->
<legend><span class="section">1</span>Your Basic Info</legend>
<label class="" for="email">Email:</label>
<input type="email" name="email" value="" id="email" required />
<label class="" for="name">Name:</label>
<input type="text" name="name" value="" id="name" required />
<label class="" for="name">USN:</label>
<input type="text" name="usn" value="" id="usn" required />
<label class="" for="phn">Phone:</label>
<input type="text" name="bio" value="" id="phn" required />
<label class="" for="pass">Passowrd:</label>
<input type="password" name="pass" value="" id="pass" required />
<label class="" for="Confirmpass">Confirm Passowrd:</label>
<input type="password" name="Confirmpass" value="" id="Confirmpass" required />
</fieldset>
<!-- <fieldset>
<legend><span class="section">2</span>Select Event</legend>
<label for="password">Confirm Event</label>
<select name="Select" value="" id="Event" required />
<optgroup label="Select">
<option value="Cryptohunt" id="frontend">Cryptohunt</option>
<option value="SearchIt" id="backend">SearchIt</option>
<option value="Webathon" id="fullstack">Webathon</option>
<option value="AppDev" id="android">AppDev</option>
<option value="Competitive Coding" id="ionic">Competitive Coding</option>
<option value="CTF" id="phonegap">CTF</option>
</optgroup></select>
<label for="job">Branch:</label>
<select name="job" id="branch" required>
<optgroup label="Select">
<option value="ISE" id="frontend">ISE</option>
<option value="CSE" id="backend">CSE</option>
<option value="Mechanical" id="fullstack">Mechanical</option>
<option value="CIVIL" id="android">CIVIL</option>
<option value="EEE" id="ionic">EEE</option>
<option value="MBA" id="phonegap">MBA</option>
</optgroup>
</select>
<br /><br /> -->
<!-- <label>Semester:</label>
<select id="sem" required>
<option value="1">1</option>
<option value="3">3</option>
<option value="5">5</option>
<option value="7">7</option>
</select> -->
<button class="w3-button w3-green w3-large "type="submit" sendMessage()>Register</button>
</form>
</fieldset>
</form></button></button></p></div></form></div></div>
<footer class="w3-center w3-black w3-padding-64">
<div class="w3-xlarge w3-section">
<a href="https://www.facebook.com/reetik.chitragupt" class="fa fa-facebook-official w3-hover-opacity w3-black"></i></a>
<a href="https://www.instagram.com/reetik_chitragupt/" class="fa fa-instagram w3-hover-opacity w3-black"></i></a>
<a href="https://github.com/Reetikgit/Reetikgit.github.io" class="fa fa-github w3-hover-opacity w3-black"></i></a>
<a href="https://twitter.com/RChitragupt"class="fa fa-twitter w3-hover-opacity w3-black"></i></a>
<a href="https://www.linkedin.com/in/reetik-chitragupt-2316a9182/" class="fa fa-linkedin w3-hover-opacity"></i></a>
<i class="fa fa-envelope w3-hover-opacity w3-black">reetikchitragupt@gmail.com</i>
</div>
<i class="fa fa-phone w3-hover-opacity w3-black">7355670645</i>
<h4 class="footer">Developed & DESIGNED by </h3><h4>Reetik Chitragupt(5th Sem ISE)</h4><a href="" title="W3.CSS" target="_blank" class="w3-hover-text-green"></a></p></h4>
<h4 class="footer">SAI VIDYA INSTITUTE OF TECHNOLOGY</h4>
</footer> </body>
<script src="https://www.gstatic.com/firebasejs/5.10.0/firebase.js"></script>
<script type="text/javascript">
var firebaseConfig = {
apiKey: "AIzaSyB_5vqcnQ7sD2AsHeBRl2QB6GifZmp8jGM",
authDomain: "contactform-673b7.firebaseapp.com",
databaseURL: "https://contactform-673b7.firebaseio.com",
projectId: "contactform-673b7",
storageBucket: "",
messagingSenderId: "172917494368",
appId: "1:172917494368:web:1cc301177c4f4fd6a46905",
measurementId: "G-N5BDJDDC63"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
//Reference for form collection(3)
// let formMessage = firebase.database().ref('register');
let formMessage2 = firebase.database().ref('Signup');
document
.getElementById('registrationform')
.addEventListener('submit', formSubmit);
//Submit form(1.2)
database=firebase.database();
var ref=database.ref('Signup');
// var keys;
ref.on('value',gotData,errData);
var initials;
var count;
var match=0,usnD,sc;
var keys;
function gotData(data)
{
sc=data.val();
keys=Object.keys(sc);
}
function errData(err)
{
console.log('error');
console.log(err);
}
function formSubmit(e)
{
e.preventDefault();
// Get Values from the DOM
let name = document.querySelector('#name').value;
var usn = document.querySelector('#usn').value;
let email = document.querySelector('#email').value;
// let Event = document.querySelector('#Event').value;
let phn = document.querySelector('#phn').value;
var pass = document.querySelector('#pass').value;
var Confirmpass = document.querySelector('#Confirmpass').value;
usnmatch=usn.toUpperCase();
/*Fetching the elements from each object*/
for(var i=0;i<keys.length;i++)
{
match=0;
var k=keys[i];
initials=sc[k].name;
var emails=sc[k].email;
usnD=sc[k].usn;
if(usnD==usnmatch)
{
match++;
keyss=0;
break;
}
}
//datadisplay.append(li);
var usnvalid="1va1";
if(match==0)
{
if(usn.includes("1va1")||usn.includes("1VA1")||usn.includes("1Va1")||usn.includes("1vA1"))
{
if(Confirmpass==pass)
{
sendMessage(name,usn.toUpperCase(),email,phn,pass);
alert("SignUp Successfull")
document.getElementById('registrationform').reset();
window.location = "Login.html"
}
else
{
alert("Password Mismatch");
}
}
else
{
alert("Please enter a valid USN")
}
}
else
{
alert("Usn already exsits")
}
}
//Show Alert Message(5)
//Send Message to Firebase(4)
function sendMessage(name, usn, email, phn,pass) {
let newFormMessage = formMessage2.push();
newFormMessage.set({
name: name,
usn: usn,
email: email,
ph:phn,
pass:pass
});
}
</script>
<!-- <script src="app.js"></script> -->
</body>
</html>