Files
frisoer-anwendung/app/list/auftrag.php
2021-06-21 10:22:02 +02:00

67 lines
1.3 KiB
PHP

<?php
include '../head.php';
echo '<h1>Auftrags Übersicht</h1>';
?>
<table >
<tr>
<th>Auftrags Nr.</th>
<th>Datum</th>
<th>Uhrzeit</th>
<th>Preis</th>
<th>Funktionen</th>
</tr>
<?php
include '../connect.php';
$query="select * from auftrag";
$result=$sql->query($query);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$id=$row["Auftragsnummer"];
$datum=$row["Datum"];
$zeit=$row["Zeit"];
$price=$row["GesamtPreis"];
echo "<tr>
<td>$id</td>
<td>$datum</td>
<td>$zeit</td>
<td>$price</td>
<td><a href='/view/auftrag.php?id=$id'>Details</a></td>
</tr>";
}
} else {
echo "<p> 0 results </p>";
}
?>
</table>
<fieldset>
<legend style="border: 1px black solid;margin-left: 1em; padding: 0.2em 0.8em ">Auftrag hinzufügen</legend>
<form action='/action/add-auftrag.php?id=$id' method='post'>
<label for=datum>Datum: </label>
<input name="Datum" id="datum" type="date"><br>
<label for=zeit>Zeit: </label>
<input name="Zeit" id="zeit" type="time"><br>
<label for=nummer>Kundennummer: </label>
<input name="Kundennummer" id="nummer" type="number"><br>
<input type="submit" value="Auftrag hinzufügen">
</form>
</fieldset>
<?php
include '../tail.php';
?>