From 0cb2a90f5422ca5c2f04ecf986a555c758afae61 Mon Sep 17 00:00:00 2001 From: arf20 Date: Mon, 18 Mar 2024 19:47:44 +0100 Subject: Client sees orders, order status --- client.php | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'client.php') diff --git a/client.php b/client.php index 615aac3..5d33ba2 100644 --- a/client.php +++ b/client.php @@ -7,11 +7,37 @@ if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){ exit; } +$clientid = $_SESSION["id"]; $username = $_SESSION["username"]; $type = $_SESSION["type"]; require_once "config.php"; +// Get orders +$sql = "SELECT id, service, name, billing 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); +$orders = $result->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); + +function getservicebyid($id) { + global $services; + foreach ($services as $service) { + if ($service["id"] == $id) { + return $service; + } + } +} + ?> @@ -34,7 +60,14 @@ require_once "config.php";

Active services

- + + + \n"; + } + ?> +
serviceinstancebilling
".getservicebyid($order["service"])["name"]."".$order["name"]."".$order["billing"]."

Tickets

-- cgit v1.2.3