<!DOCTYPE html>
<?php $home = 'Master'; $nama = 'Fasilitas'; $waktu = $this->session->userdata('waktu');	?>
<html lang="en">
<?php include("layout/meta.php");?>
	<body class="no-skin">
	<?php include("layout/navbar.php");?>
		<div class="main-container ace-save-state" id="main-container">
			<script type="text/javascript">
				try{ace.settings.loadState('main-container')}catch(e){}
			</script>
			<?php include("layout/sidebar.php");?>
			<div class="main-content">
			  <div class="main-content-inner">
				<div class="col-xs-12">
				<?php if(!empty($pesan)){ ?>
				<div class="alert alert-<?php echo $alert;?>" role="alert" style="text-align:center;">
				 <strong><?php echo validation_errors(); echo $pesan ;?></strong>
				</div><?php }?>					
					<h3 class="header smaller lighter blue"><?php echo $nama;?></h3>					
					<div class="clearfix">
						<a href="<?php echo base_url().'admin/fasilitas/add/';?>"><button class="btn btn-success btn-sm" type="button">
							<i class="ace-icon fa fa-check bigger-110"></i>
							Tambah data
						</button></a>
					</div>					
				  <div class="widget-box">
					<div class="widget-body">										
					<div class="table-header">
						<?php echo $home.' <i class="ace-icon fa fa-angle-double-right"></i> '.$nama; ?>
						<div class="col-md-2 pull-right">
						<?php $attribute = array('role' => 'form', 'class' => 'form-horizontal' );
						echo form_open(base_url().'admin/fasilitas/waktu', $attribute); ?>	
						  <div class="form-group">
							<select name="waktu" class="form-control pull-right" style="height:39px;    background-color: #3A87AD;color:white" onchange='this.form.submit()'>
							  <option>Pilih waktu</option>
							  <option value="0" <?php if($waktu==0){ echo 'selected';}?>>Siang</option>
							  <option value="1" <?php if($waktu==1){ echo 'selected';}?>>Malam</option>
							  <option value="2" <?php if($waktu==2){ echo 'selected';}?>>FullDay</option>
							</select>
						  </div>
						  <?php echo form_close();?>
							</div>							
					</div>     				
					<table id="tabel-data" class="table table-striped table-bordered  table-hover" width="100%" cellspacing="0">
						<thead>
							<tr>
								<th width="5%" style="text-align: center;">No</th>							
								<th width="50%" style="text-align: left;">Nama</th>								
								<th width="20%" style="text-align: center;">Katogori</th>								
								<th width="20%" style="text-align: center;">Harga</th>								
								<th width="10%" style="text-align: center;">Aktif</th>								
								<th width="10%" style="text-align: center;">Aksi</th>								
							</tr>
						</thead>
						<tbody>		
						<?php $no=0; foreach($fasilitas->result() as $row){ $no++;?>
							<tr>		
								<?php $attribute = array('role' => 'form', 'class' => 'form-horizontal' );
								echo form_open(base_url().'admin/fasilitas/edit', $attribute); ?>								
								<td align="center"><input type="hidden" name="idfasilitas" value="<?php echo $row->idfasilitas;?>"><?php echo $no;?></td>							
								<td align="left"><?php echo $row->namafasilitas;?> </span> </td>
								<td align="left"><?php echo $row->namakategori;?></td>
								<td align="right"><?php echo number_format($row->harga);?></td>
								<td align="center"><?php if($row->status=='1'){ echo '<span class="label label-info arrowed-right arrowed-in">Ya</span>' ;}else{ echo '<span class="label label-danger arrowed-right arrowed-in">Tidak</span>' ; }?></td>
								<td align="center">
									<button  type="submit" name="edit" value="edit" class="btn-warning" title="detail fasilitas">
									<i class="ace-icon fa fa-check-square-o "></i></button>		
									<!--<button  type="submit" name="hapus" value="hapus" class="btn-danger"  onclick="return confirm(' Apakah anda yakin akan menghapus data <?php echo $row->namafasilitas;?> ?')">
									<i class="ace-icon fa fa-trash-o "></i></button>	-->
								<?php echo form_close();?>	
							</tr>
						<?php }?>	
						</tbody>
					</table>						
					</div>
				  </div>
				</div>
				<!-- /.span -->
			  </div>
			  <!-- /.main-content -->
			</div>
			<?php include("layout/footer.php");?>
			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->
		<!-- basic scripts -->
			<?php include("layout/sc_footer.php");?>
	</body>
</html>