From e5637d49293275aa3dc1794823ff2062b2d4b201 Mon Sep 17 00:00:00 2001 From: pbbfa23abi Date: Thu, 10 Jul 2025 12:03:32 +0200 Subject: [PATCH] Kurse in Landing Page integriert --- CSS/Element/filter_box.css | 2 +- Model/UserModel.php | 17 +++ Views/Welcome/showWelcome.phtml | 176 +++++++++++++++----------------- 3 files changed, 102 insertions(+), 93 deletions(-) diff --git a/CSS/Element/filter_box.css b/CSS/Element/filter_box.css index b9fea33..2489d61 100644 --- a/CSS/Element/filter_box.css +++ b/CSS/Element/filter_box.css @@ -29,4 +29,4 @@ font-weight: bold; cursor: pointer; border-radius: 4px; -} +} \ No newline at end of file diff --git a/Model/UserModel.php b/Model/UserModel.php index a5ac67e..2c7548a 100644 --- a/Model/UserModel.php +++ b/Model/UserModel.php @@ -190,6 +190,23 @@ class UserModel extends Database die; } } + public function getAllCourses() { + $pdo = $this->linkDB(); + + $sql = "SELECT k.id, k.name, k.preis, k.dauer, k.rabatt, k.kategorie, k.beschreibung, k.ort_id, + o.stadt, o.strasse, o.plz, b.note, b.kommentar + FROM kurs AS k + JOIN ort AS o ON o.id = k.ort_id + LEFT JOIN bewertungen AS b ON b.kurs_id = k.id"; + try { + $sth = $pdo->prepare($sql); + $sth->execute(); + return $sth->fetchAll(\PDO::FETCH_ASSOC); + } catch (PDOException $e) { + new \Blog\Library\ErrorMsg("Fehler beim Lesen der Daten.", $e); + die; + } + } public function updateCourse($course) { diff --git a/Views/Welcome/showWelcome.phtml b/Views/Welcome/showWelcome.phtml index 5df5196..5befaf7 100644 --- a/Views/Welcome/showWelcome.phtml +++ b/Views/Welcome/showWelcome.phtml @@ -1,9 +1,8 @@ @@ -11,19 +10,18 @@ $location = $_GET['location'] ?? '';

KURSE & ERLEBNISSE JEDER ART

-

Alle Kurse in deiner Nähe – auf einen Blick

- -
-
-
-
- - +

Alle Kurse in deiner Nähe - auf einen Blick

+
+
+
+ + +