pos-gis/resources/views/components/master/menu.blade.php

140 lines
8.2 KiB
PHP
Raw Normal View History

2024-10-07 06:13:42 +00:00
@php
if (isset($_GET['pid'])) {
$pid = $_GET['pid'];
$uid = $_GET['uid'];
}else {
$pid = 0;
$uid = 0;
}
$getMenu = \DB::select("SELECT * from menu m
join menu_privilege mp on mp.menu_uid = m.menu_uid
where m.is_active = 't' and m.has_children = 't' and group_id = ".Auth::guard('admin')->user()->role." order by m.seq");
$getMerchant = \DB::table('merchant')->where('mid',Auth::guard('admin')->user()->mid)->first();
@endphp
<div class="aside aside-left d-flex flex-column flex-row-auto" id="kt_aside">
<!--begin::Aside Menu-->
<div class="aside-menu-wrapper flex-column-fluid" id="kt_aside_menu_wrapper">
<!--begin::Menu Container-->
<div id="kt_aside_menu" class="aside-menu min-h-lg-800px" data-menu-vertical="1" data-menu-scroll="1" data-menu-dropdown-timeout="500">
<!--begin::Menu Nav-->
<button class="btn btn-icon btn-light-primary btn-sm" style="font-size: 6px;position: absolute;right: 10px;top: 10px;"
id="kt_aside_close_btn"><i class="la la-close"></i></button>
<ul class="menu-nav p-5 pt-15">
@foreach ($getMenu as $p)
@php
$getSubMenu = \DB::select("SELECT * from menu m
join menu_privilege mp on mp.menu_uid = m.menu_uid
where m.is_active = 't' and m.has_children = 'f'
and mp.group_id = ".Auth::guard('admin')->user()->role." and m.menu_pid = ".$p->menu_uid." order by seq");
@endphp
@if ($p->url)
<li class="menu-item menu-item-submenu" aria-haspopup="true" data-menu-toggle="hover">
<a href="{{$p->url}}" onclick="loadContent(event,this);" class="menu-link">
{!!$p->icon_css!!}
<span class="menu-text">{{$p->menu}}</span>
</a>
</li>
@else
<li class="menu-item menu-item-submenu" aria-haspopup="true" data-menu-toggle="hover">
<a href="javascript:;" class="menu-link menu-toggle">
{!!$p->icon_css!!}
<span class="menu-text">{{$p->menu}}</span>
<i class="menu-arrow"></i>
</a>
<div class="menu-submenu">
<i class="menu-arrow"></i>
<ul class="menu-subnav">
<li class="menu-item menu-item-parent" aria-haspopup="true">
<span class="menu-link">
<span class="menu-text">{{$p->menu}}</span>
</span>
</li>
@foreach ($getSubMenu as $sb)
@if (Auth::guard('admin')->user()->role == 2)
{{-- LAPORAN PARKIR --}}
@if ($sb->menu_uid == '407')
@if ($getMerchant->is_park_active)
<li class="menu-item" aria-haspopup="true" >
<a id="sb-{{$sb->menu_uid}}" href="{{$sb->url}}" onclick="loadContent(event,this);" class="menu-link">
<i class="menu-bullet menu-bullet-line">
<span></span>
</i>
<span class="menu-text">{{$sb->menu}}</span>
</a>
</li>
@else
@endif
{{-- LAPORAN MARKET --}}
@elseif($sb->menu_uid == '408')
@if ($getMerchant->is_market_active)
<li class="menu-item" aria-haspopup="true" >
<a id="sb-{{$sb->menu_uid}}" href="{{$sb->url}}" onclick="loadContent(event,this);" class="menu-link">
<i class="menu-bullet menu-bullet-line">
<span></span>
</i>
<span class="menu-text">{{$sb->menu}}</span>
</a>
</li>
@else
@endif
{{-- LAPORAN SALE --}}
@elseif($sb->menu_uid == '409')
@if ($getMerchant->is_sale_active)
<li class="menu-item" aria-haspopup="true" >
<a id="sb-{{$sb->menu_uid}}" href="{{$sb->url}}" onclick="loadContent(event,this);" class="menu-link">
<i class="menu-bullet menu-bullet-line">
<span></span>
</i>
<span class="menu-text">{{$sb->menu}}</span>
</a>
</li>
@else
@endif
@else
<li class="menu-item" aria-haspopup="true" >
<a id="sb-{{$sb->menu_uid}}" href="{{$sb->url}}" onclick="loadContent(event,this);" class="menu-link">
<i class="menu-bullet menu-bullet-line">
<span></span>
</i>
<span class="menu-text">{{$sb->menu}}</span>
</a>
</li>
@endif
@else
<li class="menu-item" aria-haspopup="true" >
<a id="sb-{{$sb->menu_uid}}" href="{{$sb->url}}" onclick="loadContent(event,this);" class="menu-link">
<i class="menu-bullet menu-bullet-line">
<span></span>
</i>
<span class="menu-text">{{$sb->menu}}</span>
</a>
</li>
@endif
@endforeach
</ul>
</div>
</li>
@endif
@endforeach
</ul>
<!--end::Menu Nav-->
</div>
<!--end::Menu Container-->
</div>
<!--end::Aside Menu-->
</div>