This commit is contained in:
Spitzer_Daniel
2023-03-22 16:56:02 +01:00
parent 0dc7f43b09
commit 214c0683e6
6 changed files with 91 additions and 33 deletions

View File

@@ -1,4 +1,5 @@
<?php
class DeviceModel
{
public $name = null;
@@ -17,6 +18,7 @@ class DeviceModel
public static function find($data)
{
}
public static function create(array $data)
@@ -106,8 +108,8 @@ class DeviceModel
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
$res = $db->select("Device", "*", "$where ORDER BY name");
if($db->num_rows($res)) {
while($data = $db->fetch_object($res)) {
if ($db->num_rows($res)) {
while ($data = $db->fetch_object($res)) {
$items[] = new Device($data);
}
}
@@ -119,9 +121,9 @@ class DeviceModel
$where = "1=1 ";
//var_dump($filter);exit;
if(array_key_exists("pop_id", $filter)) {
if (array_key_exists("pop_id", $filter)) {
$popid = $filter['pop_id'];
if(is_numeric($popid)) {
if (is_numeric($popid)) {
$where .= " AND pop_id=$popid";
}
}