Different Widget for admin, Agent, Sales and Customers Editor

This commit is contained in:
iBNu Maksum 2025-02-19 12:14:57 +07:00
parent f929560384
commit da86f2c422
No known key found for this signature in database
GPG key ID: 7FC82848810579E5
6 changed files with 85 additions and 29 deletions

View file

@ -36,7 +36,12 @@ $current_date = date('Y-m-d');
$ui->assign('start_date', $start_date);
$ui->assign('current_date', $current_date);
$widgets = ORM::for_table('tbl_widgets')->selects("enabled", 1)->order_by_asc("orders")->findArray();
$tipeUser = $admin['user_type'];
if (in_array($tipeUser, ['SuperAdmin', 'Admin'])) {
$tipeUser = 'Admin';
}
$widgets = ORM::for_table('tbl_widgets')->where("enabled", 1)->where('user', $tipeUser)->order_by_asc("orders")->findArray();
$count = count($widgets);
for ($i = 0; $i < $count; $i++) {
try{