2022-05-09 09:36:01 +00:00
|
|
|
<?php
|
2022-05-11 15:36:20 +00:00
|
|
|
if (!isset($view))
|
|
|
|
{
|
|
|
|
$view = 'default';
|
2022-05-09 09:36:01 +00:00
|
|
|
}
|
|
|
|
?>
|
2022-04-26 19:55:10 +00:00
|
|
|
|
2022-05-11 15:36:20 +00:00
|
|
|
<?php if ($view == 'default' || $view == 'focused'): ?>
|
2022-04-26 19:55:10 +00:00
|
|
|
|
2022-05-11 15:36:20 +00:00
|
|
|
<div id="alertBox" class="alert danger hidden" role="alert"></div>
|
2022-04-26 19:55:10 +00:00
|
|
|
|
2022-05-11 15:36:20 +00:00
|
|
|
<?php if ($view == 'default'): ?>
|
|
|
|
<h1>Resultater</h1>
|
|
|
|
<p>Denne siden oppdateres automagisk.</p>
|
|
|
|
<span class="float-right">[ <a class="info" href="?view=focused" target="_blank">Fokusert visning</a> ]</span>
|
|
|
|
<span class="float-right">[ <a class="info" href="?view=summary">Sammendrag</a> ] </span>
|
|
|
|
<br>
|
|
|
|
<?php endif; ?>
|
2022-04-26 19:55:10 +00:00
|
|
|
|
2022-05-11 15:36:20 +00:00
|
|
|
<noscript>
|
|
|
|
Denne siden krever JavaScript
|
|
|
|
</noscript>
|
2022-05-09 09:36:01 +00:00
|
|
|
|
2022-05-11 15:36:20 +00:00
|
|
|
<div id="rankingTable">
|
|
|
|
Laster inn...
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.b {
|
|
|
|
animation: coolFlash 1s;
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes coolFlash {
|
|
|
|
from { background: lightgreen; }
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<script src="<?=$this->config['root_url']?>static/js/ResultService.js"></script>
|
|
|
|
<script>
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
|
|
|
|
alertBox = document.getElementById("alertBox");
|
|
|
|
rankingTable = document.getElementById("rankingTable");
|
|
|
|
|
|
|
|
new ResultService(alertBox, rankingTable, '<?=$this->config['root_url']?>api/race/results.php?h=');
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
<?php if ($view == 'summary'): ?>
|
2022-05-09 09:36:01 +00:00
|
|
|
|
2022-05-11 15:36:20 +00:00
|
|
|
<h1>Sammendrag</h1>
|
|
|
|
<span class="float-right">[ <a class="danger" href="?">Tilbake til resultater</a> ] </span>
|
|
|
|
<br>
|
2022-05-08 20:00:11 +00:00
|
|
|
|
2022-05-11 15:36:20 +00:00
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<th>#</th>
|
|
|
|
<th>Lag</th>
|
|
|
|
<th>Bedrift</th>
|
|
|
|
<th>Runder</th>
|
|
|
|
<th>Bestetid</th>
|
|
|
|
</tr>
|
|
|
|
<?php $i = 1; foreach ($teams as $team): ?>
|
|
|
|
<tr>
|
|
|
|
<td><?=$i++; $i?></td>
|
|
|
|
<td><?=htmlspecialchars($team->name)?></td>
|
|
|
|
<td><?=htmlspecialchars($team->company)?></td>
|
|
|
|
<td><?=htmlspecialchars($team->rounds)?></td>
|
|
|
|
<td><?=htmlspecialchars($team->best_time)?></td>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</table>
|
2022-05-08 20:00:11 +00:00
|
|
|
|
2022-05-11 15:36:20 +00:00
|
|
|
<?php endif; ?>
|