Various Bugfixes

This commit is contained in:
Frank Schubert
2021-10-07 19:54:28 +02:00
parent e27da7ec55
commit d150b4e7b5
8 changed files with 167 additions and 39 deletions

View File

@@ -109,7 +109,8 @@ class BuildingModel {
LEFT JOIN Buildingstatus ON (Buildingstatus.id = Building.status_id)
WHERE $where
ORDER BY network_id, pop_id, street, zip, city";
mfLoghandler::singleton()->debug($sql);
if(is_array($limit) && count($limit)) {
if(is_numeric($limit['start']) && is_numeric($limit['count'])) {
$sql .= " LIMIT ".$limit['start'].", ".$limit['count'];
@@ -215,6 +216,13 @@ class BuildingModel {
}
}
if(array_key_exists("=street", $filter)) {
$street = FronkDB::singleton()->escape($filter["=street"]);
if($street) {
$where .= " AND street like '$street'";
}
}
if(array_key_exists("zip", $filter)) {
$zip = FronkDB::singleton()->escape($filter["zip"]);
if($zip) {
@@ -222,6 +230,13 @@ class BuildingModel {
}
}
if(array_key_exists("=zip", $filter)) {
$zip = FronkDB::singleton()->escape($filter["=zip"]);
if($zip) {
$where .= " AND zip like '$zip'";
}
}
if(array_key_exists("city", $filter)) {
$city = FronkDB::singleton()->escape($filter["city"]);
if($city) {
@@ -229,6 +244,13 @@ class BuildingModel {
}
}
if(array_key_exists("=city", $filter)) {
$city = FronkDB::singleton()->escape($filter["=city"]);
if($city) {
$where .= " AND city like '$city'";
}
}
//var_dump($filter, $where);exit;
return $where;
}