From 26a681f8c0ac001b4b282a49fa10de4706c2e3e9 Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Fri, 14 Jan 2022 16:02:57 +0000 Subject: [PATCH 1/7] Add password show/hide --- global_search.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/global_search.php b/global_search.php index b70caa4a..838c62b5 100644 --- a/global_search.php +++ b/global_search.php @@ -152,11 +152,13 @@ if(isset($_GET['query'])){ $login_name = $row['login_name']; $login_username = $row['login_username']; $login_password = decryptLoginEntry($row['login_password']); + ?> - + + From 62d32bbb1200f3c49e4bbdf006af2d0b6444af1f Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Fri, 14 Jan 2022 16:07:10 +0000 Subject: [PATCH 2/7] Comments --- global_search.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/global_search.php b/global_search.php index 838c62b5..568c02c3 100644 --- a/global_search.php +++ b/global_search.php @@ -16,7 +16,9 @@ if(isset($_GET['query'])){

Welcome to Global Search...


- + + +
@@ -61,6 +63,7 @@ if(isset($_GET['query'])){
+
@@ -96,6 +99,7 @@ if(isset($_GET['query'])){
+
@@ -131,6 +135,7 @@ if(isset($_GET['query'])){
+
From 6c673571d27c04abcf5ff8ab723774633a281c10 Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Fri, 14 Jan 2022 17:22:53 +0000 Subject: [PATCH 3/7] Hyperlink names --- global_search.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/global_search.php b/global_search.php index 568c02c3..1d4f2e77 100644 --- a/global_search.php +++ b/global_search.php @@ -11,6 +11,7 @@ if(isset($_GET['query'])){ $sql_products = mysqli_query($mysqli,"SELECT * FROM products WHERE product_name LIKE '%$query%' AND company_id = $session_company_id ORDER BY product_id DESC LIMIT 5"); $sql_logins = mysqli_query($mysqli,"SELECT * FROM logins WHERE login_name LIKE '%$query%' AND company_id = $session_company_id ORDER BY login_id DESC LIMIT 5"); + $q = htmlentities($_GET['query']); ?>

Welcome to Global Search...

@@ -75,6 +76,7 @@ if(isset($_GET['query'])){ Name Description + Phone @@ -83,10 +85,12 @@ if(isset($_GET['query'])){ while($row = mysqli_fetch_array($sql_vendors)){ $vendor_name = $row['vendor_name']; $vendor_description = $row['vendor_description']; + $vendor_phone = $row['vendor_phone']; ?> - + + - + @@ -155,12 +159,13 @@ if(isset($_GET['query'])){ while($row = mysqli_fetch_array($sql_logins)){ $login_name = $row['login_name']; + $login_client_id = $row['login_client_id']; $login_username = $row['login_username']; $login_password = decryptLoginEntry($row['login_password']); ?> - + From 227cf0591afcfc0c892e5b03d67c855c3b3d87a8 Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Fri, 14 Jan 2022 17:42:24 +0000 Subject: [PATCH 4/7] Add basic ticket search - would need further work to search by a ticket ID with a prefix. Possibly encourage a default prefix so we can filter that out? --- global_search.php | 385 ++++++++++++++++++++++++++-------------------- 1 file changed, 214 insertions(+), 171 deletions(-) diff --git a/global_search.php b/global_search.php index 1d4f2e77..76f64703 100644 --- a/global_search.php +++ b/global_search.php @@ -1,188 +1,231 @@ - + $q = htmlentities($_GET['query']); + ?> -

Welcome to Global Search...

-
-
+

Welcome to Global Search...

+
+
- + -
-
-
-
Clients
-
-
- - - - - - - - - - 2){ - $location_phone = substr($row['location_phone'],0,3)."-".substr($row['location_phone'],3,3)."-".substr($row['location_phone'],6,4); - } - //$client_email = $row['client_email']; - $client_website = $row['client_website']; +
+
+
+
Clients
+
+
+
NameEmailPhone
+ + + + + + + + + - - - - - + while($row = mysqli_fetch_array($sql_clients)){ + $client_id = $row['client_id']; + $client_name = $row['client_name']; + $location_phone = $row['location_phone']; + if(strlen($location_phone)>2){ + $location_phone = substr($row['location_phone'],0,3)."-".substr($row['location_phone'],3,3)."-".substr($row['location_phone'],6,4); + } + //$client_email = $row['client_email']; + $client_website = $row['client_website']; - + ?> + + + + + + + + + +
NameEmailPhone
+
+
+
+ + +
+
+
+
Vendors
+
+
+ + + + + + + + + + + + + + + + + + + +
NameDescriptionPhone
+
+
+
+ + +
+
+
+
Products
+
+
+ + + + + + + + + + + + + + + + + +
NameDescription
+
+
+
+ + +
+
+
+
Logins
+
+
+ + + + + + + + + + + + + + + + + + + + + +
DescriptionUsernamePassword
+
+
+
+ + +
+
+
+
Tickets
+
+
+ + + + + + + + + + + + + + + + + + + + +
DescriptionClientStatus
+
+
+
- - -
-
- - -
-
-
-
Vendors
-
-
- - - - - - - - - - - - - - - - - - - -
NameDescriptionPhone
-
-
-
- - -
-
-
-
Products
-
-
- - - - - - - - - - - - - - - - - -
NameDescription
-
-
-
- - -
-
-
-
Logins
-
-
- - - - - - - - - - - - - - - - - - - - - -
DescriptionUsernamePassword
-
-
-
- -
From a65f6d3f7f4a805168e2343e80504a2709dfcc9d Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Fri, 14 Jan 2022 17:53:14 +0000 Subject: [PATCH 5/7] Search on login username too --- global_search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global_search.php b/global_search.php index 76f64703..9759a044 100644 --- a/global_search.php +++ b/global_search.php @@ -9,7 +9,7 @@ if(isset($_GET['query'])){ $sql_clients = mysqli_query($mysqli,"SELECT * FROM clients LEFT JOIN locations ON clients.client_id = locations.location_client_id WHERE client_name LIKE '%$query%' AND clients.company_id = $session_company_id ORDER BY client_id DESC LIMIT 5"); $sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE vendor_name LIKE '%$query%' AND company_id = $session_company_id ORDER BY vendor_id DESC LIMIT 5"); $sql_products = mysqli_query($mysqli,"SELECT * FROM products WHERE product_name LIKE '%$query%' AND company_id = $session_company_id ORDER BY product_id DESC LIMIT 5"); - $sql_logins = mysqli_query($mysqli,"SELECT * FROM logins WHERE login_name LIKE '%$query%' AND company_id = $session_company_id ORDER BY login_id DESC LIMIT 5"); + $sql_logins = mysqli_query($mysqli,"SELECT * FROM logins WHERE (login_name LIKE '%$query%' OR login_username LIKE '%$query%') AND company_id = $session_company_id ORDER BY login_id DESC LIMIT 5"); $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 = '$query') AND tickets.company_id = $session_company_id ORDER BY ticket_id DESC LIMIT 5"); $q = htmlentities($_GET['query']); From c3a3ab8410efcf9dad135e3a179cf2f1a12f8282 Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Fri, 14 Jan 2022 17:53:26 +0000 Subject: [PATCH 6/7] Use global search for site search --- top_nav.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/top_nav.php b/top_nav.php index 357b84cf..6ff9a4b6 100644 --- a/top_nav.php +++ b/top_nav.php @@ -9,9 +9,9 @@ -
+
- +