-
Notifications
You must be signed in to change notification settings - Fork 0
/
studentprofile.html
412 lines (388 loc) · 29.1 KB
/
studentprofile.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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title>Profile - OEP</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.5.11/cropper.min.js" integrity="sha512-FHa4dxvEkSR0LOFH/iFH0iSqlYHf/iTwLc5Ws/1Su1W90X0qnxFxciJimoue/zyOA/+Qz/XQmmKqjbubAAzpkA==" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.5.11/cropper.css" integrity="sha512-jO9KUHlvIF4MH/OTiio0aaueQrD38zlvFde9JoEA+AQaCNxIJoX4Kjse3sO2kqly84wc6aCtdm9BIUpYdvFYoA==" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.5.11/cropper.js" integrity="sha512-1bpfZkKJ+WlmJN/I2KLm79dSiuOos0ymwL5IovsUVARyzcaf9rSXsVO2Cdg4qlKNOQXh8fd1d0vKeY9Ru3bQDw==" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.5.11/cropper.min.css" integrity="sha512-NCJ1O5tCMq4DK670CblvRiob3bb5PAxJ7MALAz2cV40T9RgNMrJSAwJKy0oz20Wu7TDn9Z2WnveirOeHmpaIlA==" crossorigin="anonymous" />
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i">
<link rel="stylesheet" href="assets/fonts/fontawesome-all.min.css">
<link rel="stylesheet" href="assets/fonts/font-awesome.min.css">
<link rel="stylesheet" href="assets/fonts/fontawesome5-overrides.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
<script src="https://www.gstatic.com/firebasejs/8.2.1/firebase.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.2.1/firebase-analytics.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.2.1/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.2.1/firebase-database.js"></script>
<style type="text/css">
img {
max-width: 100%;
}
.preview {
overflow: hidden;
width: 160px;
height: 160px;
margin: 10px;
border: 1px solid red;
}
</style>
</head>
<body id="page-top" onload="getuserdata(),retrs()">
<div id="wrapper">
<nav class="navbar navbar-dark align-items-start sidebar sidebar-dark accordion bg-gradient-primary p-0">
<div class="container-fluid d-flex flex-column p-0">
<a class="navbar-brand d-flex justify-content-center align-items-center sidebar-brand m-0" href="#">
<div class="sidebar-brand-icon rotate-n-15" onclick="callhome1()"><i class="fas fa-laugh-wink"></i></div>
<div class="sidebar-brand-text mx-3" onclick="callhome1()"><span>OEP</span></div>
</a>
<hr class="sidebar-divider my-0">
<ul class="nav navbar-nav text-light" id="accordionSidebar">
<li class="nav-item"><a class="nav-link active" href="studentindex.html"><i class="fas fa-tachometer-alt"></i><span>Dashboard</span></a></li>
<li class="nav-item"><a class="nav-link" href="studentprofile.html"><i class="fas fa-user"></i><span>Profile</span></a></li>
<li class="nav-item"><a class="nav-link" href="viewexam.html"><i class="fas fa-book"></i><span>Exam</span></a></li>
<li class="nav-item"><a class="nav-link" href=""><i class="fas fa-circle"></i><span>Performance</span></a></li>
<li class="nav-item"><a class="nav-link" href="result.html"><i class="fas fa-square"></i><span>Result</span></a></li>
<!-- <li class="nav-item"><a class="nav-link" href="table.html"><i class="fas fa-table"></i><span>Table</span></a></li> -->
<!-- <li class="nav-item"><a class="nav-link" href="login.html"><i class="far fa-user-circle"></i><span>Login</span></a></li>
<li class="nav-item"><a class="nav-link" href="register.html"><i class="fas fa-user-circle"></i><span>Register</span></a></li> -->
</ul>
<div class="text-center d-none d-md-inline"><button class="btn rounded-circle border-0" id="sidebarToggle" type="button"></button></div>
</div>
</nav>
<div class="d-flex flex-column" id="content-wrapper">
<div id="content">
<nav class="navbar navbar-light navbar-expand bg-white shadow mb-4 topbar static-top">
<div class="container-fluid"><button class="btn btn-link d-md-none rounded-circle mr-3" id="sidebarToggleTop" type="button"><i class="fas fa-bars"></i></button>
<ul class="nav navbar-nav flex-nowrap ml-auto">
<li class="nav-item dropdown d-sm-none no-arrow"><a class="dropdown-toggle nav-link" data-toggle="dropdown" aria-expanded="false" href="#"><i class="fas fa-search"></i></a>
<div class="dropdown-menu dropdown-menu-right p-3 animated--grow-in" aria-labelledby="searchDropdown">
</div>
</li>
<li class="nav-item dropdown no-arrow mx-1">
<div class="nav-item dropdown no-arrow"><a class="dropdown-toggle nav-link" data-toggle="dropdown" aria-expanded="false" href="#"><span class="badge badge-danger badge-counter">3+</span><i class="fas fa-bell fa-fw"></i></a>
<div class="dropdown-menu dropdown-menu-right dropdown-list dropdown-menu-right animated--grow-in">
<h6 class="dropdown-header">alerts center</h6>
<a class="d-flex align-items-center dropdown-item" href="#">
<div class="mr-3">
<div class="bg-primary icon-circle"><i class="fas fa-file-alt text-white"></i></div>
</div>
<div><span class="small text-gray-500">December 12, 2019</span>
<p>A new monthly report is ready to download!</p>
</div>
</a>
<a class="d-flex align-items-center dropdown-item" href="#">
<div class="mr-3">
<div class="bg-success icon-circle"><i class="fas fa-donate text-white"></i></div>
</div>
<div><span class="small text-gray-500">December 7, 2019</span>
<p>$290.29 has been deposited into your account!</p>
</div>
</a>
<a class="d-flex align-items-center dropdown-item" href="#">
<div class="mr-3">
<div class="bg-warning icon-circle"><i class="fas fa-exclamation-triangle text-white"></i></div>
</div>
<div><span class="small text-gray-500">December 2, 2019</span>
<p>Spending Alert: We've noticed unusually high spending for your account.</p>
</div>
</a><a class="text-center dropdown-item small text-gray-500" href="#">Show All Alerts</a>
</div>
</div>
</li>
<li class="nav-item dropdown no-arrow mx-1">
<div class="nav-item dropdown no-arrow"><a class="dropdown-toggle nav-link" data-toggle="dropdown" aria-expanded="false" href="#"><i class="fas fa-envelope fa-fw"></i><span class="badge badge-danger badge-counter">7</span></a>
<div class="dropdown-menu dropdown-menu-right dropdown-list dropdown-menu-right animated--grow-in">
<h6 class="dropdown-header">alerts center</h6>
<a class="d-flex align-items-center dropdown-item" href="#">
<div class="dropdown-list-image mr-3"><img class="rounded-circle" src="assets/img/avatars/avatar4.jpeg">
<div class="bg-success status-indicator"></div>
</div>
<div class="font-weight-bold">
<div class="text-truncate"><span>Hi there! I am wondering if you can help me with a problem I've been having.</span></div>
<p class="small text-gray-500 mb-0">Emily Fowler - 58m</p>
</div>
</a>
<a class="d-flex align-items-center dropdown-item" href="#">
<div class="dropdown-list-image mr-3"><img class="rounded-circle" src="assets/img/avatars/avatar2.jpeg">
<div class="status-indicator"></div>
</div>
<div class="font-weight-bold">
<div class="text-truncate"><span>I have the photos that you ordered last month!</span></div>
<p class="small text-gray-500 mb-0">Jae Chun - 1d</p>
</div>
</a>
<a class="d-flex align-items-center dropdown-item" href="#">
<div class="dropdown-list-image mr-3"><img class="rounded-circle" src="assets/img/avatars/avatar3.jpeg">
<div class="bg-warning status-indicator"></div>
</div>
<div class="font-weight-bold">
<div class="text-truncate"><span>Last month's report looks great, I am very happy with the progress so far, keep up the good work!</span></div>
<p class="small text-gray-500 mb-0">Morgan Alvarez - 2d</p>
</div>
</a>
<a class="d-flex align-items-center dropdown-item" href="#">
<div class="dropdown-list-image mr-3"><img class="rounded-circle" src="assets/img/avatars/avatar5.jpeg">
<div class="bg-success status-indicator"></div>
</div>
<div class="font-weight-bold">
<div class="text-truncate"><span>Am I a good boy? The reason I ask is because someone told me that people say this to all dogs, even if they aren't good...</span></div>
<p class="small text-gray-500 mb-0">Chicken the Dog · 2w</p>
</div>
</a><a class="text-center dropdown-item small text-gray-500" href="#">Show All Alerts</a>
</div>
</div>
<div class="shadow dropdown-list dropdown-menu dropdown-menu-right" aria-labelledby="alertsDropdown"></div>
</li>
<div class="d-none d-sm-block topbar-divider"></div>
<li class="nav-item dropdown no-arrow">
<div class="nav-item dropdown no-arrow"><a class="dropdown-toggle nav-link" data-toggle="dropdown" aria-expanded="false" href="#"><span class="d-none d-lg-inline mr-2 text-gray-600 small" id="username">@username</span><img class="border rounded-circle img-profile" id="dp" src="assets/img/avatars/avatar1.jpeg" id="dp"></a>
<div class="dropdown-menu shadow dropdown-menu-right animated--grow-in">
<a class="dropdown-item" href="profile.html"><i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i> Profile</a>
<div class="dropdown-divider"></div><a class="dropdown-item" href="#" onclick="logout()"><i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i> Logout</a>
</div>
</div>
</li>
</ul>
</div>
</nav>
<div class="container-fluid">
<h3 class="text-dark mb-4">Profile</h3>
<div class="row mb-3">
<div class="col-lg-4" style="height: 306px;">
<div class="card mb-3">
<div class="card-body text-center shadow">
<img class="rounded-circle mb-3 mt-4" src="assets/img/avatars/avatar1.jpeg" width="160" height="160" id="img">
<div class="mb-3">
<input type="file" hidden name="image" class="image" id="uploadpic">
<!-- <input type="file" hidden onchange='chooseFile(event)' accept="image/*" id="uploadpic" /> -->
<label for="uploadpic" class="btn btn-primary btn-sm">Change Photo</label>
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalLabel">Crop image</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="img-container">
<div class="row">
<div class="col-md-8">
<!-- default image where we will set the src via jquery-->
<img id="image">
</div>
<div class="col-md-4">
<div class="preview"></div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" id="crop">Crop</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-8">
<div class="row mb-3 d-none">
<div class="col">
<div class="card text-white bg-primary shadow">
<div class="card-body">
<div class="row mb-2">
<div class="col">
<p class="m-0">Peformance</p>
<p class="m-0"><strong>65.2%</strong></p>
</div>
<div class="col-auto"><i class="fas fa-rocket fa-2x"></i></div>
</div>
<p class="text-white-50 small m-0"><i class="fas fa-arrow-up"></i> 5% since last month</p>
</div>
</div>
</div>
<div class="col">
<div class="card text-white bg-success shadow">
<div class="card-body">
<div class="row mb-2">
<div class="col">
<p class="m-0">Peformance</p>
<p class="m-0"><strong>65.2%</strong></p>
</div>
<div class="col-auto"><i class="fas fa-rocket fa-2x"></i></div>
</div>
<p class="text-white-50 small m-0"><i class="fas fa-arrow-up"></i> 5% since last month</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="card shadow mb-3">
<div class="card-header py-3">
<p class="text-primary m-0 font-weight-bold">User Settings</p>
</div>
<div class="card-body">
<div class="form-row">
<div class="col">
<div class="form-group"><label for="username"><strong>Display Name</strong></label><input id="pname" class="form-control" type="text" name="username"></div>
</div>
<div class="col">
<div class="form-group"><label for="email"><strong>Email Address</strong></label><input id="pemail" class="form-control" type="email" name="email"></div>
</div>
</div>
<div class="form-row">
<div class="col">
<div class="form-group"><label for="first_name"><strong>First Name</strong></label><input id="pfname" class="form-control" type="text" name="fname"></div>
<div class="form-group"><label for="last_name"><strong>Last Name</strong><br></label><input id="plname" class="form-control" type="text" name="lname"></div>
<div class="form-group"><label for="instname"><strong>Institute</strong><br></label><input id="pinst" class="form-control" type="text" name="inst" readonly></div>
</div>
<div class="col">
<div class="form-group"><label for="middle_name"><strong>Middle Name</strong></label><input id="pmname" class="form-control" type="text" s name="mname"></div>
<div class="form-group"><label for="enrollment"><strong>Enrollment Number</strong><br></label><input id="penroll" class="form-control" type="tel" name="no" readonly></div>
<div class="form-group"><label for="enrollment"><strong>Class Name</strong><br></label><input id="penClass" class="form-control" type="tel" name="no" readonly></div>
</div>
</div>
<div class="form-group"><button class="btn btn-primary btn-sm" onclick="updatepdatas()">Save Settings</button></div>
</div>
</div>
<div class="card shadow">
<div class="card-body">
<div class="form-group"><label for="address"><strong>Old Password</strong></label><input class="form-control" id="poldpass" type="password" placeholder="" name="pass"></div>
<div class="form-row">
<div class="col">
<div class="form-group"><label for="city"><strong>New Password</strong></label><input class="form-control" id="pnewpass" type="password" placeholder="" name="npass"></div>
</div>
<div class="col">
<div class="form-group"><label for="country"><strong>Confirm Password</strong></label><input class="form-control" id="pcnewpass" type="password" placeholder="" name="cnpass"></div>
</div>
</div>
<div class="form-group"><button class="btn btn-primary btn-sm" onclick="changepass()">Change Password</button></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="bg-white sticky-footer">
<div class="container my-auto">
<div class="text-center my-auto copyright"><span>Copyright © OEP 2021</span><br><br>
<span><a href="ContactFrom_v10\Contactus.html"target="_blank">Contact Us</a></span> 
<span><a href="Aboutus.html" target="_blank">About Us</a></span>
</div>
</div>
</footer>
</div><a class="border rounded d-inline scroll-to-top" href="#page-top"><i class="fas fa-angle-up"></i></a>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/chart.min.js"></script>
<script src="assets/js/bs-init.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.js"></script>
<script src="assets/js/theme.js"></script>
<script src="firebase.js"></script>
<script src="main.js"></script>
<script>
var bs_modal = $('#modal');
var image = document.getElementById('image');
var cropper, reader, file;
$("body").on("change", ".image", function(e) {
var files = e.target.files;
var done = function(url) {
image.src = url;
bs_modal.modal('show');
};
if (files && files.length > 0) {
file = files[0];
if (URL) {
done(URL.createObjectURL(file));
} else if (FileReader) {
reader = new FileReader();
reader.onload = function(e) {
done(reader.result);
};
reader.readAsDataURL(file);
}
}
});
bs_modal.on('shown.bs.modal', function() {
cropper = new Cropper(image, {
aspectRatio: 1,
viewMode: 3,
preview: '.preview'
});
}).on('hidden.bs.modal', function() {
cropper.destroy();
cropper = null;
});
$("#crop").click(function() {
canvas = cropper.getCroppedCanvas({
width: 150,
height: 150,
});
canvas.toBlob(function(blob) {
url = URL.createObjectURL(blob);
var reader = new FileReader();
reader.readAsDataURL(blob);
reader.onloadend = function() {
var base64data = reader.result;
firebase.auth().onAuthStateChanged((user) =>
{
if (user)
{
var uid = firebase.auth().currentUser;
if (user != null) {
var uid = user.uid;
var name = user.displayName;
var useremail1 = user.email;
var instname;
console.log(useremail1);
console.log(uid);
setTimeout(() =>
{
firebase.storage().ref('users/' + uid + '/profile.jpg').put(blob).then(function()
{
console.log("Successfully Uploaded.")
}).catch(Error =>
{
console.log(Error.message);
})
firebase.storage().ref('users/' + uid + '/profile.jpg').getDownloadURL().then(imgURL =>
{
user.updateProfile
({
photoURL: imgURL
}).then(function()
{
// Update successful.
document.location.reload();
}).catch(function(error)
{
// An error happened.
});
})
}, 500);
}
} else {
window.location.href = "login.html";
}
});
};
});
});
</script>
</body>
</html>