remove unnessesary n var as they are all replace with phone_query

This commit is contained in:
johnnyq 2023-02-24 20:59:17 -05:00
parent bd655f4886
commit daa0449a1c
2 changed files with 1 additions and 9 deletions

View File

@ -12,7 +12,7 @@ $url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, '
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM contacts
LEFT JOIN locations ON location_id = contact_location_id
WHERE contact_archived_at IS NULL
AND (contact_name LIKE '%$q%' OR contact_title LIKE '%$q%' OR location_name LIKE '%$q%' OR contact_email LIKE '%$q%' OR contact_department LIKE '%$q%' OR contact_phone LIKE '%$n%' OR contact_extension LIKE '%$q%' OR contact_mobile LIKE '%$n%')
AND (contact_name LIKE '%$q%' OR contact_title LIKE '%$q%' OR location_name LIKE '%$q%' OR contact_email LIKE '%$q%' OR contact_department LIKE '%$q%' OR contact_phone LIKE '%$phone_query%' OR contact_extension LIKE '%$q%' OR contact_mobile LIKE '%$phone_query%')
AND contact_client_id = $client_id
ORDER BY $sb $o LIMIT $record_from, $record_to"
);

View File

@ -30,10 +30,8 @@ if (isset($_GET['o'])) {
} elseif(isset($o)) {
if ($o == "ASC") {
$disp = "DESC";
//$o = "ASC";
} else {
$disp = "ASC";
//$o = "DESC";
}
}
@ -45,15 +43,9 @@ if (isset($_GET['q'])) {
if (empty($phone_query)) {
$phone_query = $q;
}
//Phone Numbers
$n = preg_replace("/[^0-9]/", '', $q);
if (empty($n)) {
$n = $q;
}
} else {
$q = "";
$phone_query = "";
$n = "";
}
// Sortby