Added filters to Pipework
This commit is contained in:
@@ -110,6 +110,13 @@ class BuildingModel {
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("status_id", $filter)) {
|
||||
$status_id = $filter['status_id'];
|
||||
if(is_numeric($status_id)) {
|
||||
$where .= " AND Building.status_id=$status_id";
|
||||
}
|
||||
}
|
||||
|
||||
if(is_array($filter['type']) && count($filter['type'])) {
|
||||
$ot = $filter['type'];
|
||||
$in = [];
|
||||
@@ -153,28 +160,28 @@ class BuildingModel {
|
||||
if(array_key_exists("code", $filter)) {
|
||||
$code = FronkDB::singleton()->escape($filter['code']);
|
||||
if($code) {
|
||||
$where .= " AND Building.`code`='$code'";
|
||||
$where .= " AND Building.`code` like '%$code%'";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("street", $filter)) {
|
||||
$street = FronkDB::singleton()->escape($filter["street"]);
|
||||
if($street) {
|
||||
$where .= " AND street='$street'";
|
||||
$where .= " AND street like '%$street%'";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("zip", $filter)) {
|
||||
$zip = FronkDB::singleton()->escape($filter["zip"]);
|
||||
if($zip) {
|
||||
$where .= " AND zip='$zip'";
|
||||
$where .= " AND zip like '%$zip%'";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("city", $filter)) {
|
||||
$city = FronkDB::singleton()->escape($filter["city"]);
|
||||
if($city) {
|
||||
$where .= " AND city='$city'";
|
||||
$where .= " AND city like '%$city%'";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user