widget add edit

This commit is contained in:
iBNu Maksum
2025-02-17 14:39:23 +07:00
parent da0779e368
commit ea203ebf64
3 changed files with 37 additions and 26 deletions

View File

@ -95,6 +95,14 @@ if ($action == 'add') {
} catch (Throwable $e) {
//nothing to do
}
} else if ($action == 'pos') {
$jml = count($_POST['orders']);
for ($i = 0; $i < $jml; $i++) {
$d = ORM::for_table('tbl_widgets')->find_one($_POST['id'][$i]);
$d->orders = $_POST['orders'][$i];
$d->save();
}
r2(getUrl('widgets'), 's', 'Widget order Saved Successfully');
} else {
$widgets = ORM::for_table('tbl_widgets')->selects("position", 1)->order_by_asc("orders")->find_many();
$ui->assign('widgets', $widgets);