-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile.php
More file actions
100 lines (83 loc) · 2.28 KB
/
profile.php
File metadata and controls
100 lines (83 loc) · 2.28 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
<?php
//profile.php
include('header.php')
?>
<!--link css file for dark theme card-->
<link rel="stylesheet" href="css/card.css">
<!--js for toggle related work-->
<script>
var checkbox = document.querySelector("input[id=togBtn]");
checkbox.addEventListener( 'change', function() {
document.body.classList.toggle("dark-theme");
document.getElementById("card").classList.toggle("dark-card");
});
</script>
<div class="container" style="margin-top:30px">
<div class="card || dark-card" id="card">
<div class="card-header"><b>Profile</b>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered table-striped">
<tr>
<th>User Name</th>
<td><?php echo get_user_name($connect, $_SESSION["user_id"]); ?></td>
</tr>
<tr>
<th>Email Address</th>
<td><?php echo get_user_email($connect, $_SESSION["user_id"]); ?></td>
</tr>
<tr>
<th>Date of Joining</th>
<td><?php echo get_user_doj($connect, $_SESSION["user_id"]); ?></td>
</tr>
<tr>
<th>Rank</th>
<td><?php echo get_rank($connect, $_SESSION["user_id"]); ?></td>
</tr>
<tr>
<th>Average Score</th>
<td><?php echo average_score($connect, $_SESSION["user_id"]); ?></td>
</tr>
</table>
</div>
</div>
<div class="card-header"><b>Recent Scores</b>
</div>
<div class="card-body">
<div class="table-responsive">
<span id="message_operation"></span>
<table class="table table-striped table-bordered" id="score_table">
<thead>
<tr>
<th>Date</th>
<th>Score</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</body>
</html>
<script>
$(document).ready(function(){
// call profile_action.php to retrieve data
var dataTable = $('#score_table').DataTable({
"processing":true,
"serverSide":true,
"order":[],
"ajax":{
url:"profile_action.php",
method:"POST",
data:
{
action:"fetch"
},
}
});
});
</script>