This commit is contained in:
William 2022-04-20 09:02:19 +00:00
parent 149c43b889
commit d47a34d530
3 changed files with 11 additions and 13 deletions

View File

@ -76,8 +76,8 @@ class TimeMapper
{
$sth = $this->dbh->prepare('INSERT INTO tidtabell (LagID) VALUES (?)');
$sth->execute([$time->team_id]);
$lastId = $this->dbh->lastInsertId();
return $this->get($lastId);
$last_id = $this->dbh->lastInsertId();
return $this->get($last_id);
}
public function delete(int $id): void

View File

@ -1,3 +1,5 @@
<div id="alert" class="alert danger hidden" role="alert"></div>
<h1>Live resultater</h1>
<br>
@ -10,7 +12,8 @@ Laster inn...
</div>
<script>
var hash = 0;
let hash = 0;
let alertbox = document.getElementById("alert");
document.addEventListener('DOMContentLoaded', function() {
loop();
@ -20,8 +23,10 @@ async function loop()
{
try {
await updateTable();
alertbox.classList.add("hidden");
} catch (error) {
console.log(error);
alertbox.innerHTML = "<b>Noe gikk galt: </b>" + error;
alertbox.classList.remove("hidden");
}
setTimeout(function() {

View File

@ -24,7 +24,8 @@ foreach ($times as $time)
if (!$team)
{
return;
// this should not happen as related times should be deleted with the team
#continue;
}
$row = [
@ -35,14 +36,6 @@ foreach ($times as $time)
array_push($data, $row);
}
$hash = crc32(serialize($data));
if ($prev_hash !== $hash)