<div class="az-header no-print" style="border-bottom:1px solid #00beda;">
    @if (auth()->check())
    @else
        <a href="{{ route('login') }}">Login</a>
    @endif
    <div class="container-fluid">
        <div class="az-header-left">
            <a href="{{ url('admin') }}" class="az-logo"><span></span> <img src="{{ asset('img/MDS_LOGO.png') }}"
                    style="height:70px;padding:5px;"></a>
            <a href="" id="azMenuShow" class="az-header-menu-icon d-lg-none"><span></span></a>
        </div><!-- az-header-left -->
        <div class="az-header-menu">
            <div class="az-header-menu-header">
                <a href="{{ url('admin') }}" class="az-logo"><span></span> <img src="{{ asset('img/MDS_LOGO.png') }}"
                        style="height:70px;padding:5px;"></a>
                <a href="" class="close">&times;</a>
            </div><!-- az-header-menu-header -->
            <ul class="nav">
                {{-- @if (auth()->user()->hasRole('Super-Admin')) --}}
                @if (auth()->user()->can('Dashboard'))
                    <li class="nav-item">
                        <a href="{{ url('admin') }}" style="text-decoration: none;" class="nav-link with-sub">
                            <i class="typcn typcn-chart-area-outline"></i> Dashboard
                        </a>
                        <div class="az-menu-sub">
                            <nav class="nav">
                                @can('Admin Dashboard')
                                    <a href="{{ url('admin') }}" class="nav-link">
                                        Admin Dashboard
                                    </a>
                                @endcan

                                @can('Accounts Dashboard')
                                    <a href="{{ url('accounts_dashboard') }}" class="nav-link">
                                        Accounts Dashboard
                                    </a>
                                @endcan

                                <!--<a href="{{ url('manager_dashboard') }}" class="nav-link">Manager Dashboard</a>-->
                                @can('Sales Dashboard')
                                    <a href="{{ url('sales_dashboard') }}" class="nav-link">Sales Dashboard</a>
                                @endcan
                            </nav>
                        </div>
                    </li>
                @endif
                {{-- @endif --}}

                @if (auth()->user()->can('Operations'))
                    <li class="nav-item">
                        <a href="" class="nav-link with-sub">
                            <i class="typcn typcn-arrow-sync"></i> Operations
                        </a>
                        <div class="az-menu-sub">
                            <nav class="nav">
                                @can('Goods Receipts')
                                    <a href="{{ route('good_receipts.list') }}" class="nav-link">
                                        <i class="typcn typcn-archive"></i> Good Receipts
                                    </a>
                                @endcan

                                @can('Sales')
                                    <a href="{{ route('sales.list') }}" class="nav-link">
                                        <i class="typcn typcn-chart-bar"></i> Sales
                                    </a>
                                @endcan

                                @can('B-Cheque')
                                    <a href="{{ route('b_cheque.list') }}" class="nav-link">
                                        <i class="typcn typcn-credit-card"></i> B-Cheque
                                    </a>
                                @endcan

                                @can('Customers')
                                    <a href="{{ url('customers') }}" class="nav-link">
                                        <i class="typcn typcn-user"></i> Customers
                                    </a>
                                @endcan

                                @can('Suppliers')
                                    <a href="{{ route('supplier.list') }}" class="nav-link">
                                        <i class="typcn typcn-group"></i> Suppliers
                                    </a>
                                @endcan

                                @can('Purchasers')
                                    <a href="{{ route('purchaser.list') }}" class="nav-link">
                                        <i class="typcn typcn-group"></i> Purchasers
                                    </a>
                                @endcan

                                @can('Sales Rate Application')
                                    <a href="{{ route('sale_rate.create') }}" class="nav-link">
                                        <i class="typcn typcn-edit"></i> Sale Rate Application
                                    </a>
                                @endcan
                                @can('Purchase Order')
                                    <a href="{{ route('po.list') }}" class="nav-link">
                                        <i class="typcn typcn-shopping-bag"></i> Purchase Order
                                    </a>
                                @endcan

                                @can('Purchase list')
                                    <a href="{{ url('po/list') }}" class="nav-link">
                                        <i class="typcn typcn-shopping-cart"></i> Purchase Order
                                    </a>
                                @endcan


                            </nav>
                        </div>
                    </li>
                @endif

                @if (auth()->user()->can('Inventory'))
                    <li class="nav-item">
                        <a href="" class="nav-link with-sub">
                            <i class="typcn typcn-power"></i> Inventory
                        </a>
                        <nav class="az-menu-sub">
                            {{-- @canAny(['Brands', 'Products'])
                <a href="{{ route('brands.list') }}" class="nav-link">
                    <i class="typcn typcn-tags"></i> Brands & Products
                </a>
            @endcanAny --}}

                            @can('Product Category')
                                <a href="{{ url('product_cate_main/list') }}" class="nav-link">
                                    <i class="typcn typcn-th-large-outline"></i> Product Categories
                                </a>
                            @endcan

                            @canAny(['All Products Inventory'])
                                <a href="{{ route('products.all') }}" class="nav-link">
                                    <i class="typcn typcn-box"></i> All Products Inventory
                                </a>
                            @endcanAny
                        </nav>
                    </li>
                @endif

                @if (auth()->user()->can('Accounts'))
                    <li class="nav-item">
                        <a href="" class="nav-link with-sub">
                            <i class="typcn typcn-tabs-outline"></i> Accounts
                        </a>
                        <nav class="az-menu-sub">
                            @can('Chart of Accounts')
                                <a href="{{ url('main_account') }}" class="nav-link">
                                    <i class="typcn typcn-book"></i> Chart of Accounts
                                </a>
                            @endcan

                            @can('Journal Vouchers')
                                <a href="{{ url('voucher/list') }}" class="nav-link">
                                    <i class="typcn typcn-document-text"></i> Journal Vouchers
                                </a>
                            @endcan

                            @can('Payment Vouchers')
                                <a href="{{ route('payment.list') }}" class="nav-link">
                                    <i class="typcn typcn-credit-card"></i> Payment Vouchers
                                </a>
                            @endcan

                            @can('Receipts Vouchers')
                                <a href="{{ route('receipt_voucher.list') }}" class="nav-link">
                                    <i class="typcn typcn-download-outline"></i> Receipts Vouchers
                                </a>
                            @endcan

                            @can('Service Vouchers')
                                <a href="{{ route('service_vouchers.index') }}" class="nav-link">
                                    <i class="typcn typcn-shopping-bag"></i> Service Vouchers
                                </a>
                            @endcan
                        </nav>
                    </li>
                @endif

                @if (auth()->user()->can('Reports Management'))
                    <li class="nav-item">
                        <a href="" class="nav-link with-sub">
                            <i class="typcn typcn-chart-pie-outline"></i> Reports
                        </a>
                        <nav class="az-menu-sub">
                            @can('Reports Management Sale Bill')
                                <a href="{{ route('sale-bill.report') }} " class="nav-link">
                                    <i class="typcn typcn-ticket"></i> Sale Bill
                                </a>
                            @endcan
                            @can('Reports Management Sale Register')
                                <a href="{{ route('sale-register.report') }}" class="nav-link">
                                    <i class="typcn typcn-document-text"></i> Sale Register
                                </a>
                            @endcan
                            @can('Reports Management Truck Sale Register')
                                <a href="{{ route('truck-sale-register.report') }}" class="nav-link">
                                    <i class="typcn typcn-shopping-bag"></i> Truck Sale Register
                                </a>
                            @endcan
                            @can('Reports Management Stock Hand')
                                <a href="{{ route('stockInHandRegister.report') }}" class="nav-link">
                                    <i class="typcn typcn-download-outline"></i> Stock In Hand
                                </a>
                            @endcan


                            @can('Reports Management Receivables')
                                <a href="{{ route('receivables.report') }}" class="nav-link">
                                    <i class="typcn typcn-chart-line-outline"></i> Receivables
                                </a>
                            @endcan
                            @can('Reports Management General Ledger')
                                <a href="{{ route('general-ledger.index') }}" class="nav-link">
                                    <i class="typcn typcn-document-text"></i> General Ledger
                                </a>
                            @endcan
                            @can('Reports Management Trial Balance')
                                <a href="{{ route('trialBalance.report') }}" class="nav-link">
                                    <i class="typcn typcn-document-text"></i> Trial Balance
                                </a>
                            @endcan

                            @can('Reports Management Aging Payables')
                                <a href="{{ route('aging-payables.index') }}" class="nav-link">
                                    <i class="typcn typcn-chart-line"></i> Aging Payables
                                </a>
                            @endcan
                            @can('Reports Management Account Comparison')
                                <a href="{{ route('account-comparison.index') }}" class="nav-link">
                                    <i class="typcn typcn-chart-line"></i> Account Comparison
                                </a>
                            @endcan

                            @can('Reports Management Loan Advance')
                                <a href="{{ route('loan-advance-report.index') }}" class="nav-link">
                                    <i class="typcn typcn-arrow-forward-outline"></i> Loan Advance
                                </a>
                            @endcan

                            @can('Reports Management Payroll History')
                                <a href="{{ route('payroll-history.index') }}" class="nav-link">
                                    <i class="typcn typcn-time"></i> Payroll History
                                </a>
                            @endcan

                            @can('Reports Management Purchase Register')
                                <a href="{{ route('purchase-register.index') }}" class="nav-link">
                                    <i class="typcn typcn-shopping-cart"></i> Purchase Register
                                </a>
                            @endcan
                            @can('Reports Management Services Purchase Report')
                                <a href="{{ route('service-purchase-report.index') }}" class="nav-link">
                                    <i class="typcn typcn-shopping-cart"></i> Service Purchase Report
                                </a>
                            @endcan
                            @can('Reports Management Purchase Billing Vehicle Register Report')
                                <a href="{{ route('purchase-billing-vehicle-register.index') }}" class="nav-link">
                                    <i class="typcn typcn-shopping-cart"></i> Purchase Billing Vehicle Register Report
                                </a>
                            @endcan

                        </nav>
                    </li>
                @endif

                @if (auth()->user()->can('Administerator'))
                    <li class="nav-item">
                        <a href="" class="nav-link with-sub"><i class="typcn typcn-user"></i>Administrator</a>
                        <nav class="az-menu-sub">
                            @can('Users Management')
                                <a href="{{ url('users') }}" class="nav-link">Users Management</a>
                            @endcan
                            @can('Roles Management')
                                <a href="{{ url('roles') }}" class="nav-link">Roles Management</a>
                            @endcan
                            <hr>
                            <h5>HR</h5>
                            @can('Departments')
                                <a href="{{ url('departments') }}" class="nav-link"> <i
                                        class="
 typcn typcn-key"></i>Departments</a>
                            @endcan
                            @can('Designations')
                                <a href="{{ url('designations') }}" class="nav-link"> <i
                                        class="
 typcn typcn-edit"></i>Designations</a>
                            @endcan
                            @can('Employees')
                                <a href="{{ url('employee') }}" class="nav-link"> <i
                                        class="
 typcn typcn-user"></i>Employees</a>
                            @endcan
                            @can('Attendance')
                                <a href="{{ url('attendance') }}" class="nav-link">
                                    <i class="typcn typcn-image"></i> Attendance
                                </a>
                            @endcan
                            @can('Employee Payrolls')
                                <a href="{{ url('payrolls') }}" class="nav-link">
                                    <i class="typcn typcn-key"></i> Employee Payrolls
                                </a>
                            @endcan
                            @can('Employee Overtimes list')
                                <a href="{{ route('overtimes.index') }}" class="nav-link">
                                    <i class="typcn typcn-time"></i> Employee Overtimes
                                </a>
                            @endcan
                            @can('Employee Advances list')
                                <a href="{{ route('advances.index') }}" class="nav-link">
                                    <i class="typcn typcn-arrow-up-thick"></i>
                                    Employee Advances
                                </a>
                            @endcan
                            @can('Employee Loans list')
                                <a href="{{ route('loans.index') }}" class="nav-link">
                                    <i class="typcn typcn-credit-card"></i>
                                    Employee Loans
                                </a>
                            @endcan
                            {{-- @can('Permissions')
                                <a href="{{ url('permissions') }}" class="nav-link">Permissions Management</a>
                            @endcan
                            @can('Escalation Management')
                                <a href="#" class="nav-link">Escalation Management</a>
                            @endcan --}}
                            {{-- @can('Departments')
                                <a href="{{ url('departments') }}" class="nav-link">Deparments</a>
                            @endcan --}}
                        </nav>
                    </li>
                @endif

                @if (auth()->user()->can('Preferences'))
                    <li class="nav-item">
                        <a href="" class="nav-link with-sub"><i
                                class="typcn typcn-tabs-outline"></i>Preferences</a>
                        <nav class="az-menu-sub">
                            @can('Measurement Units')
                                <a href="{{ url('measurement_unit') }}" class="nav-link">Measurement Units</a>
                            @endcan

                            @can('Unit Types')
                                <a href="{{ url('unit_type') }}" class="nav-link">Unit Types</a>
                            @endcan

                            @can('Discounts')
                                <a href="{{ url('discounts') }}" class="nav-link">Discounts</a>
                            @endcan

                            {{-- @can('Notification Management')
                                <a href="#" class="nav-link">
                                    Notifications Management
                                </a>
                            @endcan --}}



                            {{-- @can('Store Management')
                                <a href="#" class="nav-link">Store Management</a>
                            @endcan --}}

                            @can('Cities')
                                <a href="{{ url('/cities') }}" class="nav-link">Cities</a>
                            @endcan

                            {{-- @can('Print Preferences')
                                <a href="{{ route('printPreference.index') }}" class="nav-link">Print Preferences</a>
                            @endcan --}}

                            @can('Shortcut Preferences')
                                <a href="{{ route('shortkut.index') }}" class="nav-link">Shortcut Preferences</a>
                            @endcan

                            @can('General Preferences')
                                <a href="{{ url('/general_preferences') }}" class="nav-link">General Preferences</a>
                            @endcan
                        </nav>
                    </li>
                @endif
            </ul>
        </div>

        <div class="az-header-right">
            <a href="{{ url('/clear-cache') }}" title="Clear System Cache" class="" id="noti_my_jobs"><i
                    class="typcn typcn-refresh" style="font-size:24px;color:#00beda"></i></a>
            <div class="dropdown az-header-notification">
                <a href="" class="" title="My General Notification" id="noti_general"><i
                        class="typcn typcn-bell"></i></a>
                <div class="dropdown-menu">
                    <div class="az-dropdown-header mg-b-20 d-sm-none">
                        <a href="" class="az-header-arrow"><i class="icon ion-md-arrow-back"></i></a>
                    </div>
                    <h6 class="az-notification-title">General Notifications</h6>
                    <p class="az-notification-text">You have <span id="noti_count_general">0</span> unread
                        notification</p>
                    <div class="az-notification-list" id="add_noti_general">
                    </div><!-- az-notification-list -->
                    <div class="dropdown-footer"><a href="">View All Notifications</a></div>
                </div><!-- dropdown-menu -->
            </div><!-- az-header-notification -->

            <div class="dropdown az-header-notification">
                <a href="" class="" title="My Payments Notification" id="noti_payments">
                    <i class="typcn typcn-mail"></i></a>
                <div class="dropdown-menu">
                    <div class="az-dropdown-header mg-b-20 d-sm-none">
                        <a href="" class="az-header-arrow"><i class="icon ion-md-arrow-back"></i></a>
                    </div>
                    <h6 class="az-notification-title">Payments</h6>
                    <p class="az-notification-text">You have <span id="noti_count_payments">0</span> unread
                        notification</p>
                    <div class="az-notification-list" id="add_noti_payments"></div>
                    <div class="dropdown-footer"><a href="">View All Notifications</a></div>
                </div>
            </div>

            <!-- az-header-notification -->
            <div class="dropdown az-profile-menu">
                <a href="" class="az-img-user"><img src="{{ url('/img/default_user_2.png') }}"
                        alt="" style="height:30px;width:30px;border-radius: 50%;"></a>
                <div class="dropdown-menu">
                    <div class="az-dropdown-header d-sm-none">
                        <a href="" class="az-header-arrow"><i class="icon ion-md-arrow-back"></i></a>
                    </div>
                    <div class="az-header-profile">
                        <div class="az-img-user">
                            <img src="{{ url('/img/default_user_2.png') }}" alt=""
                                style="height:100px;width:100px;border-radius: 50%;">
                        </div>
                        <br>
                        <h6>
                            <span style="font-weight:bold">User: <?= auth()->user()->name ?> </span>
                        </h6>
                    </div>

                    @if (auth()->user()->can('Profile'))
                        <a href="{{ url('my_profile') }}" class="dropdown-item">
                            <i class="typcn typcn-user-outline"></i>
                            My Profile
                        </a>
                    @endif

                    <!-- <a href="#" class="dropdown-item"><i class="typcn typcn-edit"></i> Edit Profile</a>
                    <a href="#" class="dropdown-item"><i class="typcn typcn-time"></i> My Activity</a>
                    <a href="#" class="dropdown-item"><i class="typcn typcn-cog-outline"></i> Account
                        Settings
                    </a>-->

                    <a href="{{ url('logout') }}" class="dropdown-item"><i class="typcn typcn-power-outline"></i>
                        Sign Out
                    </a>
                </div><!-- dropdown-menu -->
            </div>
            <span style="font-weight:bold"><?= auth()->user()->name ?></span>
        </div><!-- az-header-right -->
    </div><!-- container -->
</div><!-- az-header -->
