From ec7700456c646b9089f63a272cf15ff4ea5895d6 Mon Sep 17 00:00:00 2001 From: arf20 Date: Wed, 20 Mar 2024 17:39:02 +0100 Subject: Add tickets to admin page --- admin.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'admin.php') diff --git a/admin.php b/admin.php index 2aeebe1..f70ed7b 100644 --- a/admin.php +++ b/admin.php @@ -35,6 +35,13 @@ mysqli_stmt_execute($stmt); $result = mysqli_stmt_get_result($stmt); $orders = $result->fetch_all(MYSQLI_ASSOC); +// Get tickets +$sql = "SELECT id, `order`, subject FROM tickets"; +$stmt = mysqli_prepare($link, $sql); +mysqli_stmt_execute($stmt); +$result = mysqli_stmt_get_result($stmt); +$tickets = $result->fetch_all(MYSQLI_ASSOC); + function getservicebyid($id) { global $services; foreach ($services as $service) { @@ -53,6 +60,15 @@ function getclientbyid($id) { } } +function getorderbyid($id) { + global $orders; + foreach ($orders as $order) { + if ($order["id"] == $id) { + return $order; + } + } +} + ?> @@ -108,7 +124,14 @@ function getclientbyid($id) {

Tickets

- + + + \n"; + } + ?> +
orderclientsubject
".getorderbyid($ticket["order"])["name"]."".getclientbyid(getorderbyid($ticket["order"])["client"])["username"]."".$ticket["subject"]."

Invoices

-- cgit v1.2.3