Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
a3ff170d64
@ -98,10 +98,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['delete_review']) && i
|
||||
p.categoryID
|
||||
FROM products p
|
||||
|
||||
INNER JOIN categoryAttributes ca
|
||||
LEFT JOIN categoryAttributes ca
|
||||
ON p.categoryID = ca.categoryID
|
||||
|
||||
INNER JOIN attributes a
|
||||
LEFT JOIN attributes a
|
||||
ON ca.attributeID = a.attributeID
|
||||
|
||||
LEFT JOIN productAttributes pa
|
||||
@ -119,6 +119,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['delete_review']) && i
|
||||
|
||||
$result = $stmt->get_result();
|
||||
$product = $result->fetch_assoc();
|
||||
if (!$product) {
|
||||
die("Produkt nicht gefunden.");
|
||||
}
|
||||
$categoryId = $product['categoryID'];
|
||||
|
||||
/**
|
||||
@ -357,7 +360,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
|
||||
<div class="product-specs">
|
||||
<div class="product-desc">
|
||||
<?= htmlspecialchars($product['description']) ?>
|
||||
<?= htmlspecialchars($product['description'] ?? '') ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
@ -366,10 +369,18 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
* @details Iteriert durch die vorab geladenen Attribute und formatiert die Ausgabe
|
||||
* entsprechend den Datentypen (String, Number, Boolean).
|
||||
*/
|
||||
if (!empty($product['name'])) {
|
||||
echo "<p><strong>{$product['name']}:</strong> ";
|
||||
if (!empty($product['valueString'])) echo htmlspecialchars($product['valueString']);
|
||||
if (!empty($product['valueNumber'])) echo htmlspecialchars($product['valueNumber'] . " " . $product['unit']);
|
||||
if (!is_null($product['valueBool'])) echo $product['valueBool'] ? "Ja" : "Nein";
|
||||
echo "</p>";
|
||||
}
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
if (empty($row['name'])) continue;
|
||||
echo "<p><strong>{$row['name']}:</strong> ";
|
||||
if (!empty($row['valueString'])) echo $row['valueString'];
|
||||
if (!empty($row['valueNumber'])) echo $row['valueNumber'] . " " . $row['unit'];
|
||||
if (!empty($row['valueString'])) echo htmlspecialchars($row['valueString']);
|
||||
if (!empty($row['valueNumber'])) echo htmlspecialchars($row['valueNumber'] . " " . $row['unit']);
|
||||
if (!is_null($row['valueBool'])) echo $row['valueBool'] ? "Ja" : "Nein";
|
||||
echo "</p>";
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user