From 52ea1e0c9375c3e848e5b61982735853ebbf35ab Mon Sep 17 00:00:00 2001 From: Andrea Fiorencis Date: Wed, 1 Apr 2026 11:37:44 +0200 Subject: [PATCH 1/4] Aggiunto link pagina prodotto a prodotti homepage --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index c565034..bf77aa9 100644 --- a/index.php +++ b/index.php @@ -37,8 +37,8 @@ if ($result === false) {
fetch_assoc()): ?>
- Immagine prodotto -

+ Immagine prodotto +

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

From a5b4ddd6557aa95ebbf15fdaef254f28af372cb2 Mon Sep 17 00:00:00 2001 From: Andrea Fiorencis Date: Wed, 1 Apr 2026 12:22:27 +0200 Subject: [PATCH 2/4] Implementazione primo prototipo pagina prodotto singolo --- product.php | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++ style.css | 35 +++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 product.php 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 65faa83..cebf452 100644 --- a/style.css +++ b/style.css @@ -85,4 +85,39 @@ 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; + 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; + } } \ No newline at end of file From ec04543775415c7ad9dda799f38298d3340d093c Mon Sep 17 00:00:00 2001 From: Andrea Fiorencis Date: Wed, 1 Apr 2026 12:27:52 +0200 Subject: [PATCH 3/4] Fix altezza immagini non costante in homepage --- index.php | 2 +- style.css | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index bf77aa9..dee1982 100644 --- a/index.php +++ b/index.php @@ -37,7 +37,7 @@ if ($result === false) {
fetch_assoc()): ?>
- Immagine prodotto +
Immagine prodotto

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

diff --git a/style.css b/style.css index d51710d..575e933 100644 --- a/style.css +++ b/style.css @@ -123,4 +123,20 @@ form button:hover { 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 From 7e05dedb9ad20ee6d7bd9328a040bec7436033e6 Mon Sep 17 00:00:00 2001 From: Andrea Fiorencis Date: Wed, 1 Apr 2026 12:34:28 +0200 Subject: [PATCH 4/4] Fix stretch immagine in pagina prodotto --- style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/style.css b/style.css index 575e933..1755d0b 100644 --- a/style.css +++ b/style.css @@ -105,6 +105,7 @@ form button:hover { .product-detail img { max-width: 100%; height: auto; + object-fit: contain; margin-bottom: 20px; flex-shrink: 0; }