
            <?php
                session_start();
                               if(!isset($_SESSION['user_id']) || !isset($_SESSION['username'])){
    header("Location: index.php");
    exit();
}
       
                 $userid = $_SESSION['user_id'] ;
                 $username = $_SESSION['username'] ;
                 
            ?>
            <style>
               .content-wrapper {
    background: #f2edf3;
    padding:.25rem .25rem!important;
    width: 100%;
    -webkit-flex-grow: 1;
    flex-grow: 1;
}
.navbar .navbar-menu-wrapper .navbar-toggler {
    border: 0;
    color: inherit;
    height: 25px;
    border-radius: 0px;
    padding-left: 5px;
    padding-right: 20px;
}
.card .card-body {
    padding: 1rem 1rem!important;
}
     /* For Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* For Firefox */
input[type=number] {
  -moz-appearance: textfield;
}       </style>
            <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
            <nav class="sidebar sidebar-offcanvas" id="sidebar">
                
                <?php 
                if($username == 'admin'){
                
                ?>
                     <ul class="nav">
                  <li class="nav-item nav-profile">
                     <a href="#" class="nav-link">
                        <div class="nav-profile-image">
                           <img src="uploads/profile_default.png" alt="profile" />
                           <span class="login-status online"></span>
                           <!--change to offline or busy as needed-->
                        </div>
                        <div class="nav-profile-text d-flex flex-column">
                           <span class="font-weight-bold mb-2"><?php echo  $username;?></span>
                           <span class="text-secondary text-small">Project Manager</span>
                        </div>
                        <i class="mdi mdi-bookmark-check text-success nav-profile-badge"></i>
                     </a>
                  </li>
                  <li class="nav-item">
                     <a class="nav-link" href="dashboard">
                     <span class="menu-title">Home</span>
                     <!-- <i class="mdi mdi-home menu-icon"></i> -->
                     </a>
                  </li>
                
                  <li class="nav-item">
                     <a class="nav-link" href="add-company" >
                     <span class="menu-title">Manage Company</span>
                     <!-- <i class="fa fa-plus-circle menu-icon"></i> -->
                     </a>
                  </li>
                 
                  <li class="nav-item">
                     <a class="nav-link" href="add-customer">
                     <span class="menu-title">Manage Customer</span>
                     <!-- <i class="fa fa-plus-circle menu-icon"></i> -->
                     </a>
                  </li>
                  <li class="nav-item">
                     <a class="nav-link" href="add-sales-man">
                     <span class="menu-title">Manage Sales Man</span>
                     <!-- <i class="fa fa-plus-circle menu-icon"></i> -->
                     </a>
                  </li>
                   <li class="nav-item">
                     <a class="nav-link" href="add-category" >
                     <span class="menu-title">Manage Category</span>
                     <!-- <i class="fa fa-plus-circle menu-icon"></i> -->
                     </a>
                  </li>
                  <li class="nav-item">
                     <a class="nav-link" href="add-stock">
                     <span class="menu-title">Manage Stock</span>
                     <!-- <i class="fa fa-plus-circle menu-icon"></i> -->
                     </a>
                  </li>
                  <li class="nav-item">
                     <a class="nav-link" data-bs-toggle="collapse" href="#ui-basic2" aria-expanded="false" aria-controls="ui-basic">
                     <span class="menu-title">Orders</span>
                     <i class="menu-arrow"></i>
                     <!-- <i class="mdi mdi-crosshairs-gps menu-icon"></i> -->
                     </a>
                     <div class="collapse" id="ui-basic2">
                        <ul class="nav flex-column sub-menu">
                           <!-- <li class="nav-item">
                              <a class="nav-link" href="password-reset">Password Reset</a>
                           </li> -->
                           <li class="nav-item">
                              <a class="nav-link"  href="create-order">Create Order</a>
                           </li>
                           <li class="nav-item">
                              <a class="nav-link"  href="manage-orders">Manage Orders</a>
                           </li>
                        </ul>
                     </div>
                  </li>
                  <li class="nav-item">
                     <a class="nav-link" data-bs-toggle="collapse" href="#ui-basic1" aria-expanded="false" aria-controls="ui-basic">
                     <span class="menu-title">Reports</span>
                     <i class="menu-arrow"></i>
                     <!-- <i class="mdi mdi-crosshairs-gps menu-icon"></i> -->
                     </a>
                     <div class="collapse" id="ui-basic1">
                        <ul class="nav flex-column sub-menu">
                           <!-- <li class="nav-item">
                              <a class="nav-link" href="password-reset">Password Reset</a>
                           </li> -->
                           <!--<li class="nav-item">-->
                           <!--   <a class="nav-link" href="stock-register">Stock Register</a>-->
                           <!--</li>-->
                           <!--<li class="nav-item">-->
                           <!--   <a class="nav-link" href="sales-man">Sales Man Register</a>-->
                           <!--</li>-->
                           <li class="nav-item">
                              <a class="nav-link" href="order-register">Order Register</a>
                           </li>
                           <li class="nav-item">
                              <a class="nav-link" href="order-item-register">Order items Report</a>
                           </li>
                           <li class="nav-item">
                              <a class="nav-link" href="reorder-report">Reorder Level</a>
                           </li>
                           <!-- <li class="nav-item">
                              <a class="nav-link" href="product-stock-register">Sales Man Register</a>
                           </li> -->
                        </ul>
                     </div>
                  </li>
                  <li class="nav-item">
                     <a class="nav-link" data-bs-toggle="collapse" href="#ui-basic" aria-expanded="false" aria-controls="ui-basic">
                     <span class="menu-title">Utilities</span>
                     <i class="menu-arrow"></i>
                     <!-- <i class="mdi mdi-crosshairs-gps menu-icon"></i> -->
                     </a>
                     <div class="collapse" id="ui-basic">
                        <ul class="nav flex-column sub-menu">
                           <!-- <li class="nav-item">
                              <a class="nav-link" href="password-reset">Password Reset</a>
                           </li> -->
                           <li class="nav-item">
                              <a class="nav-link" href="manage-accounts">Manage Accounts</a>
                           </li>
                        </ul>
                     </div>
                  </li>
                  <li class="nav-item">
                     <a class="nav-link" href="logout" target="_blank">
                     <span class="menu-title">Logout</span>
                     <!-- <i class="fa fa-sign-out menu-icon"></i> -->
                     </a>
                  </li>
               </ul>
               <?php }else{
                   ?>
                    <ul class="nav">
                  <li class="nav-item nav-profile">
                     <a href="#" class="nav-link">
                        <div class="nav-profile-image">
                           <img src="uploads/profile_default.png" alt="profile" />
                           <span class="login-status online"></span>
                           <!--change to offline or busy as needed-->
                        </div>
                        <div class="nav-profile-text d-flex flex-column">
                           <span class="font-weight-bold mb-2"><?php echo  $username;?></span>
                           <span class="text-secondary text-small"></span>
                        </div>
                        <i class="mdi mdi-bookmark-check text-success nav-profile-badge"></i>
                     </a>
                  </li>
                  <li class="nav-item">
                     <a class="nav-link" href="staff-dashboard">
                     <span class="menu-title">Home</span>
                     <!-- <i class="mdi mdi-home menu-icon"></i> -->
                     </a>
                  </li>
                
 
                  <li class="nav-item">
                     <a class="nav-link" data-bs-toggle="collapse" href="#ui-basic2" aria-expanded="false" aria-controls="ui-basic">
                     <span class="menu-title">Orders</span>
                     <i class="menu-arrow"></i>
                     <!-- <i class="mdi mdi-crosshairs-gps menu-icon"></i> -->
                     </a>
                     <div class="collapse" id="ui-basic2">
                        <ul class="nav flex-column sub-menu">
                           <!-- <li class="nav-item">
                              <a class="nav-link" href="password-reset">Password Reset</a>
                           </li> -->
                           <li class="nav-item">
                              <a class="nav-link"  href="create-order">Create Order</a>
                           </li>
                           <!--<li class="nav-item">-->
                           <!--   <a class="nav-link"  href="create-order">Manage Orders</a>-->
                           <!--</li>-->
                        </ul>
                     </div>
                  </li>
   
                  
                  <li class="nav-item">
                     <a class="nav-link" href="logout" target="_blank">
                     <span class="menu-title">Logout</span>
                     <!-- <i class="fa fa-sign-out menu-icon"></i> -->
                     </a>
                  </li>
               </ul>
                   
                   
              <?php }
                
                ?>
              
               
               
               
               <ul class="nav">
                  
                  <li class="nav-item">
                     <p style="margin-bottom: 0;">IP Address:<?php 
                     if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
                        $ip = $_SERVER['HTTP_CLIENT_IP'];
                     } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
                        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
                     } else {
                        $ip = $_SERVER['REMOTE_ADDR'];
                     }
                     echo $ip;
                  ?></p>
                     <p>License to Pipscart</p>
                     </a>
                  </li>
               </ul>
            </nav>