Commit
This commit is contained in:
parent
b319dd23fd
commit
8ef2098dcd
@ -87,7 +87,8 @@ class Teamtable
|
||||
}
|
||||
|
||||
// Return true if team exists, false if not
|
||||
public function insert(string $cardnumber): bool
|
||||
// ;))
|
||||
public function recieveStick(string $cardnumber): bool
|
||||
{
|
||||
$sth = $this->dbh->prepare('SELECT * FROM lagtabell WHERE Kortnummer = ?');
|
||||
$sth->execute([$cardnumber]);
|
||||
@ -105,7 +106,7 @@ class Teamtable
|
||||
"INSERT INTO `lagtabell` (`LagNavn`, `Bedrift`, `Kortnummer`, `Lagleder`, `Telefon`, `Deltagere`, `Runder`) VALUES (?, ?, ?, ?, ?, ?, ?)"
|
||||
);
|
||||
$template = $this->emptyTeamTemplate;
|
||||
$template = [
|
||||
$sth->execute([
|
||||
$template['LagNavn'],
|
||||
$template['Bedrift'],
|
||||
$cardnumber,
|
||||
@ -113,8 +114,7 @@ class Teamtable
|
||||
$template['Telefon'],
|
||||
$template['Deltagere'],
|
||||
$template['Runder'],
|
||||
];
|
||||
$sth->execute($template);
|
||||
]);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
@ -9,7 +9,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST')
|
||||
$cardnumber = $_POST['cardnumber'];
|
||||
|
||||
if (!(strlen($cardnumber) > 32)) {
|
||||
if ($model->insert($cardnumber))
|
||||
if ($model->recieveStick($cardnumber))
|
||||
{
|
||||
$app->session->flash("Lag funnet for \"{$cardnumber}\"", "success");
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user