This commit is contained in:
William 2022-03-16 12:43:21 +01:00
parent c85dba499c
commit cdd1fa0575
3 changed files with 6 additions and 2 deletions

View File

@ -22,6 +22,7 @@ class Cardreader
} }
/** /**
* TODO: yeah this sucks but it werks!
* Returns: * Returns:
* 0 created team * 0 created team
* 1 started counting * 1 started counting
@ -52,6 +53,9 @@ class Cardreader
return 3; return 3;
} }
$team->rounds += 1;
$this->teamMapper->update($team);
if ($team->bestTime === NULL) if ($team->bestTime === NULL)
{ {
$team->bestTime = $diff; $team->bestTime = $diff;

View File

@ -29,7 +29,7 @@
echo "<td>" . htmlspecialchars($team->rounds) . "</td>"; echo "<td>" . htmlspecialchars($team->rounds) . "</td>";
echo "<td>" . htmlspecialchars(($team->bestTime === NULL) ? "Ukjent" : $team->bestTime) . "</td>"; echo "<td>" . htmlspecialchars(($team->bestTime === NULL) ? "Ukjent" : $team->bestTime) . "</td>";
echo "<td>"; echo "<td>";
echo "<span>[&nbsp;<a class='danger' href='delete.php?item={$team->id}&confirm=1'>Slett</a>&nbsp;]</span>"; echo "<span>[&nbsp;<a class='danger' href='delete.php?item={$team->id}&confirm=1'>Slett</a>&nbsp;]&nbsp;</span>";
echo "<span>[&nbsp;<a class='info' href='update.php?item={$team->id}'>Endre</a>&nbsp;]</span>"; echo "<span>[&nbsp;<a class='info' href='update.php?item={$team->id}'>Endre</a>&nbsp;]</span>";
echo "</td>"; echo "</td>";
echo '</tr>'; echo '</tr>';

View File

@ -12,7 +12,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST')
if (!(strlen($cardnumber) > 32)) { if (!(strlen($cardnumber) > 32)) {
$code = $cardreader->receive($cardnumber, 30); $code = $cardreader->receive($cardnumber, 5);
switch ($code) { switch ($code) {
case 0: case 0:
$app->session->flash('Opprettet nytt lag', 'success'); $app->session->flash('Opprettet nytt lag', 'success');