mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
You can now search by phone numbers with dashes or () before it requied you to only type in the numbers only
This commit is contained in:
@@ -13,8 +13,14 @@ if(isset($_GET['p'])){
|
||||
|
||||
if(isset($_GET['q'])){
|
||||
$q = mysqli_real_escape_string($mysqli,$_GET['q']);
|
||||
//Phone Numbers
|
||||
$phone_query = preg_replace("/[^0-9]/", '',$q);
|
||||
if(empty($phone_query)){
|
||||
$phone_query = $q;
|
||||
}
|
||||
}else{
|
||||
$q = "";
|
||||
$phone_query = "";
|
||||
}
|
||||
|
||||
if(!empty($_GET['sb'])){
|
||||
@@ -41,7 +47,7 @@ $url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM locations
|
||||
WHERE location_client_id = $client_id
|
||||
AND (location_name LIKE '%$q%' OR location_address LIKE '%$q%' OR location_phone LIKE '%$q%')
|
||||
AND (location_name LIKE '%$q%' OR location_address LIKE '%$q%' OR location_phone LIKE '%$phone_query%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
Reference in New Issue
Block a user