main_logo {{ @$setup_app->appname }}

    @php $isHrdRole = in_array('shr123', $users_rules ?? []) || in_array('hr1234', $users_rules ?? []); @endphp {{-- LOOPING GMENU --}} @foreach ($gmenu as $g) @if ($g->gmenu == 'blankx') {{-- Query DMenu --}} @php $querydmenu = DB::table('sys_dmenu') ->join('sys_auth', 'sys_dmenu.dmenu', '=', 'sys_auth.dmenu') ->whereIn('sys_auth.idroles', $users_rules) ->where('sys_dmenu.isactive', '1') ->where('sys_dmenu.show', '1') ->where('sys_auth.isactive', '1') ->where('sys_dmenu.gmenu', $g->gmenu) ->select('sys_dmenu.*') ->distinct() ->orderBy('sys_dmenu.urut', 'asc') ->get(); @endphp @foreach ($querydmenu as $d)
  • {{ $d->name }} {{-- check query notif --}} @php $notifSqlRaw = $d->notif; if ($d->dmenu === 'txrdkl') { $notifSqlRaw = "SELECT COUNT(*) as notif FROM trx_dkl WHERE status = 'pending_personalia'"; } elseif ($d->dmenu === 'txadkl') { $notifSqlRaw = "SELECT COUNT(*) as notif FROM trx_dkl WHERE send_to = (SELECT id FROM users WHERE username = '{username}') AND status = 'pending_atasan'"; } elseif ($d->dmenu === 'txedkl') { $notifSqlRaw = "SELECT COUNT(*) as notif FROM trx_dkl WHERE (nik = '{username}' OR user_create = '{username}') AND status IN ('draft')"; } @endphp @if ($notifSqlRaw != '') @php // get notif — support {username} placeholder $notif_sql = str_replace('{username}', session('username'), $notifSqlRaw); $data_notif = DB::select($notif_sql); $notif = 0; foreach ($data_notif as $n) { $notif = $n->notif; } @endphp @if ($notif > 0) {{ $notif }} @endif @endif
  • @endforeach @else @php $groupName = $isHrdRole && $g->gmenu == 'lbrbwh' && $g->name == 'SPL Bawahan' ? 'SPL' : $g->name; // Query DMenu for this GMenu $querydmenu = DB::table('sys_dmenu') ->join('sys_auth', 'sys_dmenu.dmenu', '=', 'sys_auth.dmenu') ->whereIn('sys_auth.idroles', $users_rules) ->where('sys_dmenu.isactive', '1') ->where('sys_dmenu.show', '1') ->where('sys_auth.isactive', '1') ->where('sys_dmenu.gmenu', $g->gmenu) ->select('sys_dmenu.*') ->distinct() ->orderBy('sys_dmenu.urut', 'asc') ->get(); // Calculate total notif for this GMenu $totalGmenuNotif = 0; foreach($querydmenu as $dd) { $nSqlRaw = $dd->notif; if ($dd->dmenu === 'txrdkl') { $nSqlRaw = "SELECT COUNT(*) as notif FROM trx_dkl WHERE status = 'pending_personalia'"; } elseif ($dd->dmenu === 'txadkl') { $nSqlRaw = "SELECT COUNT(*) as notif FROM trx_dkl WHERE send_to = (SELECT id FROM users WHERE username = '{username}') AND status = 'pending_atasan'"; } elseif ($dd->dmenu === 'txedkl') { $nSqlRaw = "SELECT COUNT(*) as notif FROM trx_dkl WHERE (nik = '{username}' OR user_create = '{username}') AND status IN ('draft')"; } if ($nSqlRaw != '') { $nSql = str_replace('{username}', session('username'), $nSqlRaw); $dNotif = DB::select($nSql); foreach ($dNotif as $n) { $totalGmenuNotif += $n->notif; } } } $isExpanded = $g->name == $title_group; $collapseClass = $isExpanded ? '' : 'collapsed'; @endphp
  • {{ $groupName }} @if ($totalGmenuNotif > 0) {{ $totalGmenuNotif }} @endif
      @foreach ($querydmenu as $d)
    • {{ $d->name }} {{-- check query notif --}} @php $notifSqlRaw = $d->notif; if ($d->dmenu === 'txrdkl') { $notifSqlRaw = "SELECT COUNT(*) as notif FROM trx_dkl WHERE status = 'pending_personalia'"; } elseif ($d->dmenu === 'txadkl') { $notifSqlRaw = "SELECT COUNT(*) as notif FROM trx_dkl WHERE send_to = (SELECT id FROM users WHERE username = '{username}') AND status = 'pending_atasan'"; } elseif ($d->dmenu === 'txedkl') { $notifSqlRaw = "SELECT COUNT(*) as notif FROM trx_dkl WHERE (nik = '{username}' OR user_create = '{username}') AND status IN ('draft')"; } @endphp @if ($notifSqlRaw != '') @php // get notif — support {username} placeholder $notif_sql = str_replace('{username}', session('username'), $notifSqlRaw); $data_notif = DB::select($notif_sql); $notif = 0; foreach ($data_notif as $n) { $notif = $n->notif; } @endphp @if ($notif > 0) {{ $notif }} @endif @endif
    • @endforeach
  • @endif @endforeach