Commit
This commit is contained in:
parent
2cfbd9c557
commit
a1d1123894
@ -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
|
||||||
{
|
{
|
||||||
|
@ -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;
|
||||||
|
|
@ -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');
|
||||||
|
Reference in New Issue
Block a user