From add9a27630970f81f9486e7102188f7517a32e36 Mon Sep 17 00:00:00 2001 From: Samuel Wolff Date: Wed, 17 Jan 2024 10:58:49 +0100 Subject: [PATCH 1/7] Fehlermeldungen --- Model/BenutzerModel.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Model/BenutzerModel.php b/Model/BenutzerModel.php index 2fb70da..c7d43f8 100644 --- a/Model/BenutzerModel.php +++ b/Model/BenutzerModel.php @@ -86,6 +86,7 @@ class BenutzerModel extends Database $stmt = $pdo->prepare($sql); $stmt->execute($params); } catch (\PDOException $e) { + echo "Faulty Sql? " . $sql; return false; } @@ -105,6 +106,7 @@ class BenutzerModel extends Database $stmt = $pdo->prepare($sql); $stmt->execute(); } catch (\PDOException $e) { + echo "Faulty Sql? " . $sql; return false; } -- 2.39.5 From e7303771039d8186e737677744b0f9392aee8ad6 Mon Sep 17 00:00:00 2001 From: Samuel Wolff Date: Thu, 18 Jan 2024 09:31:09 +0100 Subject: [PATCH 2/7] MyFirstAnmeldeFunktion --- Controller/BenutzerController.php | 7 +++++++ Model/BenutzerModel.php | 28 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/Controller/BenutzerController.php b/Controller/BenutzerController.php index 61f64e1..e04b7f0 100644 --- a/Controller/BenutzerController.php +++ b/Controller/BenutzerController.php @@ -44,6 +44,13 @@ class BenutzerController return json_encode($result); } + public function anmeldeVersuch($data) + { + $result = $this->db->anmeldeVersuch($data); + + return json_encode($result); + } + } ?> \ No newline at end of file diff --git a/Model/BenutzerModel.php b/Model/BenutzerModel.php index c7d43f8..6eda96d 100644 --- a/Model/BenutzerModel.php +++ b/Model/BenutzerModel.php @@ -115,6 +115,34 @@ class BenutzerModel extends Database return $result; } + + public function anmeldeVersuch() + { + + $pdo = $this->linkDB(); + + $params = array(); + + $params[":Benutzername"] = $_GET["Benutzername"]; + $params[":passwort"] = $_GET["passwort"]; + + $sql = "SELECT * FROM Benutzerkonto WHERE name = :Benutzername AND passwort = :passwort"; + + try { + $stmt = $pdo->prepare($sql); + $stmt->execute($params); + } catch (\PDOException $e) { + return false; + } + + $result = $stmt->fetchALL(\PDO::FETCH_ASSOC); + + if (count($result) > 0) + return true; + else + return false; + + } } ?> \ No newline at end of file -- 2.39.5 From bbb5ebcbac50ed4d559445e50da8100466991b15 Mon Sep 17 00:00:00 2001 From: Samuel Wolff Date: Thu, 18 Jan 2024 10:02:29 +0100 Subject: [PATCH 3/7] faxxen --- Controller/BenutzerController.php | 4 ++-- Controller/TagesplanController.php | 6 ++++++ Model/TagesplanModel.php | 7 +++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Controller/BenutzerController.php b/Controller/BenutzerController.php index e04b7f0..e68ab7a 100644 --- a/Controller/BenutzerController.php +++ b/Controller/BenutzerController.php @@ -44,9 +44,9 @@ class BenutzerController return json_encode($result); } - public function anmeldeVersuch($data) + public function anmeldeVersuch() { - $result = $this->db->anmeldeVersuch($data); + $result = $this->db->anmeldeVersuch(); return json_encode($result); } diff --git a/Controller/TagesplanController.php b/Controller/TagesplanController.php index aed591d..a109ac0 100644 --- a/Controller/TagesplanController.php +++ b/Controller/TagesplanController.php @@ -33,5 +33,11 @@ class TagesplanController $result = $this->db->deleteTagesplan($id); return json_encode($result); } + + public function getGerichteOnTag() + { + $result = $this->db->getGerichteOnTag(); + return json_encode($result); + } } ?> \ No newline at end of file diff --git a/Model/TagesplanModel.php b/Model/TagesplanModel.php index 797c47d..d760184 100644 --- a/Model/TagesplanModel.php +++ b/Model/TagesplanModel.php @@ -64,6 +64,13 @@ class TagesplanModel extends Database } catch (\PDOException $e) { return false; } + } + + public function getGerichteOnTag() + { + + + } } ?> \ No newline at end of file -- 2.39.5 From 1f2789eead5642d4822e23811f973e4907b8a5ce Mon Sep 17 00:00:00 2001 From: Samuel Wolff Date: Thu, 18 Jan 2024 10:12:14 +0100 Subject: [PATCH 4/7] Tagesplan first Stand --- Model/TagesplanModel.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Model/TagesplanModel.php b/Model/TagesplanModel.php index d760184..b25ba41 100644 --- a/Model/TagesplanModel.php +++ b/Model/TagesplanModel.php @@ -69,7 +69,23 @@ class TagesplanModel extends Database public function getGerichteOnTag() { + $pdo = $this->linkDB(); + $datum = $_GET["datum"]; + + $sql = "SELECT * FROM Tagesplan LEFT JOIN GibtsAm ON Tagesplan.id = GibtsAm.tid LEFT JOIN Gericht ON GibtsAm.gid = Gericht.id WHERE Tagesplan.datum = $datum"; + + try { + $stmt = $pdo->prepare($sql); + $stmt->execute(); + } catch (\PDOException $e) { + echo $sql . " This do be faulty"; + return false; + } + + $result = $stmt->fetchAll(\PDO::FETCH_ASSOC); + + return $result; } } -- 2.39.5 From 34ae68bfdcf19cccc0f02702de59c831636146f0 Mon Sep 17 00:00:00 2001 From: Samuel Wolff Date: Thu, 18 Jan 2024 10:16:56 +0100 Subject: [PATCH 5/7] zweiter Stand --- Model/TagesplanModel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/TagesplanModel.php b/Model/TagesplanModel.php index b25ba41..80d0793 100644 --- a/Model/TagesplanModel.php +++ b/Model/TagesplanModel.php @@ -73,7 +73,7 @@ class TagesplanModel extends Database $datum = $_GET["datum"]; - $sql = "SELECT * FROM Tagesplan LEFT JOIN GibtsAm ON Tagesplan.id = GibtsAm.tid LEFT JOIN Gericht ON GibtsAm.gid = Gericht.id WHERE Tagesplan.datum = $datum"; + $sql = "SELECT * FROM Gericht LEFT JOIN GibtsAm ON Gericht.id = GibtsAm.gid LEFT JOIN Tagesplan ON GibtsAm.tid = Tagesplan.id WHERE Tagesplan.datum = $datum"; try { $stmt = $pdo->prepare($sql); -- 2.39.5 From 64b6aa2716bd3515d0b333016ca01429888905c4 Mon Sep 17 00:00:00 2001 From: Samuel Wolff Date: Thu, 18 Jan 2024 10:21:52 +0100 Subject: [PATCH 6/7] sql funzt --- Model/TagesplanModel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/TagesplanModel.php b/Model/TagesplanModel.php index 80d0793..84db2ad 100644 --- a/Model/TagesplanModel.php +++ b/Model/TagesplanModel.php @@ -73,7 +73,7 @@ class TagesplanModel extends Database $datum = $_GET["datum"]; - $sql = "SELECT * FROM Gericht LEFT JOIN GibtsAm ON Gericht.id = GibtsAm.gid LEFT JOIN Tagesplan ON GibtsAm.tid = Tagesplan.id WHERE Tagesplan.datum = $datum"; + $sql = "SELECT Gericht.id, Gericht.name, Gericht.preis, Gericht.beschreibung FROM Gericht LEFT JOIN GibtsAm ON Gericht.id = GibtsAm.gid LEFT JOIN Tagesplan ON GibtsAm.tid = Tagesplan.id WHERE Tagesplan.datum = '$datum'"; try { $stmt = $pdo->prepare($sql); -- 2.39.5 From 5db540d1d10020a002bcae979d3bf5dea42d6f6b Mon Sep 17 00:00:00 2001 From: Samuel Wolff Date: Fri, 19 Jan 2024 09:19:35 +0100 Subject: [PATCH 7/7] smol fix? --- Controller/KindController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controller/KindController.php b/Controller/KindController.php index fb744ac..73a195b 100644 --- a/Controller/KindController.php +++ b/Controller/KindController.php @@ -48,7 +48,7 @@ class KindController { $result = $this->db->deleteKind($kindId); - return $result; + return json_encode($result); } } -- 2.39.5