@if (Auth::guard('admin')->check() == true)
@php
$ticket_waiting =\App\Models\Ticket::where('is_read_admin', '0')->count();
$deposit_waiting =\App\Models\Deposit::where('status', 'Pending')->count();
$order_waiting =\App\Models\Order::where('status', 'Pending')->count();
@endphp
<li class="nav-item">
    <a href="{{ url('admin') }}" class="nav-link @if (request()->path() == '/') active @endif">
        <i class="mdi mdi-store-outline mr-2"></i>
        <span>Dasbor</span>
    </a>
</li>

<li class="nav-item">
    <a href="{{ url('admin/admin/list') }}" class="nav-link">
        <i class="mdi mdi-account-key-outline mr-2"></i>
        <span>Admin</span>
    </a>
</li>

<li class="nav-item">
    <a href="{{ url('admin/user/list') }}" class="nav-link">
        <i class="mdi mdi-account-group-outline mr-2"></i>
        <span>Pengguna</span>
    </a>
</li>

<li class="nav-item dropdown">
    <a class="nav-link dropdown-toggle arrow-none" href="#" id="services" role="button"
        data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        <i class="mdi mdi-tag-multiple-outline mr-2"></i>Layanan <div class="arrow-down"></div>
    </a>
    <div class="dropdown-menu" aria-labelledby="services">
        <a href="{{ url('admin/service/provider/list') }}" class="dropdown-item">Penyedia</a>
        <a href="{{ url('admin/service/category/list') }}" class="dropdown-item">Kategori</a>
        <a href="{{ url('admin/service/list') }}" class="dropdown-item">Layanan</a>
        <a href="{{ url('admin/service/custom_price/list') }}" class="dropdown-item">Harga Khusus</a>
        <a href="{{ url('admin/service/log/list') }}" class="dropdown-item">Log Gagal</a>
    </div>
</li>

<li class="nav-item dropdown">
    <a class="nav-link dropdown-toggle arrow-none" href="#" id="orders" role="button"
        data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        <i class="mdi mdi-cart-outline mr-2"></i>Pesanan 
        @if ($order_waiting > 0)
        <span class="badge badge-pill badge-warning ml-1" style="margin-top: 6px;">{{ $order_waiting }}</span>
        @endif
        <div class="arrow-down"></div>
    </a>
    <div class="dropdown-menu" aria-labelledby="orders">
        <a href="{{ url('admin/order/list') }}" class="dropdown-item">Pesanan</a>
        <a href="{{ url('admin/order/report') }}" class="dropdown-item">Laporan</a>
        <a href="{{ url('admin/order/refill/list') }}" class="dropdown-item">Refill</a>
    </div>
</li>

<li class="nav-item dropdown">
    <a class="nav-link dropdown-toggle arrow-none" href="#" id="deposits" role="button"
        data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        <i class="mdi mdi-credit-card-outline mr-2"></i>Deposit 
        @if ($deposit_waiting > 0)
        <span class="badge badge-pill badge-warning ml-1" style="margin-top: 6px;">{{ $deposit_waiting }}</span>
        @endif
        <div class="arrow-down"></div>
    </a>
    <div class="dropdown-menu" aria-labelledby="deposits">
        <a href="{{ url('admin/deposit/method/list') }}" class="dropdown-item">Metode</a>
        <a href="{{ url('admin/deposit/list') }}" class="dropdown-item">Deposit</a>
        <a href="{{ url('admin/deposit/report') }}" class="dropdown-item">Laporan</a>
    </div>
</li>

<li class="nav-item">
    <a href="{{ url('admin/ticket/list') }}" class="nav-link">
        <i class="mdi mdi-ticket-account mr-2"></i>
        @if ($ticket_waiting > 0)
        <span class="badge badge-pill badge-warning float-right ml-1" style="margin-top: 6px;">{{ $ticket_waiting }}</span>
        @endif
        <span>Tiket</span>
    </a>
</li>

<li class="nav-item dropdown">
    <a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-more" role="button"
        data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        <i class="mdi mdi-file-document-box-multiple-outline mr-2"></i>Menu Lain <div class="arrow-down"></div>
    </a>
    <div class="dropdown-menu" aria-labelledby="topnav-more">
        <div class="dropdown">
            <a class="dropdown-item dropdown-toggle arrow-none" href="#" id="logs"
                role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                Sitemap <div class="arrow-down"></div>
            </a>
            <div class="dropdown-menu" aria-labelledby="logs">
                <a href="{{ url('admin/page/hof') }}" class="dropdown-item">Top Terbaik</a>
            </div>
        </div>
        <div class="dropdown">
            <a class="dropdown-item dropdown-toggle arrow-none" href="#" id="logs"
                role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                Log <div class="arrow-down"></div>
            </a>
            <div class="dropdown-menu" aria-labelledby="logs">
                <a href="{{ url('admin/log/user_register') }}" class="dropdown-item">Pendaftaran</a>
                <a href="{{ url('admin/log/user_login') }}" class="dropdown-item">Pengguna Masuk</a>
                <a href="{{ url('admin/log/user_balance') }}" class="dropdown-item">Saldo Pengguna</a>
                <a href="{{ url('admin/log/admin_login') }}" class="dropdown-item">Admin Masuk</a>
                @if (Auth::guard('admin')->user()->level == 'Developer')
                <a href="{{ url('admin/log/bank_mutation') }}" class="dropdown-item">Mutasi Bank</a>
                @endif
            </div>
        </div>
        <div class="dropdown">
            <a class="dropdown-item dropdown-toggle arrow-none" href="#" id="settings"
                role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                Pengaturan <div class="arrow-down"></div>
            </a>
            <div class="dropdown-menu" aria-labelledby="settings">
                <a href="{{ url('admin/settings/website_information/list') }}" class="dropdown-item">Informasi</a>
                <a href="{{ url('admin/settings/website_page/list') }}" class="dropdown-item">Halaman</a>
                <a href="{{ url('admin/settings/website_configs') }}" class="dropdown-item">Konfigurasi Website</a>
            </div>
        </div>
    </div>
</li>

@else

<li class="nav-item">
    <a href="{{ url('auth/login') }}" class="nav-link">
        <i class="mdi mdi-account-arrow-right-outline mr-2"></i>
        <span>Masuk</span>
    </a>
</li>


@endif