main_logo {{ @$setup_app->appname }}

    {{-- 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 $notif = null; $username = Session('username'); $roles = DB::table('users') ->where('username', $username) ->value('idroles'); $firstname = DB::table('users') ->where('username', $username) ->value('firstname'); $isAdmin = ($roles === 'admins') || ($roles === 'admhrd'); if ($d->dmenu == 'ntfmsj') { if ($isAdmin) { // Admin: ambil semua notifikasi belum dibaca $data_notif = DB::select(" SELECT COUNT(*) as notif FROM notifications WHERE NOT JSON_CONTAINS(is_read, '\"$username\"') "); } else { // Non-admin: ambil yang belum dibaca & milik firstname user $data_notif = DB::select(" SELECT COUNT(*) as notif FROM notifications WHERE worker = ? AND NOT JSON_CONTAINS(is_read, '\"$username\"') ", [$firstname]); } foreach ($data_notif as $n) { $notif = $n->notif; } } elseif ($d->notif != '') { $data_notif = DB::select($d->notif); foreach ($data_notif as $n) { $notif = $n->notif; } } @endphp @if (!empty($notif)) {{ $notif }} @endif
  • @endforeach @else
  • name == $title_group ? 'aria-expanded=true' : '' }}>
    {{ $g->name }}
      {{-- 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 --}} @if ($d->notif != '') @php // get notif $data_notif = DB::select($d->notif); foreach ($data_notif as $n) { $notif = $n->notif; } @endphp {{ $notif }} @endif
    • @endforeach
  • @endif @endforeach