     <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">Peak Time</li>
          </ol>
        </section>
        
        <section class="content">
        	<div class="col-lg-12">
             <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="name">Service For</label>
                       <select class="form-control" name="service">
                        <?php 
			  			$sql = $this->db->query('SELECT `id`, `typename`, `status` FROM `tblservices` WHERE `status`= 1');
			  			foreach ($sql->result() as $service)
			  			{  
			  			?>
             			 <option <?php echo $peaktime->service_id == ''.$service->id.'' ? 'selected' : '' ?> value="<?php echo $service->id ?>"><?php echo $service->typename ?></option> 
              			<?php }?>
						</select>
                    </div>
                    
                    <div class="form-group col-lg-8">
					   <label for="name">Car Type</label>
                       <select class="form-control" name="cartype">
                        <?php 
			  			$sql = $this->db->query('SELECT `id`, `fullname` FROM `tblcar` ORDER BY `id`');
			  			foreach ($sql->result() as $car)
			  			{  
			  			?>
             			 <option <?php echo $peaktime->typecar == ''.$car->id.'' ? 'selected' : '' ?> value="<?php echo $car->id ?>"><?php echo $car->fullname ?></option> 
              			<?php }?>
						</select>
                    </div>
                    
                    <div class="form-group col-lg-8">
					   <label for="name">Location From</label>
					   <select class="form-control" name="from">
                        <?php 
			  			$sql = $this->db->query('SELECT `id`, `locationname` FROM `tbllocation` ORDER BY `id`');
			  			foreach ($sql->result() as $from)
			  			{  
			  			?>
             			 <option <?php echo $peaktime->from_location == ''.$from->id.'' ? 'selected' : '' ?> value="<?php echo $from->id ?>"><?php echo $from->locationname ?></option> 
              			<?php }?>
						</select>
					</div>
                    
                    <div class="form-group col-lg-8">
                    	<label for="status">Location To</label>
						<select class="form-control" name="to">
                        <?php 
			  			foreach ($sql->result() as $to)
			  			{  
			  			?>
             			 <option <?php echo $peaktime->to_location == ''.$to->id.'' ? 'selected' : '' ?> value="<?php echo $to->id ?>"> <?php echo $to->locationname ?></option> 
              			<?php }?>
						</select>
                    </div>
                    
                    <div class="form-group col-lg-8">
                    	<label for="name">Time From</label>
					   <select id="timefrom" name="timefrom" class="form-control">
                        <option value="12:00:00">12:00 AM</option>
                        <option value="12:30:00">12:30 AM</option>
                        <option value="13:00:00">01:00 AM</option>
                        <option value="13:30:00">01:30 AM</option>
                        <option value="14:00:00">02:00 AM</option>
                        <option value="14:30:00">02:30 AM</option>
                        <option value="15:00:00">03:00 AM</option>
                        <option value="15:30:00">03:30 AM</option>
                        <option value="16:00:00">04:00 AM</option>
                        <option value="16:30:00">04:30 AM</option>
                        <option value="17:00:00">05:00 AM</option>
                        <option value="17:30:00">05:30 AM</option>
                        <option value="18:00:00">06:00 AM</option>
                        <option value="18:30:00">06:30 AM</option>
                        <option value="19:00:00">07:00 AM</option>
                        <option value="19:30:00">07:30 AM</option>
                        <option value="20:00:00">08:00 AM</option>
                        <option value="20:30:00">08:30 AM</option>
                        <option value="21:00:00">09:00 AM</option>
                        <option value="21:30:00">09:30 AM</option>
                        <option value="22:00:00">10:00 AM</option>
                        <option value="22:30:00">10:30 AM</option>
                        <option value="23:00:00">11:00 AM</option>
                        <option value="23:30:00">11:30 AM</option>
                        <option value="00:00:00">12:00 PM</option>
                        <option value="00:30:00">12:30 PM</option>
                        <option value="01:00:00">01:00 PM</option>
                        <option value="01:30:00">01:30 PM</option>
                        <option value="02:00:00">02:00 PM</option>
                        <option value="02:30:00">02:30 PM</option>
                        <option value="03:00:00">03:00 PM</option>
                        <option value="03:30:00">03:30 PM</option>
                        <option value="04:00:00">04:00 PM</option>
                        <option value="04:30:00">04:30 PM</option>
                        <option value="05:00:00">05:00 PM</option>
                        <option value="05:30:00">05:30 PM</option>
                        <option value="06:00:00">06:00 PM</option>
                        <option value="06:30:00">06:30 PM</option>
                        <option value="07:00:00">07:00 PM</option>
                        <option value="07:30:00">07:30 PM</option>
                        <option value="08:00:00">08:00 PM</option>
                        <option value="08:30:00">08:30 PM</option>
                        <option value="09:00:00">09:00 PM</option>
                        <option value="09:30:00">09:30 PM</option>
                        <option value="10:00:00">10:00 PM</option>
                        <option value="10:30:00">10:30 PM</option>
                        <option value="11:00:00">11:00 PM</option>
                        <option value="11:30:00">11:30 PM</option>
                        </select>
                        
                    </div>
                    
                    <div class="form-group col-lg-8">
                       <label for="name">Time To</label>
					   <select id="timeto" name="timeto" class="form-control">
                        <option value="12:00:00">12:00 AM</option>
                        <option value="12:30:00">12:30 AM</option>
                        <option value="13:00:00">01:00 AM</option>
                        <option value="13:30:00">01:30 AM</option>
                        <option value="14:00:00">02:00 AM</option>
                        <option value="14:30:00">02:30 AM</option>
                        <option value="15:00:00">03:00 AM</option>
                        <option value="15:30:00">03:30 AM</option>
                        <option value="16:00:00">04:00 AM</option>
                        <option value="16:30:00">04:30 AM</option>
                        <option value="17:00:00">05:00 AM</option>
                        <option value="17:30:00">05:30 AM</option>
                        <option value="18:00:00">06:00 AM</option>
                        <option value="18:30:00">06:30 AM</option>
                        <option value="19:00:00">07:00 AM</option>
                        <option value="19:30:00">07:30 AM</option>
                        <option value="20:00:00">08:00 AM</option>
                        <option value="20:30:00">08:30 AM</option>
                        <option value="21:00:00">09:00 AM</option>
                        <option value="21:30:00">09:30 AM</option>
                        <option value="22:00:00">10:00 AM</option>
                        <option value="22:30:00">10:30 AM</option>
                        <option value="23:00:00">11:00 AM</option>
                        <option value="23:30:00">11:30 AM</option>
                        <option value="00:00:00">12:00 PM</option>
                        <option value="00:30:00">12:30 PM</option>
                        <option value="01:00:00">01:00 PM</option>
                        <option value="01:30:00">01:30 PM</option>
                        <option value="02:00:00">02:00 PM</option>
                        <option value="02:30:00">02:30 PM</option>
                        <option value="03:00:00">03:00 PM</option>
                        <option value="03:30:00">03:30 PM</option>
                        <option value="04:00:00">04:00 PM</option>
                        <option value="04:30:00">04:30 PM</option>
                        <option value="05:00:00">05:00 PM</option>
                        <option value="05:30:00">05:30 PM</option>
                        <option value="06:00:00">06:00 PM</option>
                        <option value="06:30:00">06:30 PM</option>
                        <option value="07:00:00">07:00 PM</option>
                        <option value="07:30:00">07:30 PM</option>
                        <option value="08:00:00">08:00 PM</option>
                        <option value="08:30:00">08:30 PM</option>
                        <option value="09:00:00">09:00 PM</option>
                        <option value="09:30:00">09:30 PM</option>
                        <option value="10:00:00">10:00 PM</option>
                        <option value="10:30:00">10:30 PM</option>
                        <option value="11:00:00">11:00 PM</option>
                        <option value="11:30:00">11:30 PM</option>
                       </select>
                        
                    </div>
                    
                    <div class="form-group col-lg-8">
					   <label for="name">Amount</label>
					   <input id="amount" value="<?php echo $peaktime->amount?>" name="amount" class="form-control" type="text" placeholder="Enter Amount">
					</div>
                    
                    <div class="form-group col-lg-8">
                     <input type="submit" name="update_peaktime" value="Update" class="btn btn-primary"/>
                     <button type="reset" class="btn btn-danger">Reset</button>
                    </div>
                    
                    
                </div>
             </form>
            </div>
        </section>
     </div>
     
     <script>
		document.getElementById("timeto").value = "<?php echo $peaktime->to_time?>";
		document.getElementById("timefrom").value = "<?php echo $peaktime->from_time?>";
	</script>
    
	<?php if($msg = $this->session->flashdata("message")): ?>
        <script>
     		alert("<?php echo $msg?>");
     	</script>
    <?php endif; ?>    

