-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddAuth.html
245 lines (162 loc) · 7.89 KB
/
addAuth.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
<html>
<!-- saved from url=(0054)https://bootstrapious.com/tutorial/sidebar/index5.html -->
<!-- Bootstrap core CSS -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Add auth and Profile teacher</title>
<!-- Bootstrap CSS CDN -->
<!-- Our Custom CSS -->
<!-- Font Awesome JS -->
<script defer="" src="solid.js.download" integrity="sha384-tzzSw1/Vo+0N5UhStP3bvwWPq+uvzCMfrN1fEFe+xBmv1C/AtVX5K0uZtmcHitFZ" crossorigin="anonymous"></script>
<script defer="" src="fontawesome.js.download" integrity="sha384-6OIrr52G08NpOFSZdxxz1xdNSndlD4vdcf/q2myIUVO0VsqaGHJsB0RaBE01VTOY" crossorigin="anonymous"></script>
<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://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<script defer="" src="solid.js.download" integrity="sha384-tzzSw1/Vo+0N5UhStP3bvwWPq+uvzCMfrN1fEFe+xBmv1C/AtVX5K0uZtmcHitFZ" crossorigin="anonymous"></script>
<script defer="" src="fontawesome.js.download" integrity="sha384-6OIrr52G08NpOFSZdxxz1xdNSndlD4vdcf/q2myIUVO0VsqaGHJsB0RaBE01VTOY" crossorigin="anonymous"></script>
<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://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#available-libraries -->
<link href="Dashbord.css" rel="stylesheet">
<link rel="stylesheet" href="bootstrap.min.css">
<script src="popper.min.js"></script>
<link href="bootstrap.min.css" rel="stylesheet">
<link href="floating-labels.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap" rel="stylesheet">
</head>
<style>
.content{
background: #fff;
max-width: 960px;
margin: 30px auto;
padding: 20px 55px;
border-radius: 10px 10px 10px 10px;
box-shadow: 1px 3px 5px rgba(0,0,0,0.4)
}
</style>
<body>
<div class="wrapper">
<!-- Sidebar Holder -->
<nav style="background-color:#9A12B3; position: fixed; height: 1080px; top:0px;" id="sidebar" class="">
<div style="background-color: #9A12B3; margin-top:0px;" class="sidebar-header ">
<img src="logo.png" width="60px" style="margin-left: -15px; margin-top: -14px; position: fixed;" alt="logo" />
<h3 style="margin-left: 60px;">AXILEARN </h3>
</div>
<ul class="list-unstyled components">
<p></p>
<li >
<a style="color: white;" href="DASHBROD.html"><i class="fa fa-home"></i> Home</a>
</li>
<li>
<a style="color: white;" href="AboutX.html"><i class="fa fa-users" aria-hidden="true"></i> About</a>
</li>
<li>
<a style="color: white;" href="NetWorkReport.html"><i class="fa fa-rss-square" aria-hidden="true"></i> Network report</a>
</li>
<li>
<a style="color: white;" href="ContactX.html"><i class="fa fa-phone-square" aria-hidden="true"></i> Contact</a>
</li>
</ul>
<ul class="list-unstyled CTAs">
<li>
<a style="color: black;" href="index.html" class="download">Sign out</a>
</li>
</ul>
</nav>
<!-- Page Content Holder -->
<div id="content" style="background-color: #DADFE1;">
<div style="margin-left: 600px; top: 100px; position: fixed;" >
<form class="form-signin" id="signup-form">
<div class="text-center mb-4">
<h1 style="color: black !important;" class="h3 mb-3 font-weight-normal">Add new member</h1>
<p style="color: black;">Here you can Add new member to access the app.</p></div>
<div class="form-label-group">
<input type="text" id="username" class="form-control" required="" >
<label for="inputName">Enter Name</label>
</div>
<div class="form-label-group">
<input type="text" id="inputEmail" class="form-control" required="" >
<label for="inputEmail">Enter Email</label>
</div>
<div class="form-label-group">
<input type="password" id="inputPassword" class="form-control" required="" >
<label for="inputName">Password</label>
</div>
<button class="btn btn-lg btn-primary btn-block" id="createBtn">Create Profile</button>
</div>
</div>
</div>
<script src="https://www.gstatic.com/firebasejs/7.15.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.15.0/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.15.0/firebase-firestore.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.15.0/firebase-database.js"></script>
<!-- jQuery CDN - Slim version (=without AJAX) -->
<script src="jquery-3.3.1.slim.min.js.download" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<!-- Popper.JS -->
<script src="popper.min.js.download" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
<!-- Bootstrap JS -->
<script src="bootstrap.min.js.download" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#sidebarCollapse').on('click', function () {
$('#sidebar').toggleClass('active');
$(this).toggleClass('active');
});
});
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyD6xHZL-JydpDai1TiwJGALEmb7BcZh-fc",
authDomain: "axilearnv1.firebaseapp.com",
databaseURL: "https://axilearnv1.firebaseio.com",
projectId: "axilearnv1",
storageBucket: "axilearnv1.appspot.com",
messagingSenderId: "102666534508",
appId: "1:102666534508:web:0f4e8eed826ad98b48a249"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
const auth = firebase.auth();
const db = firebase.firestore();
var database = firebase.database();
const rootRef = database.ref('profiles');
if(username==""){
}
else if(inputEmail=="")
{
}
else if(inputPassword==""){
}
else{
createBtn.addEventListener('click',e =>{
e.preventDefault();
// get user info
const email = document.getElementById('inputEmail').value;
const password =document.getElementById('inputPassword').value;
// sign up the user
auth.createUserWithEmailAndPassword(email, password).then(cred => {
rootRef.child(cred.user.uid).set({
id:cred.user.uid,
likesCount: 0,
onlineStatus: "online",
photoUrl: "axilearnv1.appspot.com/images/logo.png",
searchIndex: document.getElementById('username').value,
typingTo:"noOne",
username: document.getElementById('username').value,
})
.then(() =>{
window.alert('Database will update so soon.');
username.value = '';
inputPassword.value = '';
inputEmail.value = '';
})
.catch(error => {
console.error(error);
});
});
})
}
</script>
</script>
</body>
</html>