fetch_all(MYSQLI_ASSOC); // Get services $sql = "SELECT id, name, type, billing FROM services"; $stmt = mysqli_prepare($link, $sql); 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) { if ($service["id"] == $id) { return $service; } } } function getorderbyid($id) { global $orders; foreach ($orders as $order) { if ($order["id"] == $id) { return $order; } } } ?> ARFNET CSTIMS
ARFNET

ARFNET Client Service Ticket and Invoice Management System

panel

Orders

\n"; } ?>
instanceservicebillingcommentsstatus
".$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"]."