From b7f96ba7e2d161e5223965d9207d97a9c7dcd629 Mon Sep 17 00:00:00 2001 From: Andrea Fiorencis Date: Fri, 20 Mar 2026 11:26:31 +0100 Subject: [PATCH 1/6] Aggiunta pagina web base (mostra tabella con tutti i campi di Products) --- index.php | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 index.php diff --git a/index.php b/index.php new file mode 100644 index 0000000..aaa03a9 --- /dev/null +++ b/index.php @@ -0,0 +1,66 @@ +query($sql); + +if ($result === false) { + die("Errore nella query: " . $conn->error); +} +?> + + + + + + + TechStore - Prodotti + + + +

Prodotti TechStore

+ + num_rows > 0): ?> + + + + fetch_fields(); + foreach ($fields as $field) { + echo ""; + } + ?> + + + + fetch_assoc()): ?> + + + + + + + +
" . htmlspecialchars($field->name) . "
+ +

Nessun prodotto trovato.

+ + + close(); ?> + + From 7e80c743e50769893d5acd9d2f4e44dcb534f5c3 Mon Sep 17 00:00:00 2001 From: Andrea Fiorencis Date: Fri, 20 Mar 2026 11:47:11 +0100 Subject: [PATCH 2/6] Aggiunta header (implementazione base) --- index.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.php b/index.php index aaa03a9..337a43e 100644 --- a/index.php +++ b/index.php @@ -32,6 +32,13 @@ if ($result === false) { +
+ +
+ + +
+

Prodotti TechStore

num_rows > 0): ?> From f357d509a83debac6c6fedf06a1bf51505218b0b Mon Sep 17 00:00:00 2001 From: Andrea Fiorencis Date: Fri, 20 Mar 2026 11:59:06 +0100 Subject: [PATCH 3/6] Modifica query SQL homepage --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 337a43e..3c2969a 100644 --- a/index.php +++ b/index.php @@ -2,7 +2,7 @@ include 'db_conf.php'; // Query per ottenere tutti i prodotti -$sql = "SELECT * FROM Products"; +$sql = "SELECT p.ProductID, p.ProductName, c.Name AS 'CategoryName', p.Description, p.Price, p.StockQuantity FROM Products p JOIN Categories c ON p.CategoryID=c.CategoryID"; $result = $conn->query($sql); if ($result === false) { From 457c933089db0f6dec105798e585297d61b50886 Mon Sep 17 00:00:00 2001 From: Andrea Fiorencis Date: Wed, 25 Mar 2026 10:51:13 +0100 Subject: [PATCH 4/6] Transizione da tabella a griglia prodotti --- index.php | 76 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 31 deletions(-) diff --git a/index.php b/index.php index 3c2969a..7300b97 100644 --- a/index.php +++ b/index.php @@ -2,7 +2,7 @@ include 'db_conf.php'; // Query per ottenere tutti i prodotti -$sql = "SELECT p.ProductID, p.ProductName, c.Name AS 'CategoryName', p.Description, p.Price, p.StockQuantity FROM Products p JOIN Categories c ON p.CategoryID=c.CategoryID"; +$sql = "SELECT p.ProductID, p.ProductName, c.Name AS 'CategoryName', p.Description, p.Price, p.StockQuantity, p.ImagePath FROM Products p JOIN Categories c ON p.CategoryID=c.CategoryID"; $result = $conn->query($sql); if ($result === false) { @@ -17,17 +17,43 @@ if ($result === false) { TechStore - Prodotti @@ -42,28 +68,16 @@ if ($result === false) {

Prodotti TechStore

num_rows > 0): ?> - - - - fetch_fields(); - foreach ($fields as $field) { - echo ""; - } - ?> - - - - fetch_assoc()): ?> - - - - - - - -
" . htmlspecialchars($field->name) . "
+
+ fetch_assoc()): ?> +
+ Immagine prodotto +

+

+ +
+ +

Nessun prodotto trovato.

From 1e5431d17520c934efa242472cb0095653a5688e Mon Sep 17 00:00:00 2001 From: Andrea Fiorencis Date: Wed, 25 Mar 2026 10:54:13 +0100 Subject: [PATCH 5/6] Rimozione intestazione "Prodotti TechStore" --- index.php | 1 - 1 file changed, 1 deletion(-) diff --git a/index.php b/index.php index 7300b97..135569b 100644 --- a/index.php +++ b/index.php @@ -65,7 +65,6 @@ if ($result === false) { -

Prodotti TechStore

num_rows > 0): ?>
From c945ec2cafd9e1002be8609b3640246ddf6df04a Mon Sep 17 00:00:00 2001 From: Andrea Fiorencis Date: Wed, 25 Mar 2026 11:21:17 +0100 Subject: [PATCH 6/6] Spostamento stylesheet su file separato --- index.php | 41 +---------------------------------------- style.css | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 40 deletions(-) create mode 100644 style.css diff --git a/index.php b/index.php index 135569b..20d6f9e 100644 --- a/index.php +++ b/index.php @@ -16,46 +16,7 @@ if ($result === false) { TechStore - Prodotti - +
diff --git a/style.css b/style.css new file mode 100644 index 0000000..a741172 --- /dev/null +++ b/style.css @@ -0,0 +1,38 @@ +.products-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); + gap: 20px; + padding: 20px; +} +.product-card { + border: 1px solid #ddd; + border-radius: 8px; + padding: 16px; + text-align: center; + background-color: #fff; +} +.product-card img { + max-width: 100%; + height: auto; + margin-bottom: 10px; +} +.product-card h3 { + margin: 10px 0; + font-size: 18px; +} +.product-card p { + margin: 5px 0; + color: #666; +} +.product-card button { + padding: 8px 16px; + background-color: #007bff; + color: white; + border: none; + border-radius: 4px; + cursor: pointer; + margin-top: 10px; +} +.product-card button:hover { + background-color: #0056b3; +} \ No newline at end of file