-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
202 lines (178 loc) · 5.93 KB
/
Copy pathindex.php
File metadata and controls
202 lines (178 loc) · 5.93 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
<?php
include 'inc/session.php';
?>
<!DOCTYPE html>
<html>
<head>
<title>Fidelity Connect</title>
<style type="text/css">
#col{
display: none;
animation: animation 0.7s linear 1;
}
@keyframes animation{
from{
transform: scale(0);
}
to{
transform: scale(1);
}
}
</style>
<?php include 'inc/link.php'; ?>
</head>
<?php include 'inc/sidebar.php'; ?>
<ul class="nav nav-pills mt-4">
<li class="nav-item">
<a class="nav-link active p-1 mr-2" data-toggle="pill" href="#home">Class mates</a>
</li>
<!-- <li class="nav-item mr-2">
<a class="nav-link p-1" data-toggle="pill" href="#menu1">Class Highest Score</a>
</li> -->
<li class="nav-item mr-2">
<a class="nav-link p-1" data-toggle="pill" href="#menu2">Most Active Members</a>
</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane container active m-0 p-0" id="home">
<div class=" border mt-2">
<p class="border-bottom p-2 mb-0 mt-0 text-center font-weight-bold">Class Mates</p>
<p class="float-left mt-2 p-2 mb-0 mt-0">
<b>Class:</b>
<?php
$select = mysqli_query($connect, "SELECT * FROM class WHERE id = '{$_SESSION['class']}'");
while ($row = mysqli_fetch_array($select)) {
echo $row['class'];
}
?>
</p>
<p class="float-right mt-2 p-2 mb-0 mt-0">
<b>Current Session:</b>
<?php
$select = mysqli_query($connect, "SELECT * FROM session WHERE id = '{$_SESSION['session']}'");
while ($row = mysqli_fetch_array($select)) {
echo $row['session'];
}
?>
</p>
<div class="clearfix"></div>
</div>
<table class="col-md-12 table text-center table-striped table-bordered">
<thead class="table-head">
<tr>
<th>S/N</th>
<th>Name</th>
<th>Registration Date</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM students WHERE class = '{$_SESSION["class"]}' && session = '{$_SESSION['session']}'";
$query = mysqli_query($connect, $sql);
$n = 1;
while ($row = mysqli_fetch_array($query)) {
?>
<tr>
<td><?php echo $n++; ?></td>
<td><?php
$sel = mysqli_query($connect, "SELECT * FROM register WHERE id = '{$row['user_id']}'");
while ($r = mysqli_fetch_array($sel)) {
echo $r['name'];
}
?></td>
<td>
<?php
$sel = mysqli_query($connect, "SELECT * FROM register WHERE id = '{$row['user_id']}'");
while ($r = mysqli_fetch_array($sel)) {
echo $r['date'];
}
?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<!-- <div class="tab-pane m-0 p-0 container fade" id="menu1">
<p class=" border mt-2 p-2 mb-0 text-center font-weight-bold">Class Highest Scores</p>
<table class="col-md-12 table text-center table-striped table-bordered" style="background-color:;">
<thead class="table-head">
<tr>
<th>S/N</th>
<th>Name</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM report WHERE class = '{$_SESSION["class"]}' AND term = '2' ORDER BY exam DESC LIMIT 5";
$query = mysqli_query($connect, $sql);
$n = 1;
while ($row = mysqli_fetch_array($query)) {
?>
<tr>
<td><?php echo $n++; ?></td>
<td><?php
$selt = "SELECT * FROM users WHERE id = '{$row["name"]}'";
$qry = mysqli_query($connect, $selt);
while ($show =mysqli_fetch_array($qry)) {
echo $show['name'];
}
?>
</td>
<td><?php echo $row['exam']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div> -->
<div class="tab-pane container fade m-0 p-0" id="menu2">
<p class=" border mt-2 p-2 mb-0 text-center font-weight-bold">Most Active Members</p>
<table class="col-md-12 table text-center table-striped table-bordered">
<thead class="">
<tr>
<th>S/N</th>
<th>Name</th>
<th>Last Visit</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM users_visit WHERE username!='' && username != 'Toyeebah' ORDER BY times DESC LIMIT 5";
$query = mysqli_query($connect, $sql);
$n = 1;
while ($row = mysqli_fetch_array($query)) {
?>
<tr>
<td><?php echo $n++; ?></td>
<td class="text-capitalize"><?php echo $row['username']; ?></td>
<td>
<?php
if ($row['date'] == date('h:i d/M/Y')) {
echo "<b class='text-primary'>Online</b>";
}else{
echo $row['date']; }
?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<?php include 'inc/footer.php'; ?>
<div id="loader">
<div class="pt-5"></div>
<img src="images/Blocks-Loading.gif" width="50%" class="d-block m-auto w-50 pt-5">
</div>
<script type="text/javascript">
var myVar;
function myFunction() {
myVar = setTimeout(showPage, 3000);
}
function showPage() {
document.getElementById("loader").style.display = "none";
document.getElementById("col").style.display = "block";
}
</script>