-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregistration.html
289 lines (247 loc) · 10.3 KB
/
registration.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=UA-162398295-4"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-162398295-4');
</script>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="keywords"
content="MindShout, IEEE Student Branch DAIICT, DAIICT, Hackathon"
/>
<meta name="title" content="MindShout" />
<meta name="description" content="MindShout, IEEE SB DAIICT" />
<meta name="author" href="" content="Meet Patel, Adit Shah" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://ieee.daiict.ac.in" />
<meta property="og:site_name" content="MindShout" />
<meta property="og:title" content="MindShout" />
<meta property="og:description" content="MindShout, IEEE SB DAIICT" />
<meta property="og:image" content="./img/MindShoutLogo.png" />
<link rel="shortcut icon" href="./img/MindShoutLogo.ico" />
<!-- Favicon -->
<link rel="icon" href="./img/mindshout/MindShoutLogo.ico" />
<!-- CSS files-->
<link rel="stylesheet" href="css/registration/style.css">
<link rel="stylesheet" href="https://cdn.linearicons.com/free/1.0.0/icon-font.min.css">
<title>MindShout</title>
</head>
<body>
<div class="wrapper">
<div class="inner">
<img src="img/mindshout/image-1.png" alt="" class="image-1">
<form class="registration-form">
<h3 style="font-family:Arial, Helvetica, sans-serif;font-size: 5vh;text-transform: none;">MindShout 1.0</h3>
<div class="form-holder">
<span class="lnr lnr-user"></span>
<input type="text" class="form-control" id="inputName" placeholder="Name" required>
</div>
<div class="form-holder">
<span class="lnr lnr-phone-handset"></span>
<input type="text" class="form-control" id="inputPhone" placeholder="Phone Number" required>
</div>
<div class="form-holder">
<span class="lnr lnr-envelope"></span>
<input type="email" class="form-control" id="inputEmail" placeholder="E-mail Id" required>
</div>
<div class="form-holder">
<span class="lnr lnr-pencil"></span>
<input type="text" class="form-control" id="inputSchool" placeholder="School" required>
</div>
<div class="form-holder">
<span class="lnr lnr-calendar-full"></span>
<input type="text" class="form-control" id="inputdob" placeholder="Birth-date (DD/MM/YYYY)" required>
</div>
<div class="form-holder">
<span class="lnr lnr-database"></span>
<select class="form-control" id="inputStd" style="width: fit-content;" required>
<option value="default">Standard</option>
<option value="8th">8th</option>
<option value="9th">9th</option>
<option value="10th">10th</option>
<option value="11th">11th</option>
<option value="12th">12th</option>
</select>
</div>
<div class="form-holder">
<span class="lnr lnr-home"></span>
<input type="text" class="form-control" id="inputCity" placeholder="City" required>
</div>
<div class="form-holder">
<span class="lnr lnr-map-marker"></span>
<input type="text" class="form-control" id="inputState" placeholder="State" required>
</div>
<div class="form-holder">
<span class="lnr lnr-location"></span>
<input type="text" class="form-control" id="inputCountry" placeholder="Country" required>
</div>
<div class="form-holder">
<!--<span class="lnr lnr-lock"></span>-->
<div class="form-group row" id="upload-label">
<label>Please attach scanned photo of your school id:<br>(that contains your photograph, standard and name) <span class="glyphicon glyphicon-fire"></span></label>
<br><br><input type="file" onchange="previewFile()" id="files" name="files[]" multiple required />
<br><br><strong>Note: </strong>If you don't have school ID card with you, you may upload your result sheet or any other government approved photo ID like Aadhar card.<br>
</div>
</div>
<div class="text-center">
<a href="./index.html"><button type="submit" class="btn btn-primary" id="register"> Register </button></a>
</div>
</form>
<img src="img/mindshout/image-2.png" alt="" class="image-2">
</div>
</div>
<!--Registration form Ends-->
<!-- ******* All JS Files ******* -->
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/8.1.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.1.1/firebase-database.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.1.1/firebase-storage.js"></script>
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#available-libraries -->
<script src="https://www.gstatic.com/firebasejs/8.1.1/firebase-analytics.js"></script>
<script>
'use strict';
//grab a form
const form = document.querySelector('.registration-form');
//grab inputs
class FormFields
{
FormFields(){
var inputName;
var inputPhone;
var inputEmail;
var inputSchool;
var inputdob;
var inputStd;
var inputCity;
var inputState;
var inputCountry;
var ImageUrl="";
}
}
let input = new FormFields();
input.inputName = form.querySelector('#inputName');
input.inputPhone = form.querySelector('#inputPhone');
input.inputEmail = form.querySelector('#inputEmail');
input.inputSchool = form.querySelector('#inputSchool');
input.inputdob = form.querySelector('#inputdob');
//collecting inputStd from the selection list
(function() {
// get references to select list and display text box
var sel = document.getElementById('inputStd');
function getSelectedOption(sel) {
var opt;
for ( var i = 0, len = sel.options.length; i < len; i++ ) {
opt = sel.options[i];
if ( opt.selected === true ) {
break;
}
}
return opt;
}
document.getElementById('register').onclick = function () {
// access text property of selected option
input.inputStd = sel.options[sel.selectedIndex].text;
}
}());
input.inputCity = form.querySelector('#inputCity');
input.inputState = form.querySelector('#inputState');
input.inputCountry = form.querySelector('#inputCountry');
//config your firebase push
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
var firebaseConfig = {
apiKey: "AIzaSyDouyIe-PtsGL91CI0mPmyABCWdOmOepVg",
authDomain: "mindshout-e05d0.firebaseapp.com",
databaseURL: "https://mindshout-e05d0.firebaseio.com",
projectId: "mindshout-e05d0",
storageBucket: "mindshout-e05d0.appspot.com",
messagingSenderId: "477776116012",
appId: "1:477776116012:web:469b08e934895bfabd5489",
measurementId: "G-6K6MPENPZV"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();
//function to save file
function previewFile(){
var storage = firebase.storage();
var file = document.getElementById("files").files[0];
console.log(file);
var storageRef = firebase.storage().ref();
//dynamically set reference to the file name
var thisRef = storageRef.child(file.name);
//put request upload file to firebase storage
thisRef.put(file).then(function(snapshot) {
console.log('Uploaded a blob or file!');
}).then(function(){
thisRef.getDownloadURL().then(function(downloadURL) {
console.log(downloadURL);
input.ImageUrl=downloadURL;
});
});
}
//create a functions to push
function firebasePush(input) {
//push itself
var mailsRef = firebase.database().ref('Participants').push().set(
{
Name: input.inputName.value,
Mobile: input.inputPhone.value,
Email: input.inputEmail.value,
School_Name: input.inputSchool.value,
Birthdate: input.inputdob.value,
Standard: input.inputStd,
City: input.inputCity.value,
State: input.inputState.value,
Country: input.inputCountry.value,
id_card: input.ImageUrl
}
);
}
//push on form submit
if (form) {
form.addEventListener('submit', function (evt) {
evt.preventDefault();
firebasePush(input);
//shows alert if everything went well.
alert('You have been registered successfully');
//redirect to main page after 3 seconds
setTimeout(function(){
window.location.href = './index.html';
}, 3000);
})
}
</script>
<!-- jQuery js -->
<script src="./js/jquery.min.js"></script>
<!-- Popper js -->
<script src="./js/popper.min.js"></script>
<!-- Bootstrap js -->
<script src="./js/bootstrap.min.js"></script>
<!-- All js -->
<script src="./js/uza.bundle.js"></script>
<!-- Active js -->
<script src="./js/default-assets/active.js"></script>
<!-- Active Section NavMenu Highlight -->
<script src="https://unpkg.com/[email protected]/dist/active-menu-link.js"></script>
<script>
let options = {
itemTag: 'li',
activeClass: 'current-item',
headerHeight: 100,
};
new ActiveMenuLink('.classynav', options);
</script>
</body>