Created script to import customers from IVT

This commit is contained in:
Frank Schubert
2022-01-20 21:29:27 +01:00
parent 39d07f948e
commit 2cd9c44bda
7 changed files with 238 additions and 27 deletions

View File

@@ -50,19 +50,21 @@ class BuildingModel {
return $model;
}
public static function getOne($id) {
if(!is_numeric($id) || !$id) {
throw new Exception("Invalid number", 400);
}
$item = [];
public static function getFirst() {
$db = FronkDB::singleton();
$res = $db->select("Building", "*", "id=$id LIMIT 1");
$where = self::getSqlFilter($filter);
$res = $db->select("Building", "*", "$where ORDER BY network_id,pop_id,street,zip,city LIMIT 1");
if($db->num_rows($res)) {
$data = $db->fetch_object($res);
$item = new Building($data);
if($item->id) {
return $item;
} else {
return null;
}
}
return $item;
return null;
}
public static function getAll() {