Cambiata pagina index lista consumer da form con select a tabella

This commit is contained in:
2026-02-27 11:07:33 +01:00
parent c0efd68ace
commit 15719977d4

View File

@@ -62,14 +62,15 @@ $result = mysqli_query($conn, $sql);
} }
} }
if(!isset($_GET["customerId"]) && !isset($_GET["orderId"])){ if(!isset($_GET["customerId"]) && !isset($_GET["orderId"])){
echo "<form method='GET' action='index.php'>"; echo "<table>";
echo "<select id='customerId' name='customerId'>";
while ($row = mysqli_fetch_assoc($result)) { while ($row = mysqli_fetch_assoc($result)) {
echo "<option value='" . $row['CustomerID'] . "'>" . $row['CustomerID'] . " - " . $row['CustomerName'] . "</option>"; echo "<tr>";
echo "<td>" . $row['CustomerID'] . "</td>" ;
echo "<td>" . $row['CustomerName'] . "</td>" ;
echo "<td><a href='index.php?customerId=" . $row['CustomerID'] . "'>Visualizza Ordini</a></td>" ;
echo "</tr>";
} }
echo "</select>"; echo "</table>";
echo "<input type='submit' value='Visualizza Ordini'>";
echo "</form>";
} }
} }
?> ?>