<main class="main-wrapper">
    <div class="main-content">
      <!-- orders section -->
      <div class="d-flex justify-content-between flex-wrap mb-3">
      <div>
        <h3>Users</h3>
       
      </div>
      <a href="<?php echo base_url().'Users/adduser' ?>" class="btn btnAdd"> Add New User</a>
      </div>
      <div class="table-responsive  card px-2 my-2  ">
        <table id="example" class="table tableStriped">
          <thead>
            <tr>
              <th scope="col ">
                <p class=" mb-0 thfont"> Name</p>
              </th>
              <th scope="col ">
                <p class=" mb-0 thfont">Email</p>
              </th>
              <th scope="col ">
                <p class=" mb-0 thfont">Phone</p>
              </th>


              <th scope="col ">
                <p class=" mb-0 thfont">Status</p>
              </th>
             
             
              <th scope="col ">
                <p class=" mb-0 thfont">Actions</p>
              </th>
            </tr>
          </thead>
          <div class="">
            <tbody class=" ">
              <!-- Add table rows with data here -->
             <?php foreach($users as $id=>$userlists){
            //  echo "<pre>";
            //  print_r($userlists);
            //  echo "</pre>";
              
              ?>



              <tr>
                <td><?php echo $userlists['fullname'];  ?></td>
                <td><?php echo $userlists['email'];  ?></td>
                <td><?php echo $userlists['phoneNumber'];  ?></td>


               <td>
               <?php if ($userlists["isApproved"] && !is_null($userlists["isApproved"])) {
                                    ?>
                                       <a class="icon" href="<?php echo base_url(); ?>users/suspendCustomer/<?php echo output($id); ?>">
                                          <button class="btn btn-success btn-block">UNSUSPEND</button>
                                       </a>
                                    <?php
                                    } else {
                                    ?>
                                       <a class="icon" href="<?php echo base_url(); ?>users/unSuspendCustomer/<?php echo output($id); ?>">
                                          <button class="btn btn-warning btn-block">SUSPEND</button>
                                       </a>
                                    <?php
                                    } ?> 
               
               </td>

                <td>
               
               
               <div class="dropdown">
               
                <button type="button" class="btn  py-0"  data-bs-toggle="dropdown" aria-expanded="false">
                  <i class="fa-solid fa-ellipsis-vertical"></i>
                 </button>
                <ul class="dropdown-menu">
                  <li><a class="dropdown-item" href="<?php echo base_url(); ?>users/editcustomers/<?php echo output($id); ?>">Edit</a></li>
                  <li><a class="dropdown-item" href="<?php echo base_url(); ?>users/delete_customer/<?php echo output($id); ?>">Delete</a></li>
                </ul>
              </div>

                </td>
              </tr>
              <?php } ?>
              <!-- Add more rows as needed -->

            </tbody>
          </div>
        </table>
      </div>
       
       
        
      </div>


      <div>
      


       
      </div>

    </div>
    </div>
  </main>