<?php if($this->session->userdata('level')=='1'){ ?>
	<div class="row">
		<div class="col-lg-3"></div>
		<div class="col-xl-6 col-lg-6" style="min-height:400px;">
			<?php echo $this->session->userdata('message') <> '' ? $this->session->userdata('message') : ''; ?>
			<form method="post" class="table-responsive">
				<table class="table table-bordered">
					<tr style="text-align:center">
						<th>Jam Buka</th>	
						<th>Jam Tutup</th>	
						<th>Status</th>	
						<th>Action</th>	
					</tr>				
					<tr style="text-align:center">
						<th>
							<?php
								$start = "08:00"; //you can write here 00:00:00 but not need to it
								$end   = "12:00";
								
								$tStart = strtotime($start);
								$tEnd = strtotime($end);
								$tNow = $tStart;
								echo '<select name="jam_mulai" class="form-control select2" style="text-align:center">';
								while($tNow <= $tEnd){
									if($jl->jam_mulai == date('H:i:s',$tNow)){
										echo '<option value="'.date("H:i:s",$tNow).'" selected>'.date("H:i",$tNow).'</option>';
										}else{
										echo '<option value="'.date("H:i:s",$tNow).'">'.date("H:i",$tNow).'</option>';
									}
									$tNow = strtotime('+30 minutes',$tNow);
									
								}
								echo '</select>';
							?>	
						</th>	
						<th>
							<?php
								$start = "10:00"; //you can write here 00:00:00 but not need to it
								$end   = "16:30";
								
								$tStart = strtotime($start);
								$tEnd = strtotime($end);
								$tNow = $tStart;
								echo '<select name="jam_selesai" class="form-control select2" style="text-align:center">';
								while($tNow <= $tEnd){
									if($jl->jam_selesai == date('H:i:s',$tNow)){
										echo '<option value="'.date("H:i:s",$tNow).'" selected>'.date("H:i",$tNow).'</option>';
										}else{
										echo '<option value="'.date("H:i:s",$tNow).'">'.date("H:i",$tNow).'</option>';
									}
									$tNow = strtotime('+30 minutes',$tNow);
									
								}
								echo '</select>';
							?>		
						</th>	
						<th>
							<?php echo form_dropdown('status',array('1'=>'BUKA','0'=>'TUTUP'),$jl->status,"class='form-control select2'");?>	
						</th>	
						<th>
							<input type="hidden" name="id" value="<?=$jl->id;?>">
							<button type="submit" name="simpan" value="yes" class="btn btn-success" onclick="javasciprt: return confirm('Pastikan jam layanan tepat, ingin melanjutkan ?')">
								<i class="fa fa-save"></i>
							</button>
						</th>	
					</tr>
				</table>
			</form>
		</div>
		<div class="col-lg-3"></div>
	</div>
<?php } ?>	