Fix commit
This commit is contained in:
parent
57be7a931a
commit
b319dd23fd
@ -61,9 +61,8 @@ class Teamtable
|
||||
$sth = $this->dbh->prepare(
|
||||
'INSERT INTO lagtabell (LagNavn, Bedrift, Kortnummer, Lagleder, Telefon, Deltagere, Runder) VALUES (?, ?, ?, ?, ?, ?, ?)'
|
||||
);
|
||||
|
||||
$template = $this->emptyTeamTemplate;
|
||||
$template = [
|
||||
$sth->execute([
|
||||
$template['LagNavn'],
|
||||
$template['Bedrift'],
|
||||
$template['Kortnummer'],
|
||||
@ -71,8 +70,7 @@ class Teamtable
|
||||
$template['Telefon'],
|
||||
$template['Deltagere'],
|
||||
$template['Runder'],
|
||||
];
|
||||
$sth->execute($template);
|
||||
]);
|
||||
return $this->dbh->lastInsertId();
|
||||
}
|
||||
|
||||
@ -80,18 +78,12 @@ class Teamtable
|
||||
public function isEqualEmptyTemplate(array $team): bool
|
||||
{
|
||||
$template = $this->emptyTeamTemplate;
|
||||
$equal = FALSE;
|
||||
foreach ($team as $key => $value) {
|
||||
if (!isset($template[$key])) {
|
||||
continue;
|
||||
foreach ($template as $key => $value) {
|
||||
if ((string)$team[$key] !== (string)$template[$key]) {
|
||||
return FALSE;
|
||||
}
|
||||
if ($template[$key] !== $team[$key]) {
|
||||
$equal = FALSE;
|
||||
break;
|
||||
}
|
||||
$equal = TRUE;
|
||||
}
|
||||
return $equal;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Return true if team exists, false if not
|
||||
|
Reference in New Issue
Block a user