<!DOCTYPE html>
<?php $admin = 'Master'; $nama = 'Pemakai';?>
<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/pemakai/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 $admin.' <i class="ace-icon fa fa-angle-double-right"></i> '.$nama; ?>
					</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: left;">Alamat</th>											
								<th width="10%" style="text-align: center;">Aksi</th>								
							</tr>
						</thead>
						<tbody>		
						<?php $no=0; foreach($pemakai->result() as $row){ $no++;?>
							<tr>		
								<?php $attribute = array('role' => 'form', 'class' => 'form-horizontal' );
								echo form_open(base_url().'admin/pemakai/edit', $attribute); ?>								
								<td align="center"><input type="hidden" name="id" value="<?php echo $row->idpemakai;?>"><?php echo $no;?></td>							
								<td align="left"><?php echo $row->namapemakai;?></td>
								<td align="left"><?php echo $row->alamat;?></td>	
								<td align="center">
					
									<button  type="submit" name="edit" value="edit" class="btn-warning">
									<i class="ace-icon fa fa-pencil "></i></button>		
									<button  type="submit" name="hapus" value="hapus" class="btn-danger"  onclick="return confirm(' Apakah anda yakin akan menghapus data <?php echo $row->namapemakai;?> ?')">
									<i class="ace-icon fa fa-trash-o "></i></button>	
									</td>
								<?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>