From cdd1fa05756f2746d3a5162ee1d8ee18ed4800a1 Mon Sep 17 00:00:00 2001 From: William Date: Wed, 16 Mar 2022 12:43:21 +0100 Subject: [PATCH] Commit --- app/model/Cardreader.php | 4 ++++ app/view/pages/race/teamtable/edit/index.php | 2 +- public/race/simulator.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/model/Cardreader.php b/app/model/Cardreader.php index 2e4bb5f..fdaa905 100644 --- a/app/model/Cardreader.php +++ b/app/model/Cardreader.php @@ -22,6 +22,7 @@ class Cardreader } /** + * TODO: yeah this sucks but it werks! * Returns: * 0 created team * 1 started counting @@ -52,6 +53,9 @@ class Cardreader return 3; } + $team->rounds += 1; + $this->teamMapper->update($team); + if ($team->bestTime === NULL) { $team->bestTime = $diff; diff --git a/app/view/pages/race/teamtable/edit/index.php b/app/view/pages/race/teamtable/edit/index.php index dbce1f4..c2630de 100644 --- a/app/view/pages/race/teamtable/edit/index.php +++ b/app/view/pages/race/teamtable/edit/index.php @@ -29,7 +29,7 @@ echo "" . htmlspecialchars($team->rounds) . ""; echo "" . htmlspecialchars(($team->bestTime === NULL) ? "Ukjent" : $team->bestTime) . ""; echo ""; - echo "Slett ]"; + echo "Slett ] "; echo "Endre ]"; echo ""; echo ''; diff --git a/public/race/simulator.php b/public/race/simulator.php index 19402db..874f40d 100644 --- a/public/race/simulator.php +++ b/public/race/simulator.php @@ -12,7 +12,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') if (!(strlen($cardnumber) > 32)) { - $code = $cardreader->receive($cardnumber, 30); + $code = $cardreader->receive($cardnumber, 5); switch ($code) { case 0: $app->session->flash('Opprettet nytt lag', 'success');