From 7dc2b86d9a7605fb3737720b8e8e38a518a8f168 Mon Sep 17 00:00:00 2001 From: H1tkliff Date: Fri, 13 Jun 2025 11:09:47 +0200 Subject: [PATCH] =?UTF-8?q?Erstellung=20der=20Funktionalit=C3=A4t=20f?= =?UTF-8?q?=C3=BCr=20die=20Registration=20(nicht=20fertig)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CSS/Block/header.css | 25 --------------- CSS/Element/button.css | 9 ++++++ CSS/Element/{logo.scss => logo.css} | 0 CSS/style.css | 3 +- CSS/variables.css | 2 +- Controller/UserController.php | 27 +++++++++++++++++ Model/UserModel.php | 47 +++++++++++++++++++++++++++++ Views/User/showUserForm.phtml | 34 +++++++++++++++++++++ Views/footer.phtml | 2 +- Views/header.phtml | 6 ++-- 10 files changed, 124 insertions(+), 31 deletions(-) create mode 100644 CSS/Element/button.css rename CSS/Element/{logo.scss => logo.css} (100%) create mode 100644 Controller/UserController.php create mode 100644 Model/UserModel.php create mode 100644 Views/User/showUserForm.phtml diff --git a/CSS/Block/header.css b/CSS/Block/header.css index 54ac0e9..03ae75e 100644 --- a/CSS/Block/header.css +++ b/CSS/Block/header.css @@ -35,29 +35,4 @@ nav li a { nav li a:hover { background-color: orange; -} - -#metanavi { - color: #4d4d4d; - font-weight: bold; - margin-bottom: 5px; -} - -#metanavi a { - background: #09add0; - border: none; - width: 100px; - margin: 0 5px 0 5px; - float: right; - padding: 2px; - border-radius: 5px; - color:#fff; - cursor:pointer; - font-size: 12px; - text-decoration: none; - text-align: center; -} - -#metanavi a:hover { - background: orange; } \ No newline at end of file diff --git a/CSS/Element/button.css b/CSS/Element/button.css new file mode 100644 index 0000000..13914dd --- /dev/null +++ b/CSS/Element/button.css @@ -0,0 +1,9 @@ +.btn{ + background: var(--brand-primary); + color: var(--brand-white); + padding: 5px 10px; + font-weight: var(--font-weight-semibold); + font-size: var(--font-size-text); + border-radius: 3px; + text-decoration: none; +} \ No newline at end of file diff --git a/CSS/Element/logo.scss b/CSS/Element/logo.css similarity index 100% rename from CSS/Element/logo.scss rename to CSS/Element/logo.css diff --git a/CSS/style.css b/CSS/style.css index 641e880..0b6549c 100644 --- a/CSS/style.css +++ b/CSS/style.css @@ -1,7 +1,8 @@ @import url(variables.css); @import url(Block/header.css); @import url(Block/footer.css); -@import url(Element/logo.scss); +@import url(Element/logo.css); +@import url(Element/button.css); *, *:before, *:after { -moz-box-sizing: border-box; diff --git a/CSS/variables.css b/CSS/variables.css index 9192d74..af9c0e0 100644 --- a/CSS/variables.css +++ b/CSS/variables.css @@ -7,7 +7,7 @@ --input-placeholder: #998E82; /*Fonts*/ - --font-family-main: font-family: "Inter", sans-serif; + --font-family-main: "Inter", sans-serif; --font-family-headline: "Source Serif 4", serif; /* Font-size*/ diff --git a/Controller/UserController.php b/Controller/UserController.php new file mode 100644 index 0000000..ed2a3c5 --- /dev/null +++ b/Controller/UserController.php @@ -0,0 +1,27 @@ + "Name", "email" => "E-Mail-Adresse", "content" => "Nachricht"); + + public function __construct($view){ + $this->db = new UserModel(); + $this->view = $view; + } + + public function showUserForm(){ + + } + + + public function register(){ + $this->db->createUser($this->labels); + } +} \ No newline at end of file diff --git a/Model/UserModel.php b/Model/UserModel.php new file mode 100644 index 0000000..3abd03c --- /dev/null +++ b/Model/UserModel.php @@ -0,0 +1,47 @@ +createUUID(); + + $pdo = $this->linkDB(); + + $sql = "INSERT INTO users (`id`,`vorname`,`name`,`email`,`passwort`,`salt`,`role`) + VALUES (:guid, :name, :lastname, :email, :password, :salt, :role)"; + + try { + $sth = $pdo->prepare($sql); + $sth->execute(array + (":guid" => $guid, + (":name") => $values["name"], + ":lastname" => $values["lastname"], + ":email" => $values["email"], + ":password" => $hash, + ":salt" => $salt, + ":role" => $values["role"] + )); + } catch (PDOException $e) { + new \Blog\Library\ErrorMsg("Fehler beim Schreiben der Daten.", $e); + die; + } + + return true; + } + +} \ No newline at end of file diff --git a/Views/User/showUserForm.phtml b/Views/User/showUserForm.phtml new file mode 100644 index 0000000..3d9c837 --- /dev/null +++ b/Views/User/showUserForm.phtml @@ -0,0 +1,34 @@ + + +

Benutzer

+ +
+

Registrieren

+ + + + + + + + + + + + + +

Wähle deine Rolle:

+ + + +
+ + diff --git a/Views/footer.phtml b/Views/footer.phtml index 981a4af..81595e7 100644 --- a/Views/footer.phtml +++ b/Views/footer.phtml @@ -3,7 +3,7 @@ diff --git a/Views/header.phtml b/Views/header.phtml index 810074f..91d5b90 100644 --- a/Views/header.phtml +++ b/Views/header.phtml @@ -1,5 +1,5 @@ - + VR Contact @@ -15,9 +15,9 @@
- +