-
Notifications
You must be signed in to change notification settings - Fork 0
/
summary.php
58 lines (55 loc) · 1.58 KB
/
summary.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
50
51
52
53
54
55
56
57
58
<?php
setlocale(LC_TIME, 'de_DE.utf8');
date_default_timezone_set('Europe/Berlin');
$periods = array('hour', 'day', 'week', 'month', 'year');
if (!isset($_GET['periode']) || !in_array($_GET['periode'], $periods)) {
$period=$periods[0];
} else {
$period = $_GET['periode'];
}
$nodelist = json_decode(file_get_contents('namedb.json'), true);
?>
<!DOCTYPE HTML>
<html>
<head>
<title>FFHH: Node <?=$nodename?></title>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="/ffhh/style.css" />
</head>
<body>
<header>
<h1>Freifunk Hamburg</h1>
<h2>Übersicht</h2>
</header>
<?php include('navigation.php'); ?>
<aside>
Zeitraum anzeigen
<ul>
<?php foreach($periods as $name): ?>
<li><a href="/ffhh/summary/<?=$name?>"> <?=$name?></a></li>
<?php endforeach; ?>
</ul>
</aside>
<section>
<?
$even = true;
foreach($nodelist as $mac => $name): ?>
<figure>
<img src="/ffhh/graph/<?=$mac?>/<?=$period?>" alt="connections of freifunk node <?=$mac?> - by <?=$period?>" id="<?=$mac?>" class="nimg" /><?=PHP_EOL?>
<figcaption>
<a href="/ffhh/view/<?=$mac?>">
<? if (strlen($name) == 0): ?>
<?=wordwrap($mac, 2, ':', true)?>
<? else: ?>
<?=$name?>
<? endif; ?><?=PHP_EOL?>
</a>
</figcaption>
</figure><? if ($even): ?><br /><? endif; ?><?=PHP_EOL?>
<? $even = !$even;
endforeach; ?>
<? if ($even): ?><br /><? endif; ?>
</section>
<?php include('footer.php'); ?>
</body>
</html>