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 ++++++++++++++++++++++++- manageorders.php | 4 ---- 2 files changed, 24 insertions(+), 5 deletions(-) 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

diff --git a/manageorders.php b/manageorders.php index a1ff0a0..90e0efa 100644 --- a/manageorders.php +++ b/manageorders.php @@ -136,10 +136,6 @@ function getclientbyid($id) { if (isset($_GET["edit"])) { $order = getorderbyid($_GET["edit"]); $client_options = $service_options = ""; - /*foreach ($clients as $client) - $client_options .= ""; - foreach ($services as $service) - $service_options .= "";*/ echo "

Edit order ".$order["id"]."

\n" ."

\n" ."

\n" -- cgit v1.2.3