<?php 
require_once '../model/function.php'; $engine = new DB_Engine();
 $newJoiningRequestCount = $engine->getNewJoiningRequestCount();
 $orderCounts = $engine->getOrderStatusCounts();
 ?>
<!-- ========== App Menu Start ========== -->
<div class="main-nav">
               <!-- Sidebar Logo -->
               <div class="logo-box">
                    <a href="index-2.html" class="logo-dark">
                         <!-- <img src="../aphro_logo.png" class="logo-sm" alt="logo sm"> -->
                         <!-- <img src="../aphro_logo.png" class="logo-lg" alt="logo dark"> -->
                          <h4 class="text-center text-white mt-2">Aphrodaily Admin</h4>
                    </a>

                    <a class="logo-light">
                         <!-- <img src="../aphro_logo.png" class="logo-sm" alt="logo sm"> -->
                         <!-- <img src="../aphro_logo.png" class="logo-lg" alt="logo light"> -->
                         <h4 class="text-center text-white mt-2">Aphrodaily Admin</h4>
                    </a>
               </div>

               <!-- Menu Toggle Button (sm-hover) -->
               <button type="button" class="button-sm-hover" aria-label="Show Full Sidebar">
                    <iconify-icon icon="solar:double-alt-arrow-right-bold-duotone" class="button-sm-hover-icon text-primary fs-20" ></iconify-icon>
               </button>

               <div class="scrollbar" data-simplebar>
                    <ul class="navbar-nav" id="navbar-nav">

                         <li class="menu-title">General</li>

                         <li class="nav-item">
                              <a class="nav-link" href="?a=home">
                                   <span class="nav-icon">
                                        <iconify-icon icon="solar:widget-5-bold-duotone" class="text-primary fs-20"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Dashboard </span>
                              </a>
                         </li>


                         <!--<li class="nav-item">-->
                         <!--     <a class="nav-link" href="settings.html">-->
                         <!--          <span class="nav-icon">-->
                         <!--          <iconify-icon icon="solar:cart-3-bold-duotone" class="text-primary fs-20"></iconify-icon>-->
                         <!--          </span>-->
                         <!--          <span class="nav-text"> New Sale </span>-->
                         <!--     </a>-->
                         <!--</li>-->

                         <li class="nav-item">
                              <a class="nav-link menu-arrow" href="#sidebarCategory" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="sidebarCategory">
                                   <span class="nav-icon">
                                        <iconify-icon icon="solar:clipboard-list-bold-duotone" class="text-primary fs-20"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Category </span>
                              </a>
                              <div class="collapse" id="sidebarCategory">
                                   <ul class="nav sub-navbar-nav">
                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=category">Categories</a>
                                        </li>                         
                                        <!-- <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="category-edit.html">Edit</a>
                                        </li> -->
                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=add_category">Create Category</a>
                                        </li>
                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=add_subcategory">Create sub-category</a>
                                        </li>
                                   </ul>
                              </div>
                         </li>


                         <li class="nav-item">
                              <a class="nav-link menu-arrow" href="#sidebarProducts" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="sidebarProducts">
                                   <span class="nav-icon">
                                        <iconify-icon icon="solar:t-shirt-bold-duotone" class="text-primary fs-20"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Products </span>
                              </a>
                              <div class="collapse" id="sidebarProducts">
                                   <ul class="nav sub-navbar-nav">

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=add_product">Add New Product</a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=list_products">Products</a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=low_stock_list">Low Stock List</a>
                                        </li>

                                        <!-- <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=list_products">Product Gallary</a>
                                        </li> -->

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=item_reviews">Review</a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=inventory">Inventory  </a>
                                        </li>

                                   </ul>
                              </div>
                         </li>

                         

                         <!-- <li class="nav-item">
                              <a class="nav-link menu-arrow" href="#sidebarStore" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="sidebarStore">
                                   <span class="nav-icon">
                                        <iconify-icon icon="solar:shop-2-bold-duotone" class="text-primary fs-20"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Stores </span>
                              </a>
                              <div class="collapse" id="sidebarStore">
                                   <ul class="nav sub-navbar-nav">
                                                            
                                         <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=store_management">Add Store</a>
                                        </li>
                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=store_management">Store List</a>
                                        </li>
                                   </ul>
                              </div>
                         </li> -->

                         

                         <li class="nav-item">
                              <a class="nav-link" href="?a=add_new_attribute">
                                   <span class="nav-icon">
                                   <iconify-icon icon="solar:confetti-minimalistic-bold-duotone" class="text-primary fs-20"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Attributes </span>
                              </a>
                         </li>


                         <li class="nav-item">
                              <a class="nav-link" href="?a=add_new_unit">
                                   <span class="nav-icon">
                                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="text-primary fs-20"><path fill="currentColor" d="M18.5 1.586L22.914 6L21.5 7.414l-2-2v13.172l2-2L22.914 18L18.5 22.414L14.086 18l1.414-1.414l2 2V5.414l-2 2L14.086 6zM2 2h10v20H2z"/></svg>
                                   </span>
                                   <span class="nav-text"> Units </span>
                              </a>
                         </li>


                         <li class="nav-item">
                              <a class="nav-link menu-arrow" href="#sidebarOrders" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="sidebarOrders">
                                   <span class="nav-icon">
                                        <iconify-icon icon="solar:bag-smile-bold-duotone" class="text-primary fs-20"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Orders </span>
                              </a>
                              <div class="collapse" id="sidebarOrders">
                                   <ul class="nav sub-navbar-nav">
                                        <?php echo $engine->renderOrderNavItems($orderCounts); ?>
                                   </ul>
                              </div>
                              <!-- <div class="collapse" id="sidebarOrders">
                                   <ul class="nav sub-navbar-nav">

                                        <li class="sub-nav-item">
                                             <a href="?a=orders_list" class="sub-nav-link d-flex justify-content-between align-items-center">
                                                  <span>All</span>
                                                  <span class="badge bg-info">4</span>
                                             </a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a href="?a=pending_orders" class="sub-nav-link d-flex justify-content-between align-items-center">
                                                  <span>Pending</span>
                                                  <span class="badge bg-danger rounded-pill">4</span>
                                             </a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a href="?a=accepted_orders" class="sub-nav-link d-flex justify-content-between align-items-center">
                                                  <span>Accepted</span>
                                                  <span class="badge bg-primary rounded-pill">4</span>
                                             </a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a href="?a=scheduled_orders" class="sub-nav-link d-flex justify-content-between align-items-center">
                                                  <span>Scheduled</span>
                                                  <span class="badge bg-primary rounded-pill">4</span>
                                             </a>
                                        </li>


                                        <li class="sub-nav-item">
                                             <a href="?a=processing_orders"  class="sub-nav-link d-flex justify-content-between align-items-center">
                                                  <span>Processing</span>
                                                  <span class="badge bg-warning rounded-pill">4</span>
                                             </a>
                                        </li>


                                        <li class="sub-nav-item">
                                             <a href="?a=shipped_orders" class="sub-nav-link d-flex justify-content-between align-items-center">
                                                  <span>Shipped</span>
                                                  <span class="badge bg-primary rounded-pill">4</span>
                                             </a>
                                        </li>


                                        <li class="sub-nav-item">
                                             <a href="?a=delivered_orders" class="sub-nav-link d-flex justify-content-between align-items-center">
                                                  <span>Delivered</span>
                                                  <span class="badge bg-success rounded-pill">4</span>
                                             </a>
                                        </li>


                                        <li class="sub-nav-item">
                                             <a href="?a=refunded_orders" class="sub-nav-link d-flex justify-content-between align-items-center">
                                                  <span>Refunded</span>
                                                  <span class="badge bg-success rounded-pill">4</span>
                                             </a>
                                        </li>


                                        <li class="sub-nav-item">
                                             <a href="?a=offline_payment_orders" class="sub-nav-link d-flex justify-content-between align-items-center">
                                                  <span>Offline Payment</span>
                                                  <span class="badge bg-info rounded-pill">4</span>
                                             </a>
                                        </li>

                                   </ul>
                              </div> -->
                         </li>

                         <li class="nav-item">
                              <a class="nav-link menu-arrow" href="#sidebarRefund" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="sidebarRefund">
                                   <span class="nav-icon">
                                        <iconify-icon icon="solar:bill-list-bold-duotone" class="text-primary fs-20"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Order Refund </span>
                              </a>
                              <div class="collapse" id="sidebarRefund">
                                   <ul class="nav sub-navbar-nav">
                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=refund_requests">Refund Requests</a>
                                        </li>
                                   </ul>
                              </div>
                         </li>


                         <li class="nav-item">
                              <a class="nav-link menu-arrow" href="#sidebarInvoice" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="sidebarInvoice">
                                   <span class="nav-icon">
                                        <iconify-icon icon="solar:bill-list-bold-duotone" class="text-primary fs-20"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Reporting and Analytics </span>
                              </a>
                              <div class="collapse" id="sidebarInvoice">
                                   <ul class="nav sub-navbar-nav">
                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=sales_report">Sales </a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=revenue">Revenue </a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=transaction_report">Transaction Report </a>
                                        </li>

                                        <!-- <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=revenue">Item Report </a>
                                        </li> -->

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=expense_report">Expense Report </a>
                                        </li>


                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=disbursement_report">Disbursement Report </a>
                                        </li>

                                        <!-- <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=revenue">Order Report </a>
                                        </li> -->


                                    
                                       
                                   </ul>
                              </div>
                         </li>


                         <li class="nav-item">
                              <a class="nav-link menu-arrow" href="#sidebarDispatch" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="sidebarDispatch">
                                   <span class="nav-icon">
                                        <iconify-icon icon="solar:bill-list-bold-duotone" class="text-primary fs-20"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Dispatch Management </span>
                              </a>
                              <div class="collapse" id="sidebarDispatch">
                                   <ul class="nav sub-navbar-nav">
                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=unassigned_orders">Unassigned Orders</a>
                                        </li>
                                                                 
                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=ongoing_orders">Ongoing Orders</a>
                                        </li> 
                                        
                                   </ul>
                              </div>
                         </li>



                         <li class="nav-item">
                              <a class="nav-link menu-arrow" href="#sidebarSettings" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="sidebarSettings">
                                   <span class="nav-icon">
                                        <iconify-icon icon="solar:bill-list-bold-duotone" class="text-primary fs-20"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Settings </span>
                              </a>
                              <div class="collapse" id="sidebarSettings">
                                   <ul class="nav sub-navbar-nav">
                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=business_hours">Business hours</a>
                                        </li>
                                                                 
                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=shipping_rate">Shipping Rate</a>
                                        </li> 
                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=tax_rates">Tax rates</a>
                                        </li> 
                                        <!-- <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=currency_settings">Currency settings</a>
                                        </li>  -->

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=exchange_rate">Exchange Rate</a>
                                        </li>

                                        <!-- <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=exchange_rate">Cancellation Reason</a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=exchange_rate">Refund Reason</a>
                                        </li> -->
                                   </ul>
                              </div>
                         </li>


                         <li class="menu-title mt-2">Users</li>

                         <li class="nav-item">
                              <a class="nav-link" href="?a=role_list">
                                   <span class="nav-icon">
                                         <iconify-icon icon="solar:user-speak-rounded-bold-duotone" class="text-primary fs-20"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Employee Role </span>
                              </a>
                         </li>


                         <li class="nav-item">
                              <a class="nav-link menu-arrow" href="#sidebarUsers" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="sidebarUsers">
                                   <span class="nav-icon">
                                        <iconify-icon icon="solar:accessibility-bold-duotone" class="text-primary fs-20"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Employes </span>
                              </a>
                              <div class="collapse" id="sidebarUsers">
                                   <ul class="nav sub-navbar-nav">
                                        <ul class="nav sub-navbar-nav">
                                             <li class="sub-nav-item">
                                                  <a class="sub-nav-link" href="?a=users">Add New</a>
                                             </li>
                                             <li class="sub-nav-item">
                                                  <a class="sub-nav-link" href="?a=users">List</a>
                                             </li>
                                        </ul>
                                   </ul>
                              </div>
                         </li>


                         
                         <li class="nav-item">
                              <a class="nav-link menu-arrow" href="#sidebarDelivery" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="sidebarDelivery">
                                   <span class="nav-icon">
                                        <iconify-icon icon="solar:delivery-bold-duotone" class="text-primary fs-20"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Deliveryman </span>
                              </a>
                              <div class="collapse" id="sidebarDelivery">
                                   <ul class="nav sub-navbar-nav">

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=vehicle_category_list">Vehicle Category</a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=add_deliveryman">Add Delivery</a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=deliveryman_request_list"><span>New Delivery Man </span>
                                             <span class="badge bg-primary rounded-pill ml-2"><?php echo $newJoiningRequestCount; ?></span></a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=deliveryman_list">Deliveryman List</a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=deliveryman_reviews">Review</a>
                                        </li>
                                        <!-- <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=customer_detail">Details</a>
                                        </li> -->
                                   </ul>
                              </div>
                         </li>


                         <li class="nav-item">
                              <a class="nav-link menu-arrow" href="#sidebarCustomers" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="sidebarCustomers">
                                   <span class="nav-icon">
                                        <iconify-icon icon="solar:users-group-two-rounded-bold-duotone" class="text-primary fs-20"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Customers </span>
                              </a>
                              <div class="collapse" id="sidebarCustomers">
                                   <ul class="nav sub-navbar-nav">

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=customers">Customers</a>
                                        </li>


                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=add_fund">Add Fund</a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=customer_wallet_report">Report</a>
                                        </li>

                                        <!-- <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=customers">Bonus</a>
                                        </li> -->


                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=loyalty_point">Loyal Points</a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=message_list">Contact Messages</a>
                                        </li>

                                        <!-- <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=customers">Subscribed Mail List</a>
                                        </li> -->
                                   </ul>
                              </div>
                         </li>

                         <li class="nav-item">
                              <a class="nav-link" href="?a=expenses">
                                   <span class="nav-icon">
                                   <iconify-icon icon="solar:book-bookmark-bold-duotone" class="text-primary fs-20"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Add Expense </span>
                              </a>
                         </li>

                         <li class="nav-item">
                              <a class="nav-link" href="?a=disbursements">
                                   <span class="nav-icon">
                                   <iconify-icon icon="solar:bonfire-bold-duotone" class="text-primary fs-20"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Add Disbursement </span>
                              </a>
                         </li>

                         <li class="nav-item">
                              <a class="nav-link menu-arrow" href="#sidebarBusinessManagement" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="sidebarBusinessManagement">
                                   <span class="nav-icon">
                                        <iconify-icon icon="solar:buildings-2-bold-duotone" class="text-primary fs-20"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Business Management </span>
                              </a>
                              <div class="collapse" id="sidebarBusinessManagement">
                                   <ul class="nav sub-navbar-nav">

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=list_gateway">Payment Gateway</a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=recaptcha">Recaptcha</a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=business_settings">Business Settings</a>
                                        </li>

                                        <!-- <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=customers">Withdrawal Request</a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=customers">Store Disbursment</a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=customers">Delivery Man Disbursment</a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=customers">Collect Cash</a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=customers">Delivery Man Payments</a>
                                        </li>

                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=customers">Withdrawal Method</a> -->
                                        </li>

                                   </ul>
                              </div>
                         </li>



                         
                         

                         <!-- <li class="nav-item">
                              <a class="nav-link menu-arrow" href="#sidebarSellers" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="sidebarSellers">
                                   <span class="nav-icon">
                                        <iconify-icon icon="solar:shop-bold-duotone"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Sellers </span>
                              </a>
                              <div class="collapse" id="sidebarSellers">
                                   <ul class="nav sub-navbar-nav">
                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="seller-list.html">List</a>
                                        </li>
                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="seller-details.html">Details</a>
                                        </li>
                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="seller-edit.html">Edit</a>
                                        </li>
                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="seller-add.html">Create</a>
                                        </li>
                                   </ul>
                              </div>
                         </li> -->

                         <!-- <li class="menu-title mt-2">Other</li> -->

                         <!-- <li class="nav-item">
                              <a class="nav-link menu-arrow" href="#sidebarCoupons" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="sidebarCoupons">
                                   <span class="nav-icon">
                                        <iconify-icon icon="solar:leaf-bold-duotone"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Coupons </span>
                              </a>
                              <div class="collapse" id="sidebarCoupons">
                                   <ul class="nav sub-navbar-nav">
                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=coupons_list">List</a>
                                        </li>
                                        <li class="sub-nav-item">
                                             <a class="sub-nav-link" href="?a=coupons_add">Add</a>
                                        </li>
                                   </ul>
                              </div>
                         </li> -->

                         <!-- <li class="nav-item">
                              <a class="nav-link" href="?a=review">
                                   <span class="nav-icon">
                                        <iconify-icon icon="solar:chat-square-like-bold-duotone"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Reviews </span>
                              </a>
                         </li> -->

                         <!-- <li class="menu-title mt-2">Support</li> -->

                         <!-- <li class="nav-item">
                              <a class="nav-link" href="?a=help">
                                   <span class="nav-icon">
                                        <iconify-icon icon="solar:help-bold-duotone"></iconify-icon>
                                   </span>
                                   <span class="nav-text"> Help Center </span>
                              </a>
                         </li> -->

                         
                    </ul>
               </div>
          </div>
          <!-- ========== App Menu End ========== -->