You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.6 KiB
71 lines
2.6 KiB
<?php if (!defined('INIT')) exit; ?>
|
|
<!DOCTYPE html>
|
|
<html lang>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Phedder</title>
|
|
<link rel="stylesheet" href="style.css">
|
|
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
|
|
</head>
|
|
<body>
|
|
<h1><?=e($DATA['city'])?></h1>
|
|
<h2><small><?=e($DATA['sunrise'])?> / <?=e($DATA['sunset'])?></small></h2>
|
|
|
|
<table class="forecast">
|
|
<thead>
|
|
<tr>
|
|
<th>Datum</th>
|
|
<th>Regen</th>
|
|
<th colspan="3"></th>
|
|
<th>Wind</th>
|
|
<th>Temp</th>
|
|
</tr>
|
|
</thead>
|
|
<?php foreach($grouped as $group): ?>
|
|
<tbody>
|
|
<?php $first = true; ?>
|
|
<?php foreach($group as $line): ?>
|
|
<tr>
|
|
<td>
|
|
<?php if ($first): ?>
|
|
<?=e(substr($line['date'], 0, 11))?>
|
|
<?php $first = false; ?>
|
|
<?php else: ?>
|
|
<?=e(substr($line['date'], 12, 5))?>
|
|
<?php endif; ?>
|
|
</td>
|
|
<td><?=e(round($line['rain'], 1))?>mm</td>
|
|
<td class="pictogram"><?=($line['icon'])?></td>
|
|
<?php
|
|
$classmap = [
|
|
'Y' => 'flying-weather',
|
|
'M' => 'maybe-flying-weather',
|
|
'N' => ''
|
|
];
|
|
?>
|
|
<td class="pictogram">
|
|
<span class="<?=$classmap[$line['riding']]?>"><?=e($line['ridingIcon'])?></span>
|
|
</td>
|
|
<td class="pictogram">
|
|
<span class="<?=$classmap[$line['flying']]?>"><?=e($line['flyingIcon'])?></span>
|
|
</td>
|
|
<td><?=e($line['wind'])?>m/s</td>
|
|
<td><?=e(round($line['temp'], 1))?>°C</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
<?php endforeach; ?>
|
|
</table>
|
|
|
|
<form action="<?=wc()?>">
|
|
<label>
|
|
Ort
|
|
<input name="location" required value="<?=e($_GET['location'] ?? '')?>">
|
|
</label>
|
|
<button type="submit">
|
|
Suche
|
|
</button>
|
|
</form>
|
|
</body>
|
|
</html>
|