From 653bfd912f7ce73544e45d4db22897eeaee1c68b Mon Sep 17 00:00:00 2001 From: William Date: Fri, 8 Apr 2022 12:24:16 +0000 Subject: [PATCH] Commit --- app/view/pages/race/live-results.php | 4 ++-- public/race/configure/teams/update.php | 5 ++++- public/race/simulator.php | 2 +- public/race/sync.php | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/view/pages/race/live-results.php b/app/view/pages/race/live-results.php index e804ca6..0b8753a 100644 --- a/app/view/pages/race/live-results.php +++ b/app/view/pages/race/live-results.php @@ -53,8 +53,8 @@ async function updateTable() data.forEach(element => { table_html += ""; - table_html += "" + element.name + ""; - table_html += "" + element.date.date + ""; + table_html += "" + element.n + ""; + table_html += "" + element.d + ""; table_html += ""; }); diff --git a/public/race/configure/teams/update.php b/public/race/configure/teams/update.php index c598f6b..b7565dc 100644 --- a/public/race/configure/teams/update.php +++ b/public/race/configure/teams/update.php @@ -31,7 +31,10 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') $phone = filter_input(INPUT_POST, 'phone', FILTER_VALIDATE_INT); $participants = filter_input(INPUT_POST, 'participants', FILTER_VALIDATE_INT); - $team = new Team; + if (!isset($team)) + { + $team = new Team(); + } try { $team->setName($name); $team->setCompany($company); diff --git a/public/race/simulator.php b/public/race/simulator.php index efebf10..dff00b4 100644 --- a/public/race/simulator.php +++ b/public/race/simulator.php @@ -11,7 +11,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') $cardnumber = (string)$_POST['cardnumber']; try { - $code = $batonReader->receive($cardnumber, 5); + $code = $batonReader->receive($cardnumber, 0); switch ($code) { case 0: $app->session->flash('Opprettet nytt lag', 'success'); diff --git a/public/race/sync.php b/public/race/sync.php index a4ebbc2..ca6644a 100644 --- a/public/race/sync.php +++ b/public/race/sync.php @@ -25,8 +25,8 @@ foreach ($times as $time) } $row = [ - "name" => $team->name, - "date" => $time->date + "n" => $team->name, + "d" => $time->date->getTimestamp() ]; array_push($data, $row);