This commit is contained in:
William 2022-04-08 12:24:16 +00:00
parent 33d78385ce
commit 653bfd912f
4 changed files with 9 additions and 6 deletions

View File

@ -53,8 +53,8 @@ async function updateTable()
data.forEach(element => { data.forEach(element => {
table_html += "<tr>"; table_html += "<tr>";
table_html += "<td>" + element.name + "</td>"; table_html += "<td>" + element.n + "</td>";
table_html += "<td>" + element.date.date + "</td>"; table_html += "<td>" + element.d + "</td>";
table_html += "</tr>"; table_html += "</tr>";
}); });

View File

@ -31,7 +31,10 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST')
$phone = filter_input(INPUT_POST, 'phone', FILTER_VALIDATE_INT); $phone = filter_input(INPUT_POST, 'phone', FILTER_VALIDATE_INT);
$participants = filter_input(INPUT_POST, 'participants', FILTER_VALIDATE_INT); $participants = filter_input(INPUT_POST, 'participants', FILTER_VALIDATE_INT);
$team = new Team; if (!isset($team))
{
$team = new Team();
}
try { try {
$team->setName($name); $team->setName($name);
$team->setCompany($company); $team->setCompany($company);

View File

@ -11,7 +11,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST')
$cardnumber = (string)$_POST['cardnumber']; $cardnumber = (string)$_POST['cardnumber'];
try { try {
$code = $batonReader->receive($cardnumber, 5); $code = $batonReader->receive($cardnumber, 0);
switch ($code) { switch ($code) {
case 0: case 0:
$app->session->flash('Opprettet nytt lag', 'success'); $app->session->flash('Opprettet nytt lag', 'success');

View File

@ -25,8 +25,8 @@ foreach ($times as $time)
} }
$row = [ $row = [
"name" => $team->name, "n" => $team->name,
"date" => $time->date "d" => $time->date->getTimestamp()
]; ];
array_push($data, $row); array_push($data, $row);