From 328f833ebbca2763b04d92cd9adff2f4e527b331 Mon Sep 17 00:00:00 2001 From: pauli Date: Thu, 22 Jan 2026 22:50:40 +0100 Subject: [PATCH 01/11] categories bar update --- assets/css/home.css | 47 +++++++++++++++++++++++++++++++++++++++++++++ header.php | 2 +- home.php | 44 ++++++++++++++++++++---------------------- 3 files changed, 69 insertions(+), 24 deletions(-) create mode 100644 assets/css/home.css diff --git a/assets/css/home.css b/assets/css/home.css new file mode 100644 index 0000000..47db12c --- /dev/null +++ b/assets/css/home.css @@ -0,0 +1,47 @@ +.home-nav { + min-height: 56px; + width: 100%; + display: flex; + align-items: center; + background-color: #000961; /* helleres Lapis-/Hellblau */ +} + +/* Inner zentriert */ +.home-nav__inner { + flex: 1; + width: 100%; + display: flex; + justify-content: center; + align-items: center; +} + +/* List: 5 gleich große Bereiche */ +.home-nav__list { + width: 100%; + display: flex; + list-style: none; + margin: 0; + padding: 0; +} + +/* Kategorien */ +.home-nav__list li { + flex: 1; + text-align: center; + color: #ffffff; + font-weight: bold; + padding: 1rem 0; + position: relative; + cursor: pointer; +} + +/* Trennstriche */ +.home-nav__list li:not(:last-child)::after { + content: ""; + position: absolute; + right: 0; + top: 20%; + height: 60%; + width: 1px; + background-color: rgba(255, 255, 255, 0.6); +} diff --git a/header.php b/header.php index c490979..e08756c 100644 --- a/header.php +++ b/header.php @@ -12,7 +12,7 @@ Geizkragen - + + +

+ + @@ -110,7 +118,7 @@ include 'header.php';
diff --git a/productpage.php b/productpage.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/productpage.php @@ -0,0 +1 @@ + '', + 'displayName' => '' +]; + +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + $email = trim((string)(isset($_POST['email']) ? $_POST['email'] : '')); + $displayName = trim((string)(isset($_POST['displayName']) ? $_POST['displayName'] : '')); + $pw = (string)(isset($_POST['pw']) ? $_POST['pw'] : ''); + $pw2 = (string)(isset($_POST['pw2']) ? $_POST['pw2'] : ''); + + $values['email'] = $email; + $values['displayName'] = $displayName; + + // Validierung + if ($email === '' || !filter_var($email, FILTER_VALIDATE_EMAIL)) { + $errors[] = 'Bitte eine gültige E-Mail-Adresse eingeben.'; + } + + if ($displayName === '' || mb_strlen($displayName) < 3 || mb_strlen($displayName) > 50) { + $errors[] = 'Bitte einen Benutzernamen mit 3–50 Zeichen eingeben.'; + } + + if ($pw === '' || mb_strlen($pw) < 8) { + $errors[] = 'Bitte ein Passwort mit mindestens 8 Zeichen wählen.'; + } + + if ($pw !== $pw2) { + $errors[] = 'Die Passwörter stimmen nicht überein.'; + } + + // Duplicate-Checks + if (!$errors) { + $stmt = mysqli_prepare($conn, 'SELECT userID FROM users WHERE email = ? LIMIT 1'); + if (!$stmt) { + $errors[] = 'Datenbankfehler.'; + } else { + mysqli_stmt_bind_param($stmt, 's', $email); + mysqli_stmt_execute($stmt); + $result = mysqli_stmt_get_result($stmt); + if ($result && mysqli_fetch_assoc($result)) { + $errors[] = 'Diese E-Mail ist bereits registriert.'; + } + mysqli_stmt_close($stmt); + } + } + + if (!$errors) { + $stmt = mysqli_prepare($conn, 'SELECT userID FROM users WHERE displayName = ? LIMIT 1'); + if (!$stmt) { + $errors[] = 'Datenbankfehler.'; + } else { + mysqli_stmt_bind_param($stmt, 's', $displayName); + mysqli_stmt_execute($stmt); + $result = mysqli_stmt_get_result($stmt); + if ($result && mysqli_fetch_assoc($result)) { + $errors[] = 'Dieser Benutzername ist bereits vergeben.'; + } + mysqli_stmt_close($stmt); + } + } + + // Insert + if (!$errors) { + $hash = password_hash($pw, PASSWORD_DEFAULT); + $stmt = mysqli_prepare( + $conn, + 'INSERT INTO users (email, passwordHash, displayName, isActive, createdAt) VALUES (?, ?, ?, 1, NOW())' + ); + + if (!$stmt) { + $errors[] = 'Datenbankfehler.'; + } else { + mysqli_stmt_bind_param($stmt, 'sss', $email, $hash, $displayName); + $ok = mysqli_stmt_execute($stmt); + mysqli_stmt_close($stmt); + + if ($ok) { + mysqli_close($conn); + header('Location: login.php?registered=1'); + exit; + } + + $errors[] = 'Registrierung fehlgeschlagen.'; + } + } +} + +include 'header.php'; +?> + + +
+
+
+
+

