-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.html
190 lines (165 loc) · 9.17 KB
/
signup.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Membership</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--===============================================================================================-->
<link rel="icon" type="image/png" href="tracker/signin/images/icons/fbla_favicon.ico"/>
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="tracker/signin/vendor/bootstrap/css/bootstrap.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="tracker/signin/fonts/font-awesome-4.7.0/css/font-awesome.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="tracker/signin/fonts/iconic/css/material-design-iconic-font.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="tracker/signin/vendor/animate/animate.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="tracker/signin/vendor/css-hamburgers/hamburgers.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="tracker/signin/vendor/animsition/css/animsition.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="tracker/signin/vendor/select2/select2.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="tracker/signin/vendor/daterangepicker/daterangepicker.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="tracker/signin/css/util.css">
<link rel="stylesheet" type="text/css" href="tracker/signin/css/main.css">
<!--===============================================================================================-->
</head>
<body>
<div class="limiter">
<div class="container-login100" style="background-image: url('tracker/signin/images/bg-01.jpg');">
<div class="wrap-login100">
<!-- <form class="login100-form validate-form" action = "/signupform" method = "POST" id = "signUpFormObject"> -->
<span class="login100-form-logo">
<i class="zmdi zmdi-account-o"></i>
</span>
<span class="login100-form-title p-b-34 p-t-27">
SBFBLA Membership Tracker
</span>
<div class="wrap-input100 validate-input" data-validate = "Enter Name">
<input class="input100" type="text" id="name" placeholder="Name">
<span class="focus-input100" data-placeholder=""></span>
</div>
<div class="wrap-input100 validate-input" data-validate = "Enter Grade">
<input class="input100" type="number" id="grade" placeholder="Grade">
<span class="focus-input100" data-placeholder=""></span>
</div>
<div class="wrap-input100 validate-input" data-validate = "Enter ID Number">
<input class="input100" type="number" id="idnumber" placeholder="ID Number">
<span class="focus-input100" data-placeholder=""></span>
</div>
<div class="wrap-input100 validate-input" data-validate = "Enter Email Address">
<input class="input100" type="email" id="emailaddress" placeholder="School Email Address">
<span class="focus-input100" data-placeholder=""></span>
</div>
<div class="wrap-input100 validate-input" data-validate="Enter password">
<input class="input100" type="password" id="password" placeholder="Password">
<span class="focus-input100" data-placeholder=""></span>
</div>
<div class="contact100-form-checkbox">
<input class="input-checkbox100" id="ckb1" type="checkbox" name="remember-me">
<label class="label-checkbox100" for="ckb1">
Remember me
</label>
</div>
<div class="container-login100-form-btn">
<a >
<button class="login100-form-btn" id = "signupbutton" onclick="signUp()">
Sign Up
</button>
</a>
</div>
<div class="w-full text-center">
<a href="signin.html" class="txt1">
Already Have An Account? Sign In
</a>
</div>
<!-- </form> -->
</div>
</div>
</div>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/7.17.2/firebase-app.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/7.17.2/firebase-analytics.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.17.2/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.17.2/firebase-database.js"></script>
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyA4b4CbFFviZWCbc7NlIoS0snf85ip0iaQ",
authDomain: "fbla-membership-tracker.firebaseapp.com",
databaseURL: "https://fbla-membership-tracker.firebaseio.com",
projectId: "fbla-membership-tracker",
storageBucket: "fbla-membership-tracker.appspot.com",
messagingSenderId: "64250080468",
appId: "1:64250080468:web:8789ad51d5f91f599b1f41",
measurementId: "G-V6N9YLF1NK"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();
const auth = firebase.auth();
const database = firebase.database()
var emailField = document.getElementById("emailaddress")
var passwordField = document.getElementById("password")
var idField = document.getElementById("idnumber")
var gradeField = document.getElementById("grade")
var nameField = document.getElementById("name")
var signUpButton = document.getElementById("signupbutton")
function signUp(){
var created = true
var email = emailField.value
var password = passwordField.value
var id = idField.value
var grade = gradeField.value
var name = nameField.value
if(id == "" || email == "" || grade == "" || password == "" || name == "" ){
alert("Please Fill Out All Fields!")
}
else if(email.slice(8,email.length) != "@sbstudents.org"){
alert("Please use your sbstudents email")
}
else if(email.slice(0,8) != id){
alert("Please use id number which corresponds to your email")
}
else{
var promise = auth.createUserWithEmailAndPassword(email,password)
promise.then(function(result){
var encoded = window.btoa(id)
database.ref().child('/2020-21/' + id).update({
'Name': name,
'Grade': grade,
'Email': email,
})
window.location.replace("tracker/tracker.html?id="+encoded);
})
.catch( function(e) {
alert(e.message)
created = false
})
}
}
</script>
<div id="dropDownSelect1"></div>
<!--===============================================================================================-->
<script src="tracker/signin/vendor/jquery/jquery-3.2.1.min.js"></script>
<!--===============================================================================================-->
<script src="tracker/signin/vendor/animsition/js/animsition.min.js"></script>
<!--===============================================================================================-->
<script src="tracker/signin/vendor/bootstrap/js/popper.js"></script>
<script src="tracker/signin/vendor/bootstrap/js/bootstrap.min.js"></script>
<!--===============================================================================================-->
<script src="tracker/signin/vendor/select2/select2.min.js"></script>
<!--===============================================================================================-->
<script src="tracker/signin/vendor/daterangepicker/moment.min.js"></script>
<script src="tracker/signin/vendor/daterangepicker/daterangepicker.js"></script>
<!--===============================================================================================-->
<script src="tracker/signin/vendor/countdowntime/countdowntime.js"></script>
<!--===============================================================================================-->
<script src="tracker/signin/js/main.js"></script>
</body>
</html>