-
Notifications
You must be signed in to change notification settings - Fork 1
/
scoreboard.php
49 lines (43 loc) · 1.57 KB
/
scoreboard.php
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
<?php
session_start();
if(!isset($_SESSION["data"]) && isset($_SESSION["user"]))
header("location: /");
?>
<?php include("header.php"); ?>
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h1 class="mt-5">Pr(emed)onostiek tussenstand </h1>
<table border=1 id="scoreboard">
<?php
$data = file_get_contents("data/scoreboard.json");
$json = json_decode($data, true);
?>
<tr>
<td colspan="6" class="header">Tussenstand</td>
</tr>
<tr>
<td class="subheader"> </td>
<td class="subheader">Naam</td>
<td class="subheader">Totaalscore</td>
<td class="subheader">Score</td>
<td class="subheader">Bonus</td>
<td class="subheader"># correcte uitslagen</td>
</tr>
<?php $index = 1; ?>
<?php foreach($json as $name => $score): ?>
<tr class="vraag">
<td><?= $index; ?></td>
<td><?= $name ?></td>
<td><?= $score["punten"] ?></td>
<td><?= $score["score"] ?></td>
<td><?= $score["bonus"] ?></td>
<td><?= $score["corruitslagen"] ?></td>
</tr>
<?php $index++; ?>
<?php endforeach; ?>
</table>
</div>
</div>
</div>
<?php include("footer.php"); ?>