Update contacts.php

- Add trim
- Adjust indentation
This commit is contained in:
FusionPBX 2024-07-20 20:23:17 -06:00 committed by GitHub
parent bd38191857
commit f959c3717c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 38 additions and 34 deletions

View File

@ -130,7 +130,7 @@
$order = $_GET["order"] ?? '';
//add the search term
$search = strtolower($_GET["search"] ?? '');
$search = strtolower(trim($_GET["search"]) ?? '');
if (!empty($search)) {
if (is_numeric($search)) {
$sql_search = "and contact_uuid in ( ";
@ -144,6 +144,7 @@
else {
//open container
$sql_search = "and ( ";
//search contact
$sql_search .= "contact_uuid in ( ";
$sql_search .= " select contact_uuid from v_contacts ";
@ -162,6 +163,7 @@
$sql_search .= " lower(contact_type) like :search ";
$sql_search .= " ) ";
$sql_search .= ") ";
//search contact emails
if (permission_exists('contact_email_view')) {
$sql_search .= "or contact_uuid in ( ";
@ -173,6 +175,7 @@
$sql_search .= " ) ";
$sql_search .= ") ";
}
//search contact notes
if (permission_exists('contact_note_view')) {
$sql_search .= "or contact_uuid in ( ";
@ -181,6 +184,7 @@
$sql_search .= " and lower(contact_note) like :search ";
$sql_search .= ") ";
}
//close container
$sql_search .= ") ";
}