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 1a2f2e24cd
commit db4c643f93
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{