Registrierung

+

Erstelle einen Account, um deine Wunschliste zu verwalten und Deals schneller zu speichern.

+
+ + + + + +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+
+ + +
+
+
+ + From 0b0621d7e2aef1012ab7129d7b3ac820fa1882da Mon Sep 17 00:00:00 2001 From: fabian Date: Fri, 23 Jan 2026 09:25:37 +0000 Subject: [PATCH 10/11] Update README.md --- README.md | 152 ------------------------------------------------------ 1 file changed, 152 deletions(-) diff --git a/README.md b/README.md index d970e35..fcbea79 100644 --- a/README.md +++ b/README.md @@ -7,155 +7,3 @@ > - ssh -N -L 3306:127.0.0.1:3306 fsst@fabianschieder.com -> ## ![Datenbank Design](https://dbdiagram.io/d/Geizkragen-695e708939fa3db27b5c7599) -> ![user](assets/images/DB_Design_user.png) -> ![products](assets/images/DB_Design_products.png) - -```sql -Table categories { - categoryID int [pk] - name varchar(255) - parentCategoryID int -} - -Ref: "categories"."parentCategoryID" < "categories"."categoryID" - -Table brands { - brandID int [pk] - name varchar(255) -} - -Table products { - productID int [pk] - categoryID int - brandID int - model varchar(255) - ean varchar(20) - description text -} - -Ref: "products"."categoryID" < "categories"."categoryID" -Ref: "products"."brandID" < "brands"."brandID" - -Table shops { - shopID int [pk] - name varchar(255) - website varchar(255) -} - -Table offers { - offerID int [pk] - productID int - shopID int - price decimal(10,2) - shippingCost decimal(10,2) - inStock boolean - productURL varchar(500) - lastUpdated timestamp -} - -Ref: "offers"."productID" < "products"."productID" -Ref: "offers"."shopID" < "shops"."shopID" - -Table attributes { - attributeID int [pk] - name varchar(255) - unit varchar(50) - dataType varchar(20) -} - -Table categoryAttributes { - categoryID int - attributeID int -} - -Ref: "categoryAttributes"."categoryID" < "categories"."categoryID" -Ref: "categoryAttributes"."attributeID" < "attributes"."attributeID" - -Table productAttributes { - productID int - attributeID int - valueString varchar(255) - valueNumber decimal(10,2) - valueBool boolean -} - -Ref: "productAttributes"."productID" < "products"."productID" -Ref: "productAttributes"."attributeID" < "attributes"."attributeID" - - - -Table users { - userID int [pk] - email varchar(255) - passwordHash varchar(255) - displayName varchar(255) - isActive boolean - createdAt timestamp -} - -Table roles { - roleID int [pk] - name varchar(50) -} - -Table userRoles { - userID int - roleID int -} - -Ref: "userRoles"."userID" < "users"."userID" -Ref: "userRoles"."roleID" < "roles"."roleID" - -Table userFavorites { - userID int - productID int - createdAt timestamp -} - -Ref: "userFavorites"."userID" < "users"."userID" -Ref: "userFavorites"."productID" < "products"."productID" - -Table priceAlerts { - alertID int [pk] - userID int - productID int - targetPrice decimal(10,2) - isActive boolean - createdAt timestamp -} - -Ref: "priceAlerts"."userID" < "users"."userID" -Ref: "priceAlerts"."productID" < "products"."productID" - -Table notifications { - notificationID int [pk] - userID int - title varchar(255) - message text - isRead boolean - createdAt timestamp -} - -Ref: "notifications"."userID" < "users"."userID" - -Table reviews { - reviewID int [pk] - userID int - productID int - rating int - comment text - createdAt timestamp -} - -Ref: "reviews"."userID" < "users"."userID" -Ref: "reviews"."productID" < "products"."productID" - -Table userSessions { - sessionID varchar(128) [pk] - userID int - expiresAt timestamp -} - -Ref: "userSessions"."userID" < "users"."userID" -``` \ No newline at end of file From 771e70a7c46476864b93f3ef2768a403e686625c Mon Sep 17 00:00:00 2001 From: fabian Date: Fri, 23 Jan 2026 09:26:20 +0000 Subject: [PATCH 11/11] Update README.md --- README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/README.md b/README.md index fcbea79..8b13789 100644 --- a/README.md +++ b/README.md @@ -1,9 +1 @@ -# Readme File - -> ## ![Projekt Logins](https://send.bitwarden.com/#0sol_osHmkGnJrPXARShXA/AzFCC4rVoXqEqjQUEqBt1A) - -> ## Wichtige Befehle -> - systemctl reload apache2 -> - ssh -N -L 3306:127.0.0.1:3306 fsst@fabianschieder.com -