diff options
author | arf20 <aruizfernandez05@gmail.com> | 2024-03-24 17:13:39 +0100 |
---|---|---|
committer | arf20 <aruizfernandez05@gmail.com> | 2024-03-24 17:13:39 +0100 |
commit | c4018e9cec9662a8828ec2184e0830624ff413a4 (patch) | |
tree | ee228cc29f56fb1d5067d81a1c2a81199f1c7d86 | |
parent | 94b5e9d37cbc5e030f9fbba865b7205b872be365 (diff) | |
download | arfnet2-cstims-c4018e9cec9662a8828ec2184e0830624ff413a4.tar.gz arfnet2-cstims-c4018e9cec9662a8828ec2184e0830624ff413a4.zip |
Show invoices in admin dashboard
-rw-r--r-- | admin.php | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -42,6 +42,13 @@ mysqli_stmt_execute($stmt); $result = mysqli_stmt_get_result($stmt); $tickets = $result->fetch_all(MYSQLI_ASSOC); +// Get invoices +$sql = "SELECT id, client, `desc`, amount, date, status FROM invoices"; +$stmt = mysqli_prepare($link, $sql); +mysqli_stmt_execute($stmt); +$result = mysqli_stmt_get_result($stmt); +$invoices = $result->fetch_all(MYSQLI_ASSOC); + function getservicebyid($id) { global $services; foreach ($services as $service) { @@ -135,7 +142,14 @@ function getorderbyid($id) { </div> <div class="col2"> <h3>Invoices</h3> - <!-- TODO PHP list of services --> + <table> + <tr><th>client</th><th>amount</th></tr> + <?php + foreach ($invoices as $invoice) { + echo "<tr><td>".getclientbyid($invoice["client"])["username"]."</td><td>".number_format($invoice["amount"], 2, '.', '')."€</tr>\n"; + } + ?> + </table> </div> </div> </div> |