<div class="content-wrapper">
 <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><?= $menu ?></li>
   <li class="active"><?= $sub_menu ?></li>
 </ol>
</section>
<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-md-12">
  <div class="box box-warning">
   <div class="box-header with-border">
     <div class="col-md-6">
      <h3 class="box-title">Driver Details</h3>
     </div>
     <div class="col-md-6" align="right">
        <a class="btn btn-sm btn-primary" href="<?= base_url('Driver/edit/'.encode_param($driver_id)) ?>">Edit</a>
        <a class="btn btn-sm btn-primary" href="<?= base_url('Driver/driver_list') ?>">Back</a>
     </div>
   </div>
   <div class="box-body">
    <div>
      <div class="col-md-2">
        <div class="form-group has-feedback">
         <img src="<?= base_url($driver_data->profile_image) ?>" onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>';" height="100" width="100" />
       </div>
     </div>
     <div class="col-md-5" style="width:380px;">
       <div class="form-group has-feedback">
         <span style="padding-right: 73px;">Name </span> :
         <label style="padding-left: 10px;">
           <?= $driver_data->first_name.' '.$driver_data->last_name ?> 
         </label>
      </div> 
       <div class="form-group has-feedback">
         <span style="padding-right: 58px;">Email ID </span> :
         <label style="padding-left: 10px;">
          <?= $driver_data->email_id ?>
         </label>
      </div> 
      <div class="form-group has-feedback">
       <span style="padding-right: 69px;">Phone </span> :
       <label style="padding-left: 10px;">
        <?= $driver_data->phone ?>
        </label>
     </div>  
      <div class="form-group has-feedback">
       <span style="padding-right: 51px;">Company </span> :
       <label style="padding-left: 10px;">
        <?= $driver_data->company_name ?>
        </label>
     </div>  
      <div class="form-group has-feedback">
       <span style="padding-right: 61px;">Address </span> :
       <label style="padding-left: 10px;">
        <?= $driver_data->address ?>
        </label>
     </div> 
      <div class="form-group has-feedback">
       <span style="padding-right: 85px;">City </span> :
       <label style="padding-left: 10px;">
        <?= $driver_data->city ?>
        </label>
     </div> 
      <div class="form-group has-feedback">
       <span style="padding-right: 78px;">State </span> :
       <label style="padding-left: 10px;">
        <?= $driver_data->state ?>
        </label>
     </div> 
      <div class="form-group has-feedback">
       <span style="padding-right: 35px;">Vehicle Type </span> :
       <label style="padding-left: 10px;">
        <?= $driver_data->vehicle_type ?>
        </label>
     </div> 
      <div class="form-group has-feedback">
       <span style="padding-right: 67px;">Vehicle </span> :
       <label style="padding-left: 10px;">
        <?= $driver_data->vehicle_model ?>
        </label>
     </div> 
      <div class="form-group has-feedback">
       <span style="padding-right: 28px;">Vehicle Model </span> :
       <label style="padding-left: 10px;">
        <?= $driver_data->model ?>
        </label>
     </div> 
      <div class="form-group has-feedback">
       <span style="padding-right: 20px;">Vehicle Reg No. </span> :
       <label style="padding-left: 10px;">
        <?= $driver_data->vehicle_reg_no ?>
        </label>
     </div> 
   </div>
   <div class="col-md-5">
      <div class="form-group has-feedback">
       <div class="col-md-5" >
        <span style="padding-right: 27px;">Active Location </span> :
      </div>
       <label>
        <?= $driver_data->active_location ?>
        </label>
     </div> 
     <?php 
     $online_time = ' -- ';
     if(!empty($driver_data->online_start_time) && !empty($driver_data->online_end_time)){ 
      $online_time = date('G:i',$driver_data->online_start_time).' - '.date('G:i',$driver_data->online_end_time);
     }?>
      <div class="form-group has-feedback">
        <div class="col-md-5" >
          <span style="padding-right: 34px;">Online Timing </span> :
        </div>
        <label>
          <?= $online_time ?>
        </label>
      </div> 
      <div class="form-group has-feedback">
      <div class="col-md-5" >
        <span style="padding-right: 50px;">Licence No. </span> :
      </div>
       <label >
        <?= $driver_data->licence_number ?>
        </label>
     </div> 
      <div class="form-group has-feedback">
      <div class="col-md-5" >
        <span style="padding-right: 34px;">Licence Expiry </span> :
      </div>
       <label >
        <?= $driver_data->licence_exp_date ?>
        </label>
     </div> 
    <div class="form-group has-feedback">
      <div class="col-md-5" >
        <span style="padding-right: 38px;">Licence Proof </span> :
      </div>
      <div class="col-md-7" style="height: 200px;">
         <img id="licence_img" src="<?= base_url($driver_data->licence) ?>" onerror="this.src='<?=base_url("assets/images/no_image.png")?>';" style="height:auto;width:100%;" />
      </div>
    </div>  
  </div>
  </div>

</div>
</section>
</div>
