Added Admin function mass prouductchange

This commit is contained in:
Frank Schubert
2025-06-03 12:33:00 +02:00
parent cd759272ac
commit 26a59fb588
8 changed files with 935 additions and 107 deletions

View File

@@ -50,14 +50,18 @@ class ProductModel {
if(!is_numeric($id) || !$id) {
throw new Exception("Invalid number", 400);
}
$item = [];
$item = null;
$db = FronkDB::singleton();
$res = $db->select("Product", "*", "id=$id LIMIT 1");
if($db->num_rows($res)) {
$data = $db->fetch_object($res);
$item = new Product($data);
$data = $db->fetch_object($res);
$item = new Product($data);
if(!$item->id) {
return null;
}
}
return $item;
}