Kommentare in Datenbank.php
Habe Kommentare in Datenbank.php hinzugefügt
This commit is contained in:
parent
1d415a6ab0
commit
574f2362b1
1 changed files with 14 additions and 13 deletions
|
@ -19,22 +19,22 @@
|
||||||
class Datenbank extends DBClass
|
class Datenbank extends DBClass
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
* Diese Methode prüft, ob das Loginpasswort und -name mit den Werten in der Datenbank übereinstimmen
|
||||||
* @param string $name
|
* @param string $name Loginname
|
||||||
* @param string $passwort
|
* @param string $passwort Loginpasswort
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function checkLogin(string $name, string $passwort)
|
public function checkLogin(string $name, string $passwort)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT * FROM Test_v2 WHERE Name=:name AND Code=:passwort';
|
$sql = 'SELECT * FROM Test_v2 WHERE Name=:name AND Code=:passwort';
|
||||||
|
|
||||||
$params = array(
|
$params = array(
|
||||||
'name' => strtolower($name),
|
'name' => strtolower($name),
|
||||||
'passwort' => $passwort
|
'passwort' => $passwort
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $this->select($sql, $params);
|
$result = $this->select($sql, $params);
|
||||||
|
|
||||||
if (count($result) == 1) {
|
if (count($result) == 1) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -43,14 +43,14 @@ class Datenbank extends DBClass
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Diese Methode prüft, ob ein Nutzer sich schon eingetragen hat
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function hasAlredySelected(string $name)
|
public function hasAlredySelected(string $name)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT * FROM Test_v2 WHERE Name=:name AND Kurs IS NOT NULL AND Kurs2 IS NOT NULL AND Kurs3 IS NOT NULL ';
|
$sql = 'SELECT * FROM Test_v2 WHERE Name=:name AND Kurs IS NOT NULL AND Kurs2 IS NOT NULL AND Kurs3 IS NOT NULL ';
|
||||||
|
|
||||||
$params = array(
|
$params = array(
|
||||||
'name' => $name
|
'name' => $name
|
||||||
);
|
);
|
||||||
|
@ -65,8 +65,8 @@ class Datenbank extends DBClass
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Diese Methode gibt alle verfügbaren Kurse aus
|
||||||
* @return array strings
|
* @return Countable|array
|
||||||
*/
|
*/
|
||||||
public function selectKurse()
|
public function selectKurse()
|
||||||
{
|
{
|
||||||
|
@ -76,8 +76,9 @@ class Datenbank extends DBClass
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Diese Methode trägt die Auswahl eines Benutzers in die Datenbank ein
|
||||||
* @param array $kurse
|
* @param string Loginname
|
||||||
|
* @param array[strings] Die ausgewählten Kurse
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function insertSelection(string $name, array $kurse)
|
public function insertSelection(string $name, array $kurse)
|
||||||
|
@ -107,4 +108,4 @@ class Datenbank extends DBClass
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue