main_logo {{ @$setup_app->appname }}

    @php $sidenavIsTeknisi = session('is_teknisi', false); $sidenavUserGedung = session('user_gedung'); @endphp @foreach ($gmenu as $g) @if ($g->gmenu == 'blankx') @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 @else
  • name == $title_group ? 'aria-expanded=true' : '' }}>
    {{ $g->name }}
      @php // Ambil menu berdasarkan sys_auth dulu $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(); if ($sidenavIsTeknisi) { $rawGedung = trim((string) $sidenavUserGedung); // Support JSON: ["trsgda","trsgdb","trsoff"] $decodedGedung = json_decode($rawGedung, true); if (json_last_error() === JSON_ERROR_NONE && is_array($decodedGedung)) { $userMenuList = $decodedGedung; } else { // Support string koma: trsgda,trsgdb,trsoff $userMenuList = explode(',', $rawGedung); } $allowedMenuUrls = collect($userMenuList) ->map(function ($item) { return strtolower(trim((string) $item, ' /')); }) ->filter() ->unique() ->values() ->toArray(); $querydmenu = $querydmenu ->filter(function ($item) use ($allowedMenuUrls) { $rawUrl = trim((string) ($item->url ?? '')); $pathOnly = parse_url($rawUrl, PHP_URL_PATH); $itemPath = strtolower(trim($pathOnly ?: $rawUrl, '/')); /* |-------------------------------------------------------------------------- | Menu topology/global server |-------------------------------------------------------------------------- | Kalau teknisi, menu topology hanya tampil jika URL-nya ada | di kolom users.gedung. */ $isTopologyMenu = str_starts_with($itemPath, 'trsgd') || $itemPath === 'trsoff' || $itemPath === 'trssrv'; if ($isTopologyMenu) { return in_array($itemPath, $allowedMenuUrls, true); } /* |-------------------------------------------------------------------------- | Menu selain topology tetap tampil berdasarkan sys_auth |-------------------------------------------------------------------------- */ return true; }) ->values(); } $currentFullUrl = $url_menu . (request()->getQueryString() ? '?' . request()->getQueryString() : ''); $hasSpecificMatch = false; foreach ($querydmenu as $dm) { $dmUrl = trim((string) ($dm->url ?? '')); if (str_contains($dmUrl, '?') && str_starts_with($currentFullUrl, $dmUrl)) { $hasSpecificMatch = true; break; } } @endphp @foreach ($querydmenu as $d) @php $menuUrl = trim((string) ($d->url ?? '')); if (str_contains($menuUrl, '?')) { $isMenuActive = str_starts_with($currentFullUrl, $menuUrl); } else { $isMenuActive = $menuUrl == $url_menu && !$hasSpecificMatch; } @endphp
    • {{ $d->name }} @if (!empty($d->notif)) @php $notif = 0; $data_notif = DB::select($d->notif); foreach ($data_notif as $n) { $notif = $n->notif ?? 0; } @endphp {{ $notif }} @endif
    • @endforeach
  • @endif @endforeach