<style>
   .email-form-input {
      padding: 0.375rem 0.75rem;
      font-size: 1rem;
      font-weight: 400;
      line-height: 1.5;
      color: #495057;
      background-color: #ffffff;
      background-clip: padding-box;
      border: 1px solid #ced4da;
      border-radius: 0.25rem;
      box-shadow: inset 0 0 0 rgb(0 0 0 / 0%);
      transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
   }

   .email-form-input:focus,
   .email-form-input:active {
      border-color: rgba(126, 239, 104, 0.8);
      outline: 0 none;
   }

   .w-0-email {
      width: auto !important;
   }
</style>

<div class="content-header">
   <div class="container-fluid">
      <div class="row mb-2">
         <div class="col-sm-6">
            <h1 class="m-0 text-dark">Driver 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">Driver Info</li>
            </ol>
         </div>
         <!-- /.col -->
      </div>
      <!-- /.row -->
   </div>
   <!-- /.container-fluid -->
</div>
<!-- Main content -->
<section class="content">
   <div class="container-fluid">
      <div class="card">
         <div class="card-body p-0">
            <div class="table-responsive">
               <table id="driverslisttbl" class="table card-table table-vcenter text-nowrap">
                  <thead>
                     <tr>
                        <th class="w-1">id</th>
                        <th>First Name</th>
                        <th>Last Name</th>

                        <th>Email</th>
                        <th>Contact</th>
                        <th>Is Active</th>
                        <!--
                        <th>Stripe Status</th>
-->
                        <?php if (userpermission('lr_drivers_list_edit')) { ?>
                           <th>Action</th>
                           <th>Opertaion</th>
                           <th>Suspend Accounts</th>
                        <?php } ?>
                     </tr>
                  </thead>
                  <tbody>
                     <?php if (!empty($driverslist)) {
                        $count = 1;
                        foreach ($driverslist["user"] as $id => $driverslists) {
                     ?>
                           <tr>
                              <td> <?php if (isset($driverslists["userDate"])) echo $driverslists["userDate"];
                                    $count++; ?></td>
                              <td>

                                 <p>
                                    <!--
<span class="badge <?php echo ($driverslists['isOnline'] == '1') ? 'badge-success' : 'badge-danger'; ?> "><?php echo ($driverslists['isOnline'] == '1') ? 'Online' : 'Offline'; ?></span>
-->
                                    <?php echo $driverslists["firstName"] ?>

                                 </p>
                              </td>
                              <td>
                                 <p><?php echo $driverslists["lastName"] ?></p>
                              </td>


                              <td> <?php echo $driverslists["email"] ?> </td>
                              <td><?php echo $driverslists["phoneNumber"] ?></td>


                              <td>
                                 <!--
                              	<span class="badge <?php echo ($driverslists['isOnline'] == '1') ? 'badge-success' : 'badge-danger'; ?> "><?php echo ($driverslists['isOnline'] == '1') ? 'Active' : 'Inactive'; ?></span>
-->
                                 <span class="badge <?php echo ($driverslists['isOnline'] == '1') ? 'badge-success' : 'badge-danger'; ?> "><?php echo ($driverslists['isOnline'] == '1') ? 'Online' : 'Offline'; ?></span>
                              </td>
                              <?php if (userpermission('lr_drivers_list_edit')) { ?>
                                 <td>
                                    <!-- <a class="icon" href="<?php echo base_url(); ?>drivers/editdriver/<?php echo output($id); ?>">
                                       <i class="fa fa-edit"></i>
                                    </a> -->

                                    <a class="icon" href="<?php echo base_url(); ?>drivers/view_vehicle/<?php echo output($id); ?>">
                                       <i class="fa fa-eye"></i>
                                    </a>
                                 </td>
                                 <td>
                                    <?php
                                    // echo "<pre>";
                                    // print_r($driverslists["isVerified"]);
                                    // echo "</pre>";   

                                    if (is_null($driverslists["isVerified"]) || $driverslists["isVerified"] == "notApproved" || $driverslists["isVerified"] == "suspended" || $driverslists["isVerified"] == "pending") {
                                    ?>
                                       <a href="<?php echo base_url(); ?>drivers/approveDriver/<?php echo output($id); ?>">
                                          <button class="btn btn-success btn-block mb-2">Approve</button>
                                       </a>
                                       <a href="<?php echo base_url(); ?>drivers/rejectDriver/<?php echo output($id); ?>">
                                          <button class="btn btn-danger btn-block mb-2">Reject</button>
                                       </a>
                                       <?php
                                    } else {
                                       if ($driverslists["isVerified"] == "approved" || $driverslists["isVerified"] == "Approved") {
                                       ?>
                                          <button class="btn btn-success btn-block mb-2">Approved</button>
                                       <?php
                                       } elseif ($driverslists["isVerified"] == "pending") {
                                       ?>
                                          <button class="btn btn-warning btn-block mb-2">Pending...</button>
                                    <?php
                                       }else{

                                       }
                                    }
                                    ?>
                                 </td>

                                 <td>
                                    <?php if (!is_null($driverslists["isApproved"]) && !$driverslists["isApproved"] && $driverslists["isVerified"] == "suspended") {
                                    ?>
                                       <a class="icon">
                                          <button class="btn btn-info btn-block">SUSPENDED</button>
                                       </a>
                                    <?php
                                    } else {
                                    ?>
                                       <a class="icon" href="<?php echo base_url(); ?>drivers/suspendDriver/<?php echo output($id); ?>">
                                          <button class="btn btn-warning btn-block">SUSPEND</button>
                                       </a>
                                    <?php
                                    }
                                    ?>
                                    <a class="icon" href="<?php echo base_url(); ?>drivers/deleteDriver/<?php echo output($id); ?>">
                                       <button class="btn btn-danger btn-block mt-2">Delete</button>
                                    </a>
                                 </td>

                        <?php }
                           }
                        } ?>
                           </tr>
                  </tbody>
               </table>

            </div>
         </div>
         <!-- /.card-body -->
      </div>
   </div>
</section>
<!-- /.content -->