diff --git a/index.php b/index.php index 65e5363..fccb727 100644 --- a/index.php +++ b/index.php @@ -34,29 +34,34 @@ $result = mysqli_query($conn, $sql);
Ordini del cliente " . $customer_id . ""; + if((isset($_GET["customerId"]) || isset($_GET["orderId"])) && mysqli_num_rows($result) > 0) { + echo ""; + # Reset index della query + mysqli_data_seek($result, 0); + } + if(isset($_GET["orderId"])){ echo "| Il cliente ". $customer_id ." non ha ordini | "; - } - else { - echo "ID Ordine | "; - } + echo "ID Prodotto | Nome Prodotto | Quantità per unità | Prezzo | Quantità ordinata | "; echo "
|---|---|---|---|---|---|---|
| " . $row['OrderID'] ." | " ; + echo "" . $row['ProductID'] . " | " ; + echo "" . $row['ProductName'] . " | " ; + echo "" . $row['Unit'] . " | "; + echo "" . $row['Price'] . "$ | " ; + echo "" . $row['order_quantity'] . " | "; echo "