Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
843660c8c9
@ -104,12 +104,20 @@ include 'header.php';
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="auth__card">
|
||||
<form>
|
||||
<a href="productAdder.php" class="auth__actions"> <br>
|
||||
<button class="auth__submit" type="button"">Produkt hinzufügen</button>
|
||||
</a>
|
||||
</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>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -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)
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
10
login.php
10
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 === '')
|
||||
|
||||
30
logout.php
Normal file
30
logout.php
Normal 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();
|
||||
|
||||
@ -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,8 +71,33 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
||||
$product = $result->fetch_assoc();
|
||||
?>
|
||||
|
||||
<div class="product-wrapper">
|
||||
<!-- LINKER BEREICH – BILD -->
|
||||
<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>
|
||||
|
||||
<!-- RECHTER BEREICH – DETAILS -->
|
||||
<div class="product-right">
|
||||
|
||||
<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'];
|
||||
@ -78,8 +106,10 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
||||
|
||||
echo "</p>";
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php $stmt->close(); ?>
|
||||
@ -91,7 +121,7 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
||||
<meta charset="UTF-8">
|
||||
<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>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
Loading…
Reference in New Issue
Block a user