From a8f2bace985ee0419492a09e1d5a3879f2f5b96b Mon Sep 17 00:00:00 2001 From: arf20 Date: Wed, 20 Mar 2024 20:00:31 +0100 Subject: Ticketing system --- client.php | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'client.php') diff --git a/client.php b/client.php index dbab9e8..2a9721d 100644 --- a/client.php +++ b/client.php @@ -29,6 +29,15 @@ mysqli_stmt_execute($stmt); $result = mysqli_stmt_get_result($stmt); $services = $result->fetch_all(MYSQLI_ASSOC); +// Get tickets +$sql = "SELECT id, `order`, subject, body, date, status, asignee FROM tickets WHERE `order` IN (SELECT id FROM orders WHERE client = ?)"; +$stmt = mysqli_prepare($link, $sql); +mysqli_stmt_bind_param($stmt, "s", $param_client); +$param_client = $clientid; +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) { @@ -38,6 +47,15 @@ function getservicebyid($id) { } } +function getorderbyid($id) { + global $orders; + foreach ($orders as $order) { + if ($order["id"] == $id) { + return $order; + } + } +} + ?> @@ -61,17 +79,24 @@ function getservicebyid($id) {

Orders

- + \n"; + echo "\n"; } ?>
serviceinstancebillingcommentsstatus
instanceservicebillingcommentsstatus
".getservicebyid($order["service"])["name"]."".$order["name"]."".$order["billing"]."
".$order["comments"]."
".$order["status"]."
".$order["name"]."".getservicebyid($order["service"])["name"]."".$order["billing"]."
".$order["comments"]."
".$order["status"]."

Tickets

- + + + \n"; + } + ?> +
ordersubjectbodydatestatus
".getorderbyid($ticket["order"])["name"]."".$ticket["subject"]."
".$ticket["body"]."
".$ticket["date"]."".$ticket["status"]."
-- cgit v1.2.3