-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathranked.php
More file actions
31 lines (30 loc) · 853 Bytes
/
ranked.php
File metadata and controls
31 lines (30 loc) · 853 Bytes
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
<?php
$subject = Array("Toán","Lý","Hóa","Sinh","Anh","Sử","Địa","GDCD");
$randSubject = $subject[array_rand($subject)];
?>
<h4>BẢNG XẾP HẠNG</h4> <br>
<div id="_bxh">
<h6 style = "text-transform:uppercase;">
TUẦN <?php echo date('W')?> - MÔN: <?php echo $randSubject?> <br>
<?php
echo date("d/m", strtotime('monday this week'));
echo " - ";
echo date("d/m/Y", strtotime('sunday this week'));
?>
</h6>
<?php
include 'testExamPage/model/markDB.php';
$db = new markDB();
$week = date('W');
$result = $db->getRanking($randSubject, 3, $week);
$i = 1;
foreach ($result as $p) {
echo '
<div class="rank">
<img src="assets/image/rank'.$i.'.png" alt="rank1" />
<p>  '.$p['user_nickname'].'</p><br>
</div>';
$i += 1;
}
?>
</div>