Order/Form: Changed owner and billingaddress to autocomplete instead of

select
This commit is contained in:
Frank Schubert
2022-01-25 22:39:57 +01:00
parent fec01ee1bc
commit 517174de4c
9 changed files with 385 additions and 115 deletions

View File

@@ -76,6 +76,21 @@ class AddressModel {
return null;
}
public static function getOne($id) {
if(!is_numeric($id) || !$id) {
throw new Exception("Invalid number", 400);
}
$item = [];
$db = FronkDB::singleton();
$res = $db->select("Address", "*", "id=$id LIMIT 1");
if($db->num_rows($res)) {
$data = $db->fetch_object($res);
$item = new Address($data);
}
return $item;
}
public static function getAll() {
$items = [];
@@ -179,7 +194,7 @@ class AddressModel {
}
}
//mfLoghandler::singleton()->debug($sql);
mfLoghandler::singleton()->debug($sql);
$res = $db->query($sql);
if($db->num_rows($res)) {