<div class="content-header">
   <div class="container-fluid">
      <div class="row mb-2">
         <div class="col-sm-6">
            <h1 class="m-0 text-dark">Customer Info
            </h1>
         </div>
         <!-- /.col -->
         <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
               <li class="breadcrumb-item"><a href="<?= base_url(); ?>/dashboard">Dashboard</a></li>
               <li class="breadcrumb-item active">Customer Info</li>
            </ol>
         </div>
      </div>
   </div>
</div>
<section class="content">
   <div class="container-fluid">
      <div class="card">
         <div class="card-body p-0">
            <div class="table-responsive">
               <table id="custtbl" class="table card-table table-vcenter text-nowrap">
                  <thead>
                     <tr>
                        <th class="w-1">id</th>
                        <th>Name</th>
                        <th>Mobile</th>
                        <th>Email</th>
                        <!--
                        <th>Address</th>
                        -->
                        <th>Status</th>
                        <?php if (userpermission('lr_cust_edit')) { ?>
                           <th>Image</th>
                           <th>Suspend Accounts</th>
                        <?php } ?>
                     </tr>
                  </thead>
                  <tbody>
                     <?php
                     if (!empty($customerlist)) {
                        $count = 1;
                        foreach ($customerlist["user"] as $id => $customerlists) {
                     ?>
                           <tr>
                              <td> <?php if (isset($customerlists["userDate"])) echo $customerlists["userDate"];
                                    $count++; ?></td>
                              <td> <?php echo output($customerlists['firstName']); ?></td>
                              <td> <?php echo output($customerlists['phoneNumber']); ?></td>
                              <td><?php echo output($customerlists['email']); ?></td>
                              <!--
                              <td><?php echo output($customerlists['homeAddress']); ?></td>
                             -->
                              <td> <span class="badge <?php echo ($customerlists['isActive'] == '1') ? 'badge-success' : 'badge-danger'; ?> "><?php echo ($customerlists['isActive'] == '1') ? 'Active' : 'Inactive'; ?></span> </td>
                              <?php if (userpermission('lr_cust_edit')) { ?>
                                 <td>
                                    <?php if ($customerlists['image'] != "") { ?>

                                       <img class="img-thumbnail" src="<?php echo output($customerlists['image']); ?>">
                                    <?php } else { ?>
                                       <img class="img-thumbnail" src="http://placehold.jp/150x150.png">
                                    <?php } ?>
                                 </td>
                                 <td>
                                    <?php if (!$customerlists["isApproved"] && !is_null($customerlists["isApproved"])) {
                                    ?>
                                       <a class="icon" href="<?php echo base_url(); ?>customer/unSuspendCustomer/<?php echo output($id); ?>">
                                          <button class="btn btn-success btn-block">UNSUSPEND</button>
                                       </a>
                                    <?php
                                    } else {
                                    ?>
                                       <a class="icon" href="<?php echo base_url(); ?>customer/suspendCustomer/<?php echo output($id); ?>">
                                          <button class="btn btn-warning btn-block">SUSPEND</button>
                                       </a>
                                    <?php
                                    } ?>
                                    <a class="icon" href="<?php echo base_url(); ?>customer/editcustomer/<?php echo output($id); ?>">
                                       <button class="btn btn-info btn-block mt-2">Edit</button>
                                    </a>
                                    <a class="icon" href="<?php echo base_url(); ?>customer/deleteCustomer/<?php echo output($id); ?>">
                                       <button class="btn btn-danger btn-block mt-2">Delete</button>
                                    </a>
                                 </td>
                              <?php } ?>
                           </tr>

                     <?php }
                     } ?>
                  </tbody>
               </table>
            </div>
         </div>
      </div>
   </div>
</section>