Compare commits
5 Commits
e13e8a6004
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 2157c04381 | |||
| 330feed202 | |||
| caed718bc6 | |||
| 5f276c6ba5 | |||
| 9855ecf111 |
@@ -40,7 +40,6 @@ fclose($file);
|
||||
echo "<tr><td>" . $utenti[$i]->id . "</td><td><a href=\"ordini.php?id=" . $utenti[$i]->id ."\">" . $utenti[$i]->name . "</a></td><td><a href=\"mailto:" . $utenti[$i]->email ."\">" . $utenti[$i]->email . "</a></tr>";
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
25
ordini.php
25
ordini.php
@@ -18,7 +18,7 @@ fgets($file);
|
||||
while (($linea = fgets($file)) !== false) {
|
||||
$campi = explode(",", $linea);
|
||||
if($campi[1] == $requestedId){
|
||||
array_push($ordini, new User($campi[0], $campi[2], $campi[3]));
|
||||
array_push($ordini, new User($campi[0], $campi[2], floatval($campi[3])));
|
||||
}
|
||||
}
|
||||
fclose($file);
|
||||
@@ -31,19 +31,18 @@ fclose($file);
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>ID Ordine</th>
|
||||
<th>Prodotto</th>
|
||||
<th>Importo</th>
|
||||
</tr>
|
||||
<?php
|
||||
<p><a href="index.php">Torna alla lista</a></p>
|
||||
<?php
|
||||
if(count($ordini) == 0){
|
||||
echo "<p>Nessun ordine associato all'utente</p>";
|
||||
}
|
||||
else{
|
||||
echo "<table><tr><th>ID Ordine</th><th>Prodotto</th><th>Importo</th></tr>";
|
||||
for($i=0; $i<count($ordini); $i++){
|
||||
echo "<tr><td>" . $ordini[$i]->id . "</td><td>" . $ordini[$i]->product . "</td><td>" . $ordini[$i]->importo . "</td></tr>";
|
||||
echo "<tr><td>" . $ordini[$i]->id . "</td><td>" . $ordini[$i]->product . "</td><td>" . number_format($ordini[$i]->importo,2,",",".") . "€</td></tr>";
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
echo "</table>";
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user