This commit is contained in:
William 2022-03-30 19:42:50 +00:00
parent 2cfbd9c557
commit a1d1123894
3 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@ use \PDOException;
/** /**
* Encapsulates a single connection to a database. * Encapsulates a single connection to a database.
* TODO: add different driver implementations. * TODO: ...
*/ */
class Database class Database
{ {

View File

@ -6,7 +6,7 @@ use App\Teamtable\TeamMapper;
use App\Timetable\Time; use App\Timetable\Time;
use App\Timetable\TimeMapper; use App\Timetable\TimeMapper;
class Cardreader class BatonReader
{ {
public PDO $dbh; public PDO $dbh;

View File

@ -2,7 +2,7 @@
// uh oh.. stinky // uh oh.. stinky
$cardreader = $app->model('Cardreader'); $batonReader = $app->model('BatonReader');
if ($_SERVER['REQUEST_METHOD'] === 'POST') if ($_SERVER['REQUEST_METHOD'] === 'POST')
{ {
@ -11,7 +11,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST')
$cardnumber = (string)$_POST['cardnumber']; $cardnumber = (string)$_POST['cardnumber'];
try { try {
$code = $cardreader->receive($cardnumber, 5); $code = $batonReader->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');