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);