This commit is contained in:
William 2022-04-27 10:57:26 +00:00
parent f9eb4bbbd9
commit f4d9562b48
4 changed files with 15 additions and 8 deletions

View File

@ -1,2 +1,3 @@
<h1>Stafett for livet tellesystem</h1>
<p>Elever <a href="https://kvadraturen.vgs.no/">Kvadraturen Vidergående Skole</a> har som skoleprosjekt laget et system for telling av løpere for <a href="https://kreftforeningen.no/stafettforlivet/">Kreftforeningens Stafett for livet</a>.</p>
<p>Elever <a href="https://kvadraturen.vgs.no/">Kvadraturen Vidergående Skole</a> har som skoleprosjekt laget et system for telling av løpere for <a href="https://kreftforeningen.no/stafettforlivet/">Kreftforeningens Stafett for livet</a>.</p>
<img src="static/img/3ELDEA.jpg" alt="Klassebilde">

View File

@ -16,7 +16,7 @@ $time_mapper = new TimeMapper($app->database->conn);
$prev_hash = filter_input(INPUT_GET, 'h');
$teams = [];
$name_map = [];
$team_map = [];
$times = [];
$time_ref = NULL;
@ -28,9 +28,13 @@ foreach ($time_mapper->getAll() as $time)
}
$team = $teams[$time->team_id];
if (!isset($name_map[$team->id]))
if (!isset($team_map[$team->id]))
{
$name_map[$team->id] = htmlspecialchars($team->name);
$team_map[$team->id] = [
"name" => htmlspecialchars($team->name),
"company" => htmlspecialchars($team->company),
"rounds" => htmlspecialchars($team->rounds),
];
}
if ($time_ref === NULL)
@ -48,9 +52,7 @@ foreach ($time_mapper->getAll() as $time)
$data = [
"map" => [
"team" => [
"name" => $name_map,
],
"team" => $team_map,
"time_reference" => $time_ref
],
"times" => $times

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 KiB

View File

@ -46,7 +46,9 @@ class ResultService
tableHTML += "<tr>";
tableHTML += "<th>#</th>";
tableHTML += "<th>Lag</th>";
tableHTML += "<th>Bedrift</th>";
tableHTML += "<th>Tid</th>";
tableHTML += "<th>Runder</th>";
tableHTML += "</tr>";
let iterator = 0;
@ -55,8 +57,10 @@ class ResultService
tableHTML += "<tr>";
tableHTML += "<td>" + iterator + "</td>";
tableHTML += "<td>" + data.map.team.name[element.id] + "</td>";
tableHTML += "<td>" + data.map.team[element.id].name + "</td>";
tableHTML += "<td>" + data.map.team[element.id].company + "</td>";
tableHTML += "<td>" + element.time + "</td>";
tableHTML += "<td>" + data.map.team[element.id].rounds+ "</td>";
tableHTML += "</tr>";
});