<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">Car</li>
          </ol>
        </section>
        
        <section class="content">
        	<div class="col-lg-12">

             	<div class="box box-primary col-lg-8">
                	<div class="box-header with-border">
						<h3 class="box-title">FORM EDIT</h3>
					</div>
                    
                    <div class="form-group col-lg-8">
                    	<table class="table">
                        <tr>
                        	<th style="border-top: 1px solid #ddd;width:80px;">Car :</th>
                        	<td style="border-top: 1px solid #ddd;"><?php echo $car->fullname?></td>
                        </tr>
                        <tr>
                        	<th style="width:80px;">Year :</th>
                        	<td><?php echo $car->year?></td>
                        </tr>
                        <tr>
                        	<th style="width:80px;">Quality :</th>
                            <td><?php echo $car->quality;?></td>
                      	</tr>
                        
                     </table>
                    </div>
                    <div class="form-group col-lg-12">
                        <table id="example1" class="table table-bordered table-striped">
                        <thead>
                          <tr>
                            <th>ID</th>
                            <th></th>
                            <th></th>
                            <th>Car</th>
                            <th>Service For</th>
                            <th>Route Code</th>
                            <th>Location From</th>
                            <th>Location To</th>
                            <th>Price</th>
                            <th>Over Stay</th>
                            <th>Createby</th>
                            <th>Createdate</th>
                          </tr>
                        </thead>
                        <tbody>
                        <?php 
                        $i=0; 
						$price = $this->db->query('select a.*,(select tblroutes.routecode from tblroutes where a.RID = tblroutes.id) as routecode, (select b.typename from tblservices as b where a.service_id = b.id) as servicename,(select c.username from tbluser as c where a.createby = c.userid)as username,(select d.name from tblbrand as d where a.brand_id = d.id)as carname from tblprice as a where `car_id` = '.$car->id.' order by a.id DESC');
                        foreach($price->result_array() as $v)
                        {
                            $i++;
                            $routecode = getRoute($v['RID']);
                            $locationfrom = getlocationname($routecode['locationfrom']);
                            $locationto	 = getlocationname($routecode['locationto']);
                            echo'
                            <tr>
                              <td>'.$i.'</td>
                              <td><a href="'.site_url("admin/price/edit/".$v['id']."/".$car->id."").'"  target="_blank"><i class="fa fa-edit"></i>Edit</a></td>
                              <td><a href="'.site_url("admin/price/delete/".$v['id']."").'" class="confirmation"><i class="fa fa-remove"></i>Delete</a></td>
                              <td>'.$v['carname'].'</td>
                              <td>'.$v['servicename'].'</td>
                              <td>'.$v['routecode'].'</td>
                              <td>'.$locationfrom.'</td>
                              <td>'.$locationto.'</td>
                              <td style="color:red">'.$v['price'].'$</td>
						      <td style="color:red">'.$v['over_stay'].'$</td>
                              <td>'.$v['username'].'</td>
                              <td>'.$v['createdate'].'</td>
                            </tr>
                            ';
                        }
                        ?>  
                        </tbody>
                      </table>
                    </div>
                </div>
          
            </div>
        </section>
     </div>
