Feature Update

This commit is contained in:
Daniel Spitzer
2023-02-21 12:24:44 +00:00
committed by Frank Schubert
parent 0763f068bd
commit aa72b1ba95
18 changed files with 437 additions and 526 deletions

View File

@@ -100,9 +100,8 @@ class DeviceModel
public static function search($filter) {
$items = [];
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
$res = $db->select("Device", "*", "$where ORDER BY name, network_id");
$res = $db->select("Device", "*", "$where ORDER BY name");
if($db->num_rows($res)) {
while($data = $db->fetch_object($res)) {
$items[] = new Device($data);
@@ -115,10 +114,10 @@ class DeviceModel
$where = "1=1 ";
//var_dump($filter);exit;
if(array_key_exists("network_id", $filter)) {
$networkid = $filter['network_id'];
if(is_numeric($networkid)) {
$where .= " AND network_id=$networkid";
if(array_key_exists("pop_id", $filter)) {
$popid = $filter['pop_id'];
if(is_numeric($popid)) {
$where .= " AND pop_id=$popid";
}
}