From 15d433f1d988b20a747ecfcd2f2d81c653bcd9dd Mon Sep 17 00:00:00 2001 From: johnnyq Date: Tue, 12 Sep 2023 12:06:02 -0400 Subject: [PATCH] Invoice are now searchable via global search --- global_search.php | 63 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 4 deletions(-) diff --git a/global_search.php b/global_search.php index a75c8c65..8e266e0d 100644 --- a/global_search.php +++ b/global_search.php @@ -21,6 +21,10 @@ if (isset($_GET['query'])) { $sql_tickets = mysqli_query($mysqli, "SELECT * FROM tickets LEFT JOIN clients on tickets.ticket_client_id = clients.client_id WHERE (ticket_subject LIKE '%$query%' OR ticket_number = '$ticket_num_query') ORDER BY ticket_id DESC LIMIT 5"); $sql_logins = mysqli_query($mysqli, "SELECT * FROM logins WHERE (login_name LIKE '%$query%' OR login_description LIKE '%$query%') ORDER BY login_id DESC LIMIT 5"); + $sql_invoices = mysqli_query($mysqli, "SELECT * FROM invoices LEFT JOIN clients ON invoice_client_id = client_id LEFT JOIN categories ON invoice_category_id = category_id + WHERE (CONCAT(invoice_prefix,invoice_number) LIKE '%$query%' OR invoice_scope LIKE '%$query%') ORDER BY invoice_number DESC LIMIT 5" +); + $q = nullable_htmlentities($_GET['query']); ?> @@ -266,8 +270,8 @@ if (isset($_GET['query'])) { Ticket ID Description - Client Status + Client @@ -278,16 +282,16 @@ if (isset($_GET['query'])) { $ticket_prefix = nullable_htmlentities($row['ticket_prefix']); $ticket_number = intval($row['ticket_number']); $ticket_subject = nullable_htmlentities($row['ticket_subject']); - $ticket_client = nullable_htmlentities($row['client_name']); $ticket_status = nullable_htmlentities($row['ticket_status']); + $client_name = nullable_htmlentities($row['client_name']); + $client_id = intval($row['ticket_client_id']); ?> - - + @@ -342,6 +346,57 @@ if (isset($_GET['query'])) { + + + + + + + + + 0) { ?> + + + +
+
+
+
Invoices
+
+
+ + + + + + + + + + + + + + + + + + + + +
NumberStatusAmountClient