<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('Ride/view_rides') ?>">Back</a>
     </div>
   </div>
   <div class="box-body">
      <div class="col-md-6"> Booking Type </div>
      <div class="col-md-1"> : </div> 
      <div class="col-md-5"> <?= (empty($data->broker_name))?'Phone Booking':$data->broker_name ?> </div>
      <?php
        $col = 0;
        $row_html = '<div class="col-md-6"> {:label} </div>
                     <div class="col-md-1"> : </div> 
                     <div class="col-md-5"> {:value} </div>';

        foreach($ride_data AS $key => $ride){
            switch ($key){
              case 'Wheelchair_Flag':$ride = ($ride == 1)?'YES':'NO';break;
              case 'Attendant_Flag':$ride = ($ride == 1)?'YES':'NO';break;
              case 'Pregnant_Flag':$ride = ($ride == 1)?'YES':'NO';break;
              case 'Crutches_/_Walker_/_Cane_Flag':$ride = ($ride == 1)?'YES':'NO';break; 
              case 'Trip_Reason_Code': $key = 'Trip Reason';$ride = $data->reason;break;
              case 'Vehicle_Type':$ride = $data->vehicle_type;break;
              case 'Trip_Type':$ride = $data->trip_type;break;
              case 'Trip_Status':$ride = (!empty($ride))?$data->trip_status:'';break;
            }
            $key = str_replace('_',' ',$key);
            echo str_replace(array('{:label}','{:value}'), array($key,$ride), $row_html);
        }
     ?>
  </div>
</section>
</div>
