-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmy-account.html
More file actions
415 lines (391 loc) · 15.4 KB
/
my-account.html
File metadata and controls
415 lines (391 loc) · 15.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
<!DOCTYPE html>
<html lang="en">
<head>
<script src="/js/auth.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-163674715-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-163674715-1');
</script>
<!-- Required meta tags -->
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<meta content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" name="viewport" />
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous" />
<link rel="stylesheet" href="./css/style.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css"
integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<title>College Shala</title>
<link rel="icon" href="./assets/images/collegeshala-logo-svg.svg" />
</head>
<body onload="fetchstudentdata()">
<nav class="navbar custom-nav navbar-expand-lg navbar-light bg-custom-blur">
<a class="navbar-brand" href="/">
<img src="./assets/images/logo.png" id="logo" alt="" />
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText"
aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarText">
<ul class="navbar-nav mx-auto">
<li class="nav-item">
<p class="nav-seach-box">
<input type="text" id="search-input" placeholder="Search your subject here " />
</p>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link navbar-talkshala" href="/coming-soon.html">
TalkShala
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/cart.html">
<i class="fa fa-shopping-cart" aria-hidden="true"></i>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/my-account.html">
<i class="fa fa-user-circle" aria-hidden="true"></i>
</a>
</li>
</ul>
</div>
</nav>
<div class="container pt-4">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Home</a></li>
<li class="breadcrumb-item"><a href="#">Student's Name</a></li>
<li class="breadcrumb-item active" aria-current="page">My Account</li>
</ol>
</nav>
</div>
<div class="container student-dash-nav">
<div class="row">
<div class="col-sm text-center">
<a href="./my-account.html">My Account</a>
</div>
<div class="col-sm text-center">
<a href="./student-dashboard.html">My Materials</a>
</div>
<div class="col-sm text-center">
<a href="./my-transaction.html">My Transactions</a>
</div>
<div class="col-sm text-center">
<a href="./coming-soon.html">Q/A Forum</a>
</div>
</div>
</div>
<div class="container student-account">
<div class="row">
<div class="col-12 col-md-8">
<div class="container m-5">
<a href="javascript:void(0)" onclick="goToURL(); return false;">Log Out</a>
</div>
<form action="#" method="post">
<div class="form-group">
<label for="fullname">Full Name</label>
<input type="text" class="form-control" id="fullname" aria-describedby="emailHelp"
placeholder="Enter Full Name" />
</div>
<div class="form-group">
<label for="email">Email address</label>
<input type="email" class="form-control" id="email" aria-describedby="emailHelp"
placeholder="Enter email" />
</div>
<div class="form-group">
<label for="college">College Name</label>
<input type="text" class="form-control" id="college" aria-describedby="emailHelp"
placeholder="College Name" />
</div>
<div class="form-group">
<label for="university">University</label>
<input type="text" class="form-control" id="university" aria-describedby="emailHelp"
placeholder="Degree Pursuing" />
</div>
<div class="form-group">
<label for="semester">Semester</label>
<select id="semester" class="form-control">
<option value="1">first</option>
<option value="2">Second</option>
<option value="3">Third</option>
<option value="4">Fourth</option>
<option value="5">Fifth</option>
<option value="6">Sixth</option>
</select>
</div>
<div class="form-group">
<label for="phoneNo">Phone Number</label>
<input type="number" class="form-control" id="phoneNo" aria-describedby="emailHelp"
placeholder="Phone Number" />
</div>
<div class="container pt-3">
<button type="submit" class="btn btn-primary update-btn">Update</button>
<button type="submit" class="btn btn-secondary">Discard Changes</button>
</div>
</form>
</div>
</div>
</div>
<!-- Site footer -->
<footer class="site-footer">
<div class="container">
<div class="row">
<div class="col-12 col-md-6">
<!--<h6>About the company</h6> -->
<a href="./about.html">
<h6 class="text-justify">
About Us
</h6>
</a>
<div class="row">
<div class="col-12 col-md-4">
<a target="_blank" href="./copyright.html">Copyright</a><br />
<a target="_blank" href="./disclaimer-warranties.html">Disclaimer Warranties</a><br />
<a target="_blank" href="./privacy-policy.html">Privacy Policy</a>
</div>
<div class="col-12 col-md-4">
<a target="_blank" href="./return-policy.html">Return Policy</a><br />
<a target="_blank" href="./professor-info.html">Course Advisors</a><br />
<a target="_blank" href="./terms-of-use.html">Terms of Use</a>
</div>
</div>
</div>
<!--
<div class="col-xs-6 col-md-3">
<h6>Important Links</h6>
<ul class="footer-links">
<li>
<a href="">lorem Ipsum</a>
</li>
<li>
<a href="">lorem Ipsum</a>
</li>
<li>
<a href="">lorem Ipsum</a>
</li>
<li>
<a href="http://scanfcode.com/category/java-programming-language/">Lorem Ispum</a>
</li>
</ul>
</div>
-->
<div class="col-xs-6 col-md-4">
<h6>Connect With Us</h6>
<ul class="footer-links">
<li>
<a target="_blank" href=""><img src="./assets/images/footer/twitter-icon.png" id="footer-social-icons"
alt="" srcset="" /></a>
<a target="_blank" href="mailto:collegeshala2020@gmail.com"><img
src="./assets/images/footer/gmailicon.png" id="footer-social-icons" alt="" srcset="" /></a>
<a target="_blank" href="https://www.facebook.com/CollegeShalareal/"><img
src="./assets/images/footer/facebook-icon.png" id="footer-social-icons" alt="" rcset="" /></a>
<a target="_blank" href="https://www.linkedin.com/company/collegeshala-edutech/"><img
src="./assets/images/footer/linkedin-icon.png" id="footer-social-icons" alt="" rcset="" /></a>
</li>
<li>
<a target="_blank"
href="https://www.google.com/maps/dir//offbeats+ccu/data=!4m6!4m5!1m1!4e2!1m2!1m1!1s0x3a02772f380eb913:0xbc0dddd2e9b59b53?sa=X&ved=2ahUKEwj14s2a3I_pAhUGwzgGHW2kAe0Q9RcwDXoECB0QDg">Office:
405, OFFBEAT CCU, 36/F, Topsia Rd, Topsia, Kolkata,
West Bengal 700039</a>
</li>
<li>
<a href="#">Call US: 8583994561, 9230429404</a>
</li>
</ul>
</div>
</div>
</div>
<div class="copyright-area">
<p class="text-center" id="footer-copyright-text">
<i class="far fa-copyright"></i> 2020 CollegeShala | All Rights
Reserved
</p>
</div>
</footer>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
crossorigin="anonymous"></script>
<script src="./js/scroll.js"></script>
<script>
$(".update-btn").click(function () {
event.preventDefault();
let token = window.localStorage.getItem("idToken");
let full = document.getElementById("fullname").value;
let email = document.getElementById("email").value;
let college = document.getElementById("college").value;
let university = document.getElementById("university").value;
let semester = document.getElementById("semester").value;
let phoneNo = document.getElementById("phoneNo").value;
if ("+91" == phoneNo.substring(0, 3)) {
phoneNo = phoneNo.substring(3, 13);
}
phoneNo = Number(phoneNo)
semester = Number(semester)
if (!token) {
console.log("User not signed in!");
} else {
$.ajax({
method: 'POST',
// url: "https://pfbhdk5lh6.execute-api.ap-south-1.amazonaws.com/production/updatestudentaccount",
url: "https://api.collegeshala.com/updatestudentaccount",
headers: {
authorization: token
},
data: JSON.stringify({
AccessToken: token,
params: {
// 'password': {
// oldPassword: 'asdfgh',
// newPassword: 'qwerty'
// },
"university": university,
"college": college,
"phoneNo": phoneNo,
"sem": semester,
"fullName": full
}
}),
contentType: 'application/json',
success: function complete(result) {
//console.log(result);
alert("Update successful");
fetchstudentdata();
window.location.reload();
},
error: function error(err) {
console.error(err);
}
});
}
})
</script>
<script>
$("#search-input").change(function () {
localStorage.setItem("value", event.target.value);
window.location.pathname = "/all-product.html";
});
</script>
<script>
function fetchstudentdata() {
let token = window.localStorage.getItem("idToken");
if (!token) {
console.log("User not signed in!");
} else {
$.ajax({
method: 'POST',
url: "https://api.collegeshala.com/studentdetails",
headers: {
authorization: token
},
body: {},
contentType: 'application/json',
success: function complete(result) {
//let phno;
//console.log(result.Item);
var keys = Object.keys(result.Item);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if ("phoneNo" == key) {
for (let [k, value] of Object.entries(result.Item)) {
//console.log(`${key}: ${value}`);
if ("phoneNo" == k) {
let phno = `${value}`;
//phno = phno.substring(3, 13);
if ("+91" == phno.substring(0, 3)) {
phno = phno.substring(3, 13);
}
//console.log(phno)
document.getElementById('phoneNo').value = Number(phno);
break;
}
}
} else if ("university" == key) {
for (let [k, value] of Object.entries(result.Item)) {
//console.log(`${key}: ${value}`);
if ("university" == k) {
let dep = `${value}`;
//console.log(dep)
document.getElementById('university').value = dep;
break;
}
}
} else if ("college" == key) {
for (let [k, value] of Object.entries(result.Item)) {
//console.log(`${key}: ${value}`);
if ("college" == k) {
let col = `${value}`;
//console.log(col)
document.getElementById('college').value = col;
break;
}
}
} else if ("email" == key) {
for (let [k, value] of Object.entries(result.Item)) {
//console.log(`${key}: ${value}`);
if ("email" == k) {
let em = `${value}`;
//console.log(em)
document.getElementById('email').value = em;
break;
}
}
} else if ("subjects" == key) {
for (let [k, value] of Object.entries(result.Item)) {
//console.log(`${key}: ${value}`);
if ("subjects" == k) {
let sub = `${value}`;
//console.log(em)
document.getElementById('subjects').value = sub;
break;
}
}
} else if ("fullName" == key) {
for (let [k, value] of Object.entries(result.Item)) {
//console.log(`${key}: ${value}`);
if ("fullName" == k) {
let full = `${value}`;
//console.log(full)
document.getElementById('fullname').value = full;
break;
}
}
} else if ("sem" == key) {
for (let [k, value] of Object.entries(result.Item)) {
//console.log(`${key}: ${value}`);
if ("sem" == k) {
let sem = `${value}`;
//console.log(sem)
document.getElementById("semester").value = sem;
//document.getElementById('fullname').value = full;
break;
}
}
}
}
},
error: function error(err) {
console.error(err);
}
});
}
}
</script>
<script src="./js/logout.js"></script>
</body>
</html>