<div class="az-header no-print" style="border-bottom:1px solid #00beda;">
    <?php if(auth()->check()): ?>
    <?php else: ?>
        <a href="<?php echo e(route('login')); ?>">Login</a>
    <?php endif; ?>
    <div class="container-fluid">
        <div class="az-header-left">
            <a href="<?php echo e(url('admin')); ?>" class="az-logo"><span></span> <img src="<?php echo e(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="<?php echo e(url('admin')); ?>" class="az-logo"><span></span> <img src="<?php echo e(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">
                
                <?php if(auth()->user()->can('Dashboard')): ?>
                    <li class="nav-item">
                        <a href="<?php echo e(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">
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Admin Dashboard')): ?>
                                    <a href="<?php echo e(url('admin')); ?>" class="nav-link">
                                        Admin Dashboard
                                    </a>
                                <?php endif; ?>

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Accounts Dashboard')): ?>
                                    <a href="<?php echo e(url('accounts_dashboard')); ?>" class="nav-link">
                                        Accounts Dashboard
                                    </a>
                                <?php endif; ?>

                                <!--<a href="<?php echo e(url('manager_dashboard')); ?>" class="nav-link">Manager Dashboard</a>-->
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Sales Dashboard')): ?>
                                    <a href="<?php echo e(url('sales_dashboard')); ?>" class="nav-link">Sales Dashboard</a>
                                <?php endif; ?>
                            </nav>
                        </div>
                    </li>
                <?php endif; ?>
                

                <?php 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">
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Goods Receipts')): ?>
                                    <a href="<?php echo e(route('good_receipts.list')); ?>" class="nav-link">
                                        <i class="typcn typcn-archive"></i> Good Receipts
                                    </a>
                                <?php endif; ?>

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Sales')): ?>
                                    <a href="<?php echo e(route('sales.list')); ?>" class="nav-link">
                                        <i class="typcn typcn-chart-bar"></i> Sales
                                    </a>
                                <?php endif; ?>

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('B-Cheque')): ?>
                                    <a href="<?php echo e(route('b_cheque.list')); ?>" class="nav-link">
                                        <i class="typcn typcn-credit-card"></i> B-Cheque
                                    </a>
                                <?php endif; ?>

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Customers')): ?>
                                    <a href="<?php echo e(url('customers')); ?>" class="nav-link">
                                        <i class="typcn typcn-user"></i> Customers
                                    </a>
                                <?php endif; ?>

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Suppliers')): ?>
                                    <a href="<?php echo e(route('supplier.list')); ?>" class="nav-link">
                                        <i class="typcn typcn-group"></i> Suppliers
                                    </a>
                                <?php endif; ?>

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Purchasers')): ?>
                                    <a href="<?php echo e(route('purchaser.list')); ?>" class="nav-link">
                                        <i class="typcn typcn-group"></i> Purchasers
                                    </a>
                                <?php endif; ?>

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Sales Rate Application')): ?>
                                    <a href="<?php echo e(route('sale_rate.create')); ?>" class="nav-link">
                                        <i class="typcn typcn-edit"></i> Sale Rate Application
                                    </a>
                                <?php endif; ?>
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Purchase Order')): ?>
                                    <a href="<?php echo e(route('po.list')); ?>" class="nav-link">
                                        <i class="typcn typcn-shopping-bag"></i> Purchase Order
                                    </a>
                                <?php endif; ?>

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Purchase list')): ?>
                                    <a href="<?php echo e(url('po/list')); ?>" class="nav-link">
                                        <i class="typcn typcn-shopping-cart"></i> Purchase Order
                                    </a>
                                <?php endif; ?>


                            </nav>
                        </div>
                    </li>
                <?php endif; ?>

                <?php 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">
                            

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Product Category')): ?>
                                <a href="<?php echo e(url('product_cate_main/list')); ?>" class="nav-link">
                                    <i class="typcn typcn-th-large-outline"></i> Product Categories
                                </a>
                            <?php endif; ?>

                            <?php if (\Gate::any(['All Products Inventory'])): ?>
                                <a href="<?php echo e(route('products.all')); ?>" class="nav-link">
                                    <i class="typcn typcn-box"></i> All Products Inventory
                                </a>
                            <?php endif; ?>
                        </nav>
                    </li>
                <?php endif; ?>

                <?php 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">
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Chart of Accounts')): ?>
                                <a href="<?php echo e(url('main_account')); ?>" class="nav-link">
                                    <i class="typcn typcn-book"></i> Chart of Accounts
                                </a>
                            <?php endif; ?>

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Journal Vouchers')): ?>
                                <a href="<?php echo e(url('voucher/list')); ?>" class="nav-link">
                                    <i class="typcn typcn-document-text"></i> Journal Vouchers
                                </a>
                            <?php endif; ?>

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Payment Vouchers')): ?>
                                <a href="<?php echo e(route('payment.list')); ?>" class="nav-link">
                                    <i class="typcn typcn-credit-card"></i> Payment Vouchers
                                </a>
                            <?php endif; ?>

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Receipts Vouchers')): ?>
                                <a href="<?php echo e(route('receipt_voucher.list')); ?>" class="nav-link">
                                    <i class="typcn typcn-download-outline"></i> Receipts Vouchers
                                </a>
                            <?php endif; ?>

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Service Vouchers')): ?>
                                <a href="<?php echo e(route('service_vouchers.index')); ?>" class="nav-link">
                                    <i class="typcn typcn-shopping-bag"></i> Service Vouchers
                                </a>
                            <?php endif; ?>
                        </nav>
                    </li>
                <?php endif; ?>

                <?php 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">
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Reports Management Sale Bill')): ?>
                                <a href="<?php echo e(route('sale-bill.report')); ?> " class="nav-link">
                                    <i class="typcn typcn-ticket"></i> Sale Bill
                                </a>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Reports Management Sale Register')): ?>
                                <a href="<?php echo e(route('sale-register.report')); ?>" class="nav-link">
                                    <i class="typcn typcn-document-text"></i> Sale Register
                                </a>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Reports Management Truck Sale Register')): ?>
                                <a href="<?php echo e(route('truck-sale-register.report')); ?>" class="nav-link">
                                    <i class="typcn typcn-shopping-bag"></i> Truck Sale Register
                                </a>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Reports Management Stock Hand')): ?>
                                <a href="<?php echo e(route('stockInHandRegister.report')); ?>" class="nav-link">
                                    <i class="typcn typcn-download-outline"></i> Stock In Hand
                                </a>
                            <?php endif; ?>


                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Reports Management Receivables')): ?>
                                <a href="<?php echo e(route('receivables.report')); ?>" class="nav-link">
                                    <i class="typcn typcn-chart-line-outline"></i> Receivables
                                </a>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Reports Management General Ledger')): ?>
                                <a href="<?php echo e(route('general-ledger.index')); ?>" class="nav-link">
                                    <i class="typcn typcn-document-text"></i> General Ledger
                                </a>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Reports Management Trial Balance')): ?>
                                <a href="<?php echo e(route('trialBalance.report')); ?>" class="nav-link">
                                    <i class="typcn typcn-document-text"></i> Trial Balance
                                </a>
                            <?php endif; ?>

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Reports Management Aging Payables')): ?>
                                <a href="<?php echo e(route('aging-payables.index')); ?>" class="nav-link">
                                    <i class="typcn typcn-chart-line"></i> Aging Payables
                                </a>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Reports Management Account Comparison')): ?>
                                <a href="<?php echo e(route('account-comparison.index')); ?>" class="nav-link">
                                    <i class="typcn typcn-chart-line"></i> Account Comparison
                                </a>
                            <?php endif; ?>

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Reports Management Loan Advance')): ?>
                                <a href="<?php echo e(route('loan-advance-report.index')); ?>" class="nav-link">
                                    <i class="typcn typcn-arrow-forward-outline"></i> Loan Advance
                                </a>
                            <?php endif; ?>

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Reports Management Payroll History')): ?>
                                <a href="<?php echo e(route('payroll-history.index')); ?>" class="nav-link">
                                    <i class="typcn typcn-time"></i> Payroll History
                                </a>
                            <?php endif; ?>

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Reports Management Purchase Register')): ?>
                                <a href="<?php echo e(route('purchase-register.index')); ?>" class="nav-link">
                                    <i class="typcn typcn-shopping-cart"></i> Purchase Register
                                </a>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Reports Management Services Purchase Report')): ?>
                                <a href="<?php echo e(route('service-purchase-report.index')); ?>" class="nav-link">
                                    <i class="typcn typcn-shopping-cart"></i> Service Purchase Report
                                </a>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Reports Management Purchase Billing Vehicle Register Report')): ?>
                                <a href="<?php echo e(route('purchase-billing-vehicle-register.index')); ?>" class="nav-link">
                                    <i class="typcn typcn-shopping-cart"></i> Purchase Billing Vehicle Register Report
                                </a>
                            <?php endif; ?>

                        </nav>
                    </li>
                <?php endif; ?>

                <?php 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">
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Users Management')): ?>
                                <a href="<?php echo e(url('users')); ?>" class="nav-link">Users Management</a>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Roles Management')): ?>
                                <a href="<?php echo e(url('roles')); ?>" class="nav-link">Roles Management</a>
                            <?php endif; ?>
                            <hr>
                            <h5>HR</h5>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Departments')): ?>
                                <a href="<?php echo e(url('departments')); ?>" class="nav-link"> <i
                                        class="
 typcn typcn-key"></i>Departments</a>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Designations')): ?>
                                <a href="<?php echo e(url('designations')); ?>" class="nav-link"> <i
                                        class="
 typcn typcn-edit"></i>Designations</a>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Employees')): ?>
                                <a href="<?php echo e(url('employee')); ?>" class="nav-link"> <i
                                        class="
 typcn typcn-user"></i>Employees</a>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Attendance')): ?>
                                <a href="<?php echo e(url('attendance')); ?>" class="nav-link">
                                    <i class="typcn typcn-image"></i> Attendance
                                </a>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Employee Payrolls')): ?>
                                <a href="<?php echo e(url('payrolls')); ?>" class="nav-link">
                                    <i class="typcn typcn-key"></i> Employee Payrolls
                                </a>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Employee Overtimes list')): ?>
                                <a href="<?php echo e(route('overtimes.index')); ?>" class="nav-link">
                                    <i class="typcn typcn-time"></i> Employee Overtimes
                                </a>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Employee Advances list')): ?>
                                <a href="<?php echo e(route('advances.index')); ?>" class="nav-link">
                                    <i class="typcn typcn-arrow-up-thick"></i>
                                    Employee Advances
                                </a>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Employee Loans list')): ?>
                                <a href="<?php echo e(route('loans.index')); ?>" class="nav-link">
                                    <i class="typcn typcn-credit-card"></i>
                                    Employee Loans
                                </a>
                            <?php endif; ?>
                            
                            
                        </nav>
                    </li>
                <?php endif; ?>

                <?php 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">
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Measurement Units')): ?>
                                <a href="<?php echo e(url('measurement_unit')); ?>" class="nav-link">Measurement Units</a>
                            <?php endif; ?>

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Unit Types')): ?>
                                <a href="<?php echo e(url('unit_type')); ?>" class="nav-link">Unit Types</a>
                            <?php endif; ?>

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Discounts')): ?>
                                <a href="<?php echo e(url('discounts')); ?>" class="nav-link">Discounts</a>
                            <?php endif; ?>

                            



                            

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Cities')): ?>
                                <a href="<?php echo e(url('/cities')); ?>" class="nav-link">Cities</a>
                            <?php endif; ?>

                            

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Shortcut Preferences')): ?>
                                <a href="<?php echo e(route('shortkut.index')); ?>" class="nav-link">Shortcut Preferences</a>
                            <?php endif; ?>

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('General Preferences')): ?>
                                <a href="<?php echo e(url('/general_preferences')); ?>" class="nav-link">General Preferences</a>
                            <?php endif; ?>
                        </nav>
                    </li>
                <?php endif; ?>
            </ul>
        </div>

        <div class="az-header-right">
            <a href="<?php echo e(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="<?php echo e(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="<?php echo e(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>

                    <?php if(auth()->user()->can('Profile')): ?>
                        <a href="<?php echo e(url('my_profile')); ?>" class="dropdown-item">
                            <i class="typcn typcn-user-outline"></i>
                            My Profile
                        </a>
                    <?php 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="<?php echo e(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 -->
<?php /**PATH /home/mdskssye/crm.mdskarachi.com/resources/views/layouts/header.blade.php ENDPATH**/ ?>