From 9a0dd90bd622a9ce0665c180688969afc9c2c319 Mon Sep 17 00:00:00 2001 From: Trygve Date: Fri, 1 Nov 2024 11:54:45 +0100 Subject: [PATCH] Skilte Kadavern og mini --- table.php | 59 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 18 deletions(-) diff --git a/table.php b/table.php index 8b6513b..45032c4 100644 --- a/table.php +++ b/table.php @@ -143,12 +143,12 @@ if ($query[0] == "registrering"){ if ($runner->get_control() == $matpost-1) { // Løperen har vært på denne matposten og vi farger raden grønn $button = ""; - $cssclass = "class=\"bg-success\"\""; + $cssclass = "class=\"bg-success\""; } elseif ($runner->get_control() > $matpost-1) { // Løperen har vært på denne matposten og vi farger raden grønn $button = ""; - $cssclass = "class=\"bg-active\"\""; + $cssclass = "class=\"bg-active\""; } else { $button = ""; @@ -176,45 +176,68 @@ elseif ($query[0] == "paameldte") {
$kadaverløpere påmeldt Kadaverløpet
$minikadaverløpere påmeldte i Minikadaver'n
"); - echo(" + echo("
+ - "); + + "); for ($i = 0; $i < count($runners); $i++) { $runner = $runners[$i]; - echo ("\n"); + echo ("\n"); } echo("
S.nr Navn Klubb/Forening Variant
$runner->name$runner->club$runner->course
$runner->id$runner->name$runner->club$runner->course
"); } else { usort($runners, "cmp"); - echo("
+ usort($runners, "cmp_course"); + $kadaver_table = "
- - "); + + "; + $minikadaver_table = "
#Startnummer Navn 1. matpost 2. matpost Mål
+ + + + + + "; for ($i = 0; $i < count($runners); $i++) { $runner = $runners[$i]; - $tid_1_mat = ""; - if ($runner->splits[0] != false) { - // https://www.php.net/manual/en/class.dateinterval.php - $tid_1_mat = $GLOBALS['start_time']->diff($runner->splits[0])->format('%H:%I:%S'); - } - $tid_2_mat = ""; - if ($runner->splits[1] != false) { - $tid_2_mat = $GLOBALS['start_time']->diff($runner->splits[1])->format('%H:%I:%S'); + + if ($runner->course == "Kadaverløpet") { + $tid_1_mat = ""; + if ($runner->splits[0] != false) { + // https://www.php.net/manual/en/class.dateinterval.php + $tid_1_mat = $GLOBALS['start_time']->diff($runner->splits[0])->format('%H:%I:%S'); + } + $tid_2_mat = ""; + if ($runner->splits[1] != false) { + $tid_2_mat = $GLOBALS['start_time']->diff($runner->splits[1])->format('%H:%I:%S'); + } + $matposter = ""; } $tid_maal = ""; if ($runner->splits[2] != false) { $tid_maal = $GLOBALS['start_time']->diff($runner->splits[2])->format('%H:%I:%S'); } - echo ("\n"); + if ($runner->course == "Kadaverløpet") { + $kadaver_table .= "$matposter\n"; + } + elseif ($runner->course == "Minikadaver'n") { + $minikadaver_table .= "\n"; + } } - echo("
#NavnMål
$tid_1_mat$tid_2_mat
". $i+1 .".$runner->id$runner->name$tid_1_mat$tid_2_mat$tid_maal
". $i+1 .".$runner->name$tid_maal
". $i+1 .".$runner->name$tid_maal
"); + $kadaver_table .= ""; + $minikadaver_table .= ""; + echo($kadaver_table); + echo("

Minikadaver'n

"); + echo($minikadaver_table); } \ No newline at end of file