diff --git a/index.php b/index.php index c565034..dee1982 100644 --- a/index.php +++ b/index.php @@ -37,8 +37,8 @@ if ($result === false) {
fetch_assoc()): ?>
- Immagine prodotto -

+
Immagine prodotto
+

" . htmlspecialchars($row['ProductName']) . ""; ?>

diff --git a/product.php b/product.php new file mode 100644 index 0000000..fc65de3 --- /dev/null +++ b/product.php @@ -0,0 +1,65 @@ +prepare($sql)) { + $stmt->bind_param("i", $product_id); + $stmt->execute(); + $result = $stmt->get_result(); + $product = $result->fetch_assoc(); + $stmt->close(); +} else { + die("Errore nella query: " . $conn->error); +} +?> + + + + + + + num_rows > 0): ?> + TechStore - <?php echo htmlspecialchars($result->fetch_assoc()['CategoryName']); ?> + + Prodotto non trovato - TechStore + + + + +
+ +
+ + + + Benvenuto, + + + +
+
+ + +
+ Immagine prodotto +
+

+

Categoria:

+

Descrizione:

+

Prezzo:

+

Quantità disponibile:

+ +
+
+ +

Prodotto non trovato.

+ + + close(); ?> + + diff --git a/style.css b/style.css index 9496f38..1755d0b 100644 --- a/style.css +++ b/style.css @@ -88,4 +88,56 @@ form button { form button:hover { background-color: #218838; +} + +/* Stili per la pagina prodotto */ +.product-detail { + max-width: 800px; + margin: 20px auto; + padding: 20px; + border: 1px solid #ddd; + border-radius: 8px; + background-color: #fff; + display: flex; + flex-direction: column; +} + +.product-detail img { + max-width: 100%; + height: auto; + object-fit: contain; + margin-bottom: 20px; + flex-shrink: 0; +} + +.product-detail > div { + flex: 1; +} + +@media (min-width: 768px) { + .product-detail { + flex-direction: row; + } + + .product-detail img { + max-width: 40%; + margin-bottom: 0; + margin-right: 20px; + } +} + +.img-square { + position: relative; + width: 100%; + padding-top: 100%; /* crea un quadrato perfetto */ + overflow: hidden; +} + +.img-square img { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + object-fit: contain; /* o "cover" */ } \ No newline at end of file