Merge remote-tracking branch 'origin/main'

This commit is contained in:
Fabian Schieder 2026-02-18 09:35:34 +01:00
commit 843660c8c9
7 changed files with 233 additions and 30 deletions

View File

@ -104,12 +104,20 @@ include 'header.php';
</div> </div>
</form> </form>
</div> </div>
<div class="auth__card"> <div class="auth__card">
<form> <form>
<a href="productAdder.php" class="auth__actions"> <br> <a href="productAdder.php" class="auth__actions"> <br>
<button class="auth__submit" type="button"">Produkt hinzufügen</button> <button class="auth__submit" type="button"">Produkt hinzufügen</button>
</a> </a>
</form> </form>
<form action="logout.php" method="post" class="auth__actions" style="margin-top: 20px;">
<button class="auth__submit" type="submit" style="background:#dc2626;">
Abmelden
</button>
</form>
</div> </div>
</section> </section>
</main> </main>

View File

@ -289,6 +289,16 @@
color: var(--gh-text); color: var(--gh-text);
} }
.auth__submit {
transition: 0.2s ease;
}
.auth__submit:hover {
transform: translateY(-2px);
opacity: 0.9;
}
@media (max-width: 900px) { @media (max-width: 900px) {
.auth__grid { .auth__grid {
grid-template-columns: 1fr; grid-template-columns: 1fr;

View File

@ -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;
}
}

View File

@ -1,4 +1,5 @@
Table categories { Table categories
{
categoryID int [pk] categoryID int [pk]
name varchar(255) name varchar(255)
parentCategoryID int parentCategoryID int
@ -6,30 +7,34 @@ Table categories {
Ref: "categories"."parentCategoryID" < "categories"."categoryID" Ref: "categories"."parentCategoryID" < "categories"."categoryID"
Table brands { Table brands
{
brandID int [pk] brandID int [pk]
name varchar(255) name varchar(255)
} }
Table products { Table products
{
productID int [pk] productID int [pk]
categoryID int categoryID int
brandID int brandID int
model varchar(255) model varchar(255)
ean varchar(20)
description text description text
imagePath varchar(255)
} }
Ref: "products"."categoryID" < "categories"."categoryID" Ref: "products"."categoryID" < "categories"."categoryID"
Ref: "products"."brandID" < "brands"."brandID" Ref: "products"."brandID" < "brands"."brandID"
Table shops { Table shops
{
shopID int [pk] shopID int [pk]
name varchar(255) name varchar(255)
website varchar(255) website varchar(255)
} }
Table offers { Table offers
{
offerID int [pk] offerID int [pk]
productID int productID int
shopID int shopID int
@ -43,14 +48,16 @@ Table offers {
Ref: "offers"."productID" < "products"."productID" Ref: "offers"."productID" < "products"."productID"
Ref: "offers"."shopID" < "shops"."shopID" Ref: "offers"."shopID" < "shops"."shopID"
Table attributes { Table attributes
{
attributeID int [pk] attributeID int [pk]
name varchar(255) name varchar(255)
unit varchar(50) unit varchar(50)
dataType varchar(20) dataType varchar(20)
} }
Table categoryAttributes { Table categoryAttributes
{
categoryID int categoryID int
attributeID int attributeID int
} }
@ -58,7 +65,8 @@ Table categoryAttributes {
Ref: "categoryAttributes"."categoryID" < "categories"."categoryID" Ref: "categoryAttributes"."categoryID" < "categories"."categoryID"
Ref: "categoryAttributes"."attributeID" < "attributes"."attributeID" Ref: "categoryAttributes"."attributeID" < "attributes"."attributeID"
Table productAttributes { Table productAttributes
{
productID int productID int
attributeID int attributeID int
valueString varchar(255) valueString varchar(255)
@ -72,21 +80,32 @@ Ref: "productAttributes"."attributeID" < "attributes"."attributeID"
Table users {
Table users
{
userID int [pk] userID int [pk]
email varchar(255) email varchar(255)
passwordHash varchar(255) passwordHash varchar(255)
displayName varchar(255) displayName varchar(255)
isActive boolean isActive boolean
createdAt timestamp createdAt timestamp
profilePicture varchar(255)
} }
Table roles { Table roles
{
roleID int [pk] roleID int [pk]
name varchar(50) name varchar(50)
} }
Table userRoles { Table userRoles
{
userID int userID int
roleID int roleID int
} }
@ -94,7 +113,8 @@ Table userRoles {
Ref: "userRoles"."userID" < "users"."userID" Ref: "userRoles"."userID" < "users"."userID"
Ref: "userRoles"."roleID" < "roles"."roleID" Ref: "userRoles"."roleID" < "roles"."roleID"
Table userFavorites { Table userFavorites
{
userID int userID int
productID int productID int
createdAt timestamp createdAt timestamp
@ -103,7 +123,8 @@ Table userFavorites {
Ref: "userFavorites"."userID" < "users"."userID" Ref: "userFavorites"."userID" < "users"."userID"
Ref: "userFavorites"."productID" < "products"."productID" Ref: "userFavorites"."productID" < "products"."productID"
Table priceAlerts { Table priceAlerts
{
alertID int [pk] alertID int [pk]
userID int userID int
productID int productID int
@ -115,7 +136,8 @@ Table priceAlerts {
Ref: "priceAlerts"."userID" < "users"."userID" Ref: "priceAlerts"."userID" < "users"."userID"
Ref: "priceAlerts"."productID" < "products"."productID" Ref: "priceAlerts"."productID" < "products"."productID"
Table notifications { Table notifications
{
notificationID int [pk] notificationID int [pk]
userID int userID int
title varchar(255) title varchar(255)
@ -126,7 +148,8 @@ Table notifications {
Ref: "notifications"."userID" < "users"."userID" Ref: "notifications"."userID" < "users"."userID"
Table reviews { Table reviews
{
reviewID int [pk] reviewID int [pk]
userID int userID int
productID int productID int
@ -138,7 +161,8 @@ Table reviews {
Ref: "reviews"."userID" < "users"."userID" Ref: "reviews"."userID" < "users"."userID"
Ref: "reviews"."productID" < "products"."productID" Ref: "reviews"."productID" < "products"."productID"
Table userSessions { Table userSessions
{
sessionID varchar(128) [pk] sessionID varchar(128) [pk]
userID int userID int
expiresAt timestamp expiresAt timestamp

View File

@ -39,7 +39,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST')
$uname = trim($_POST['uname']); $uname = trim($_POST['uname']);
} }
$pw = isset($_POST['pw']) ? $_POST['pw'] : ''; if (isset($_POST['pw']))
{
$pw = $_POST['pw'];
}
else
{
$pw = '';
}
// Basic Validierung // Basic Validierung
if ($uname === '' || $pw === '') if ($uname === '' || $pw === '')

30
logout.php Normal file
View File

@ -0,0 +1,30 @@
<?php
session_start();
/* Alle Session-Variablen löschen */
$_SESSION = [];
/* Session-Cookie löschen (wichtig!) */
if (ini_get("session.use_cookies")) {
$params = session_get_cookie_params();
setcookie(
session_name(),
'',
time() - 42000,
$params["path"],
$params["domain"],
$params["secure"],
$params["httponly"]
);
}
/* Session zerstören */
session_destroy();
/* Optional: Remember-Me Cookie löschen (falls vorhanden)
setcookie("remember_token", "", time() - 3600, "/");
*/
header("Location: login.php");
exit();

View File

@ -42,7 +42,10 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
a.dataType, a.dataType,
pa.valueString, pa.valueString,
pa.valueNumber, pa.valueNumber,
pa.valueBool pa.valueBool,
p.model,
p.description,
p.imagePath
FROM products p FROM products p
INNER JOIN categoryAttributes ca INNER JOIN categoryAttributes ca
@ -68,18 +71,45 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
$product = $result->fetch_assoc(); $product = $result->fetch_assoc();
?> ?>
<?php <div class="product-wrapper">
while ($row = $result->fetch_assoc()) { <!-- LINKER BEREICH BILD -->
echo "<p><strong>{$row['name']}:</strong> "; <div class="product-left">
<div class="product-image-box">
<img
src="<?= isset($product['imagePath']) ? $product['imagePath'] : 'assets/images/placeholder.png' ?>"
alt="<?= htmlspecialchars($product['model'] ?? 'Produktbild') ?>">
</div>
</div>
if (!empty($row['valueString'])) echo $row['valueString']; <!-- RECHTER BEREICH DETAILS -->
if (!empty($row['valueNumber'])) echo $row['valueNumber'] . " " . $row['unit']; <div class="product-right">
if (!is_null($row['valueBool'])) echo $row['valueBool'] ? "Ja" : "Nein";
echo "</p>"; <h1 class="product-title">
} <?= htmlspecialchars($product['model'] ?? 'Produkt') ?>
</h1>
?> <div class="product-specs">
<div class="product-desc">
<?= htmlspecialchars($product['description']) ?>
</div>
<?php
while ($row = $result->fetch_assoc()) {
echo "<p><strong>{$row['name']}:</strong> ";
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 "</p>";
}
?>
</div>
</div>
</div>
<?php $stmt->close(); ?> <?php $stmt->close(); ?>
@ -91,7 +121,7 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="assets/css/compcard.css"> <link rel="stylesheet" href="assets/css/productpage.css">
</head> </head>
<?php include 'footer.php'; ?> <?php include 'footer.php'; ?>