      <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
            Channellimo
            <small>Preview</small>
          </h1>
          <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
            <li><a href="#">Forms</a></li>
            <li class="active">Booking List</li>
          </ol>
        </section>
        
        <section class="content">
        	
           <div class="box">
             <div class="box-header">
               <h3 class="box-title"><!--<a href="#">Booking List</a>--></h3>
             </div><!-- /.box-header -->
             <div class="box-body">
                <table id="example1" class="table table-bordered table-striped">
                    <thead>
                      <tr>
                      	<th>ID</th>
                        <th>Service</th>
                        <th>Car</th>
                        <th>Pickup Location</th>
                        <th>Dropoff Location</th>
                        <th>From</th>
                        <th>To</th>
                        <th>Create date</th>
                        <th>Status</th>
                        <th></th>
                      </tr>
                    </thead>
                    <tbody>
                    <?php 
					$i=0;
					foreach($booking as $v)
					{
						$i++;
						if($v['confirm'] == "1"){$confirm="Confirm";}
						elseif($v['confirm'] == "2"){$confirm="Cancel";}
						elseif($v['confirm'] == "0"){$confirm="Not Confirm";}
						else{$confirm = "Null";};
				
						$to_date = new DateTime(''.$v['to_date'].' '.$v['to_time'].'');
						$from_date = new DateTime(''.$v['from_date'].' '.$v['from_time'].'');
						$create = new DateTime(''.$v['createdate'].'');
						if($v["confirm"] == "0" AND $v["createdate"] == date("Y-m-d")){$new = '<img src="'.base_url("assets/img/newgif.gif").'" width="32">';}else{$new ="";}
						
						if($v['pickup_location']=="" or $v['pickup_location']==0){
							$pick_name = substr($v['pick_up_other'],15);
						}else{
							$pick_name = $v['pick_up_location'];
						} 
						
						if($v['return_location']=="" or $v['return_location']==0){
							//$drop_name= $v['drop_off_other'];
							$drop_name = substr($v['drop_off_other'],0,10);
						}else{
							$drop_name = $v['drop_off_location'];
							
						} 
					 	echo'
						<tr>
						  <td>'.$i.''.$new.'</td>
						  <td>'.$v['servicename'].'</td>
						  <td>'.$v['brandname'].'</td>
						  <td>'.$pick_name.'</td>
						  <td>'.$drop_name.'</td>
						  <td>'.$from_date->format('d/M/Y h:i:s a ').'</td>
						  <td>'.$to_date->format('d/M/Y h:i:s a ').'</td>
						  <td>'.$create->format('d/M/Y').'</td>
						  <td>'.$confirm.'</td>
						  <td><a href="'.site_url("admin/booking_list/detail/".$v['id']."").'"><i class="fa fa-eye"></i></a></td>
						</tr>
						';
					}
					?>
                      
                    </tbody>
                    
                  </table>
                </div><!-- /.box-body -->
             </div><!-- /.box -->
            	
        </section>
       </div>
       
       <?php if($msg = $this->session->flashdata("message")): ?>
	   <script>
       	alert("<?php echo $msg?>");
       </script>
       <?php endif; ?>