index.php 1.17 KB
Newer Older
Gustav Arneving's avatar
Gustav Arneving committed
1
<?php include "content/head.php"; ?>
root's avatar
root committed
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

<article>
<h2>Häfvbastu!</h2>

Den 14 septemebr är det dags för terminens första häfvbastu!

</article>

<hr/>

<article>
<h2>Bästa Häfvtiderna!</h2>
<table style="width:100%;">
<thead>
	<tr>
		<th>#</th>
		<th>Namn</th>
		<th>Tid</th>
		<th>När</th>
	</tr>
</thead>
<tbody>
<?php
$times = $mysql->query(
	"SELECT name, time, performance_date FROM times
	 ORDER BY time ASC")
	or die($mysql->error);
$i = 1;
Gustav Arneving's avatar
Gustav Arneving committed
30
31

while ($row = $times->fetch_assoc()) {  ?>
root's avatar
root committed
32
33
34
35
36
37
38
39
40
41
<tr>
	<td><?= $i++ ?>
	<td><?= $row["name"] ?></td>
	<td><?= sprintf("%.2f", $row["time"] / 1000) ?></td>
	<td><?= substr($row["performance_date"], 0, 10) ?></td>
</tr>
<?php } ?>
</tbody>
<?php if ($authenticated) { ?>
<tfoot>
Gustav Arneving's avatar
Gustav Arneving committed
42
<form method="POST" action="code/add_time.php">
root's avatar
root committed
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<tr>
<td></td>
<td><input name="name" type="text" placeholder="Namn"/></td>
<td><input name="time" type="number" min="0" max="10" step="0.01" placeholder="Tid" /></td>
<td><input name="when" type="date" value="<?php echo date('Y-m-d'); ?>" /></td>
</tr>
<td></td><td colspan="3"><input style="width: 100%" type="submit"/></td>
<tr>
</tr>
</form>
</tfoot>
<?php } ?>
</table>

</article>

Gustav Arneving's avatar
Gustav Arneving committed
59
<?php include "content/tail.php"; ?>