<div class="content-wrapper" >
 <!-- Content Header (Page header) -->
 <section class="content-header">
  <h1>
     <?= $page_title ?>
      <small><?= $page_desc ?></small>
  </h1>
  <ol class="breadcrumb">
   <li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
   <li>User</li>
   <li class="active">View User</li>
 </ol>
</section>
<!-- Main content -->
<section class="content">
  <div class="row">
    <div class="col-md-12">
        <?php if($this->session->flashdata('message')) { 
            $flashdata = $this->session->flashdata('message'); ?>
            <div class="alert alert-<?= $flashdata['class'] ?>">
               <button class="close" data-dismiss="alert" type="button">×</button>
               <?= $flashdata['message'] ?>
            </div>
        <?php } ?>
   </div>
   <div class="col-xs-12">
    <div class="box">
     <div class="box-header">
      <h3 class="box-title">View User Details</h3>
    </div>
    <div class="box-body">
      <table id="" class="table table-bordered table-striped datatable ">
       <thead>
        <tr>
         <th class="hidden">ID</th>
         <th width="150px;">Driver Name</th> 
         <th width="150px;">Email ID</th> 
         <th width="150px;">Phone</th>
         <th width="150px;">Company</th>
         <th width="50px;">Status</th>
         <th width="500px;">Action</th>
       </tr>
     </thead> 
     <tbody>
      <?php
      if(!empty($drivers_data)){
        foreach($drivers_data as $driver) {
         ?>
         <tr>
           <th class="hidden"><?= $driver->driver_id ?></th>
           <td class="center"><?= $driver->first_name.' '.$driver->last_name ?></th> 
           <td class="center"><?= $driver->email_id ?></th> 
           <td class="center"><?= $driver->phone ?></th>
           <td class="center"><?= $driver->company_name ?></th>
           <td class="center"><?= ($driver->status == '1')?'Active':'Inactive'?></td>
           <td class="center">	 
              <a class="btn btn-sm btn-primary" 
                href="<?= base_url('Driver/view/'.encode_param($driver->driver_id)) ?>">
                <i class="fa fa-fw fa-edit"></i>View
              </a>
              <a class="btn btn-sm btn-danger" 
                href="<?= base_url('Driver/edit/'.encode_param($driver->driver_id)) ?>">
                <i class="fa fa-fw fa-trash"></i>Edit
              </a> 
              <a class="btn btn-sm btn-danger" 
                href="<?= base_url("Driver/changeStatus/".encode_param($driver->driver_id))."/2" ?>" 
                onClick="return doconfirm()">
                <i class="fa fa-fw fa-trash"></i>Delete
              </a>    
              <?php if($driver->status == 1){ ?>
                <a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Driver/changeStatus/".encode_param($driver->driver_id))."/0" ?>">
                  <i class="fa fa-cog"></i> De-activate
                </a>
              <?php } else { ?>
                <a class="btn btn-sm btn-success" href="<?= base_url("Driver/changeStatus/".encode_param($driver->driver_id))."/1" ?>">
                  <i class="fa fa-cog"></i> Activate
                </a>
              <?php } ?>
            </td>
          </tr>
      <?php } 
      }?>
    </tbody>
 </table>
</div>
</div>
</section>
</div>
