From fdda46656c051ef17db4cd3ef8462cda287afbbb Mon Sep 17 00:00:00 2001 From: paul Date: Thu, 12 Feb 2026 18:55:21 +0100 Subject: [PATCH 1/4] product page first design --- assets/css/productpage.css | 93 ++++++++++++++++++++++++++++++++++++++ productpage.php | 52 ++++++++++++++++----- 2 files changed, 134 insertions(+), 11 deletions(-) diff --git a/assets/css/productpage.css b/assets/css/productpage.css index e69de29..27df462 100644 --- a/assets/css/productpage.css +++ b/assets/css/productpage.css @@ -0,0 +1,93 @@ +/* Gesamter Bereich */ +.product-wrapper { + max-width: 1200px; + margin: 60px auto; + padding: 0 20px; + + display: flex; + gap: 60px; +} + +/* LINKER BEREICH */ +.product-left { + flex: 1; +} + +.product-image-box { + background: #ffffff; + padding: 40px; + border-radius: 14px; + box-shadow: 0 8px 25px rgba(0,0,0,0.08); + text-align: center; +} + +.product-image-box img { + max-width: 100%; + height: auto; + object-fit: contain; +} + +/* RECHTER BEREICH */ +.product-right { + flex: 1.2; +} + + +/* Produkttitel */ +.product-title { + font-size: 32px; + color: white; + font-weight: 600; + margin-bottom: 30px; + border-bottom: 2px solid #eaeaea; + padding-bottom: 15px; +} + +/* Beschreibung */ +.product-desc { + font-size: 23px; + line-height: 1.7; + color: #ffffff; + margin-bottom: 15px; +} + +/* Spezifikationen */ +.product-specs { + display: flex; + color: #ffffff; + flex-direction: column; + gap: 12px; +} +S +/* Einzelne Zeile */ +.spec-row { + display: flex; + justify-content: space-between; + padding: 12px 16px; + background: #f9f9f9; + border-radius: 8px; + transition: background 0.2s ease; +} + +.spec-row:hover { + background: #f0f0f0; +} + +/* Name links */ +.spec-name { + font-weight: 500; + color: #444; +} + +/* Wert rechts */ +.spec-value { + font-weight: 600; + color: #111; +} + +/* Responsive */ +@media (max-width: 900px) { + .product-wrapper { + flex-direction: column; + } +} diff --git a/productpage.php b/productpage.php index f9e240b..ffd3dc0 100644 --- a/productpage.php +++ b/productpage.php @@ -42,7 +42,10 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0; a.dataType, pa.valueString, pa.valueNumber, - pa.valueBool + pa.valueBool, + p.model, + p.description, + p.imagePath FROM products p INNER JOIN categoryAttributes ca @@ -68,18 +71,45 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0; $product = $result->fetch_assoc(); ?> - fetch_assoc()) { - echo "

{$row['name']}: "; +

+ +
+
+ <?= htmlspecialchars($product['model'] ?? 'Produktbild') ?> +
+
- if (!empty($row['valueString'])) echo $row['valueString']; - if (!empty($row['valueNumber'])) echo $row['valueNumber'] . " " . $row['unit']; - if (!is_null($row['valueBool'])) echo $row['valueBool'] ? "Ja" : "Nein"; + +
- echo "

"; - } +

+ +

- ?> +
+ +
+ +
+ + + fetch_assoc()) { + + echo "

{$row['name']}: "; + + if (!empty($row['valueString'])) echo $row['valueString']; + if (!empty($row['valueNumber'])) echo $row['valueNumber'] . " " . $row['unit']; + if (!is_null($row['valueBool'])) echo $row['valueBool'] ? "Ja" : "Nein"; + + echo "

"; + } + ?> +
+
+
close(); ?> @@ -91,7 +121,7 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0; - + \ No newline at end of file From 143259816077cc15c11bf4266d86ade8d15fd571 Mon Sep 17 00:00:00 2001 From: paul Date: Thu, 12 Feb 2026 19:26:16 +0100 Subject: [PATCH 2/4] logout working (idk how) --- account.php | 8 ++++++++ assets/css/login.css | 10 ++++++++++ logout.php | 30 ++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 logout.php diff --git a/account.php b/account.php index a652b9a..783f716 100644 --- a/account.php +++ b/account.php @@ -104,12 +104,20 @@ include 'header.php'; +

+ +
+ +
+
diff --git a/assets/css/login.css b/assets/css/login.css index 8d8b298..0f888e5 100644 --- a/assets/css/login.css +++ b/assets/css/login.css @@ -289,6 +289,16 @@ color: var(--gh-text); } +.auth__submit { + transition: 0.2s ease; +} + +.auth__submit:hover { + transform: translateY(-2px); + opacity: 0.9; +} + + @media (max-width: 900px) { .auth__grid { grid-template-columns: 1fr; diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..f2cf5bb --- /dev/null +++ b/logout.php @@ -0,0 +1,30 @@ + Date: Tue, 17 Feb 2026 21:15:51 +0100 Subject: [PATCH 3/4] refactor database schema: improve table definitions and add missing fields --- info/DB-Design.sql | 60 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/info/DB-Design.sql b/info/DB-Design.sql index 055ebe3..9d0030c 100644 --- a/info/DB-Design.sql +++ b/info/DB-Design.sql @@ -1,4 +1,5 @@ -Table categories { +Table categories +{ categoryID int [pk] name varchar(255) parentCategoryID int @@ -6,30 +7,34 @@ Table categories { Ref: "categories"."parentCategoryID" < "categories"."categoryID" -Table brands { +Table brands +{ brandID int [pk] name varchar(255) } -Table products { +Table products +{ productID int [pk] categoryID int brandID int model varchar(255) - ean varchar(20) description text + imagePath varchar(255) } Ref: "products"."categoryID" < "categories"."categoryID" Ref: "products"."brandID" < "brands"."brandID" -Table shops { +Table shops +{ shopID int [pk] name varchar(255) website varchar(255) } -Table offers { +Table offers +{ offerID int [pk] productID int shopID int @@ -43,14 +48,16 @@ Table offers { Ref: "offers"."productID" < "products"."productID" Ref: "offers"."shopID" < "shops"."shopID" -Table attributes { +Table attributes +{ attributeID int [pk] name varchar(255) unit varchar(50) - dataType varchar(20) + dataType varchar(20) } -Table categoryAttributes { +Table categoryAttributes +{ categoryID int attributeID int } @@ -58,7 +65,8 @@ Table categoryAttributes { Ref: "categoryAttributes"."categoryID" < "categories"."categoryID" Ref: "categoryAttributes"."attributeID" < "attributes"."attributeID" -Table productAttributes { +Table productAttributes +{ productID int attributeID int valueString varchar(255) @@ -72,21 +80,32 @@ Ref: "productAttributes"."attributeID" < "attributes"."attributeID" -Table users { + + + + + + + +Table users +{ userID int [pk] email varchar(255) passwordHash varchar(255) displayName varchar(255) isActive boolean createdAt timestamp + profilePicture varchar(255) } -Table roles { +Table roles +{ roleID int [pk] name varchar(50) } -Table userRoles { +Table userRoles +{ userID int roleID int } @@ -94,7 +113,8 @@ Table userRoles { Ref: "userRoles"."userID" < "users"."userID" Ref: "userRoles"."roleID" < "roles"."roleID" -Table userFavorites { +Table userFavorites +{ userID int productID int createdAt timestamp @@ -103,7 +123,8 @@ Table userFavorites { Ref: "userFavorites"."userID" < "users"."userID" Ref: "userFavorites"."productID" < "products"."productID" -Table priceAlerts { +Table priceAlerts +{ alertID int [pk] userID int productID int @@ -115,7 +136,8 @@ Table priceAlerts { Ref: "priceAlerts"."userID" < "users"."userID" Ref: "priceAlerts"."productID" < "products"."productID" -Table notifications { +Table notifications +{ notificationID int [pk] userID int title varchar(255) @@ -126,7 +148,8 @@ Table notifications { Ref: "notifications"."userID" < "users"."userID" -Table reviews { +Table reviews +{ reviewID int [pk] userID int productID int @@ -138,7 +161,8 @@ Table reviews { Ref: "reviews"."userID" < "users"."userID" Ref: "reviews"."productID" < "products"."productID" -Table userSessions { +Table userSessions +{ sessionID varchar(128) [pk] userID int expiresAt timestamp From 4f4e9d4608758ef8e86d85ce110f1c5bcb30fffb Mon Sep 17 00:00:00 2001 From: Fabian Schieder Date: Tue, 17 Feb 2026 23:21:24 +0100 Subject: [PATCH 4/4] refactor login.php: improve password handling with explicit conditional assignment --- login.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/login.php b/login.php index fc8facc..1080ef3 100644 --- a/login.php +++ b/login.php @@ -39,7 +39,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') $uname = trim($_POST['uname']); } - $pw = isset($_POST['pw']) ? $_POST['pw'] : ''; + if (isset($_POST['pw'])) + { + $pw = $_POST['pw']; + } + else + { + $pw = ''; + } + // Basic Validierung if ($uname === '' || $pw === '')