<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">
             <?php echo form_open_multipart('');?>
             <!--<form action="" method="post">-->
             	<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">
					   <label for="cartype">Cartype</label>
                       <select class="form-control" name="cartype">
                        <?php 
			  			$sql = $this->db->query('SELECT `id`, `typename` FROM `tbltypecar` ORDER BY `typename`');
			  			foreach ($sql->result() as $type)
			  			{  
			  			?>
             			 <option <?php echo $car->cartype == ''.$type->id.'' ? 'selected' : '' ?> value="<?php echo $type->id ?>"><?php echo $type->typename ?></option> 
              			<?php }?>
						</select>
                       
                       
					</div>
                    
                    <div class="form-group col-lg-8">
					   <label for="fullname">Full Name</label>
					   <input id="fullname" name="fullname" class="form-control" type="text" placeholder="Enter FullName" value="<?php echo $car->fullname?>">
					</div>
                  
                  	<div class="form-group col-lg-8">
                      <label for="brandname">Brand Name</label>
                        <select class="form-control" name="brandname">
                        <?php 
			  			$sql = $this->db->query('SELECT `id`,`name` FROM `tblbrand` ORDER BY `name`');
			  			foreach ($sql->result() as $brand)
			  			{  
			  			?>
             			 <option <?php echo $car->brandname == ''.$brand->id.'' ? 'selected' : '' ?> value="<?php echo $brand->id ?>"><?php echo $brand->name ?></option> 
              			<?php }?>
						</select>
                    </div>
                    
                    <div class="form-group col-lg-8">
					   <label for="year">Year</label>
					   <input id="year" name="year" class="form-control" type="text" placeholder="Enter Year" value="<?php echo $car->year?>">
					</div>
                    
                    <?php 
			  		if($car->status == 1){
					 	$authorize = "active";
					}elseif($car->status == 0){
					 	$authorize = "disactive";	
					}else{
					 	$authorize = "null";	
					}
			        ?>

                    <div class="form-group col-lg-8">
                    	<label for="status">Status</label>
						<div class="col-lg-12">
                        <input type="radio" name="status" class="flat-red" value="1" <?php echo $authorize == 'active' ? 'checked' : '' ?>> Active 
                        <input type="radio" name="status" class="flat-red" value="0" <?php echo $authorize == 'disactive' ? 'checked' : '' ?>> DisActive
                        </div> 
                    </div>
                    
                    
                    <div class="form-group col-lg-8">
                    <label>
                      <input type="checkbox" name="slide" value="1" <?php echo $car->slideshow == '1' ? 'checked' : '' ?>>
                      Slideshow
                    </label>
                    </div>
                    
                    <div class="form-group col-lg-8">
                    	<input type="file" name="userfile" id="userfile" accept="image/*">
                    </div>
                    
                    <div class="form-group col-lg-8">
                    	<label for="detail">Detail</label>
                    	<textarea id="textarea" name="detail" class="textarea"  style="width: 100%; height: 200px; font-size: 14px; line-height: 18px; border: 1px solid #ADADAD; padding: 10px;" ><?php echo $car->detail?></textarea>
                    </div>
                    
                    <div class="form-group col-lg-8">
                     <input type="submit" name="update_car" value="Update" class="btn btn-primary"/>
                     <button type="reset" class="btn btn-danger">Reset</button>
                    </div>
                    
                    
                </div>
             </form>
            </div>
        </section>
     </div>
