Added sla_id in Contract/Form

This commit is contained in:
Frank Schubert
2024-07-30 16:36:31 +02:00
parent b66c85bd06
commit 48f3866bc7
4 changed files with 35 additions and 7 deletions
+8 -3
View File
@@ -48,12 +48,17 @@ class SlaModel {
return $item;
}
public static function getAll() {
public static function getAll($order = false) {
$items = [];
$_order = "name";
if($order) {
$_order = $order;
}
$db = FronkDB::singleton();
$res = $db->select("Sla", "*", "1 = 1 ORDER BY name");
$res = $db->select("Sla", "*", "1 = 1 ORDER BY $_order");
if($db->num_rows($res)) {
while($data = $db->fetch_object($res)) {
$items[] = new Sla($data);