From 27a924584ec210167c92d7bda5189fcb770ada3f Mon Sep 17 00:00:00 2001 From: Trygve Date: Tue, 5 Nov 2024 12:57:13 +0100 Subject: [PATCH] =?UTF-8?q?n=C3=B8dfikser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- table.php | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/table.php b/table.php index 29ac9d4..90cf90e 100644 --- a/table.php +++ b/table.php @@ -1,6 +1,6 @@ splits); $i++) { + { for ($i = 0; $i < count($this->splits); $i++) { + if (!is_object($this->splits[$i])) { return $i-1; } - } - return count($this->splits)-1; + } + return count($this->splits)-1; } } @@ -217,7 +216,7 @@ else { $kadaver_table = " - + @@ -230,10 +229,12 @@ else { "; + $kadaver_num = 0; + $mini_num = 0; for ($i = 0; $i < count($runners); $i++) { $runner = $runners[$i]; - - if ($runner->course == "Kadaverløpet") { + if ($runner->course == "Kadaverløpet") { + $kadaver_num++; $tid_1_mat = ""; if ($runner->splits[0] != false) { // https://www.php.net/manual/en/class.dateinterval.php @@ -244,21 +245,22 @@ else { $tid_2_mat = $GLOBALS['start_time']->diff($runner->splits[1])->format('%H:%I:%S'); } $matposter = ""; - } + } + else { + $mini_num++; + } $tid_maal = ""; if ($runner->splits[2] != false) { $tid_maal = $GLOBALS['start_time']->diff($runner->splits[2])->format('%H:%I:%S'); } if ($runner->course == "Kadaverløpet") { - $kadaver_table .= "$matposter\n"; + $kadaver_table .= "$matposter\n"; } elseif ($runner->course == "Minikadaver'n") { - $minikadaver_table .= "\n"; + $minikadaver_table .= "\n"; } } $kadaver_table .= "
#NavnNavn 1. matpost 2. matpost MålMål
$tid_1_mat$tid_2_mat
". $i+1 .".$runner->name$tid_maal
". $kadaver_num .".$runner->name$tid_maal
". $i+1 .".$runner->name$tid_maal
". "" .".$runner->name$tid_maal
"; $minikadaver_table .= ""; echo($kadaver_table); - echo("

Minikadaver'n

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