<!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">pemakai</h3>										
				  <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>     				
					  <div class="widget-main">
						<?php 
						if($cek!=''){
							foreach($edit->result() as $row){
							$idpemakai = $row->idpemakai;
							$namapemakai = $row->namapemakai;
							$alamat = $row->alamat;
							}
						}
						$attribute = array('role' => 'form', 'class' => 'form-horizontal' );
						echo form_open(base_url().'admin/pemakai/save', $attribute); 
						?>	
						<input type="hidden" id="form-field-1" name="act" value="<?php if($cek!=''){ echo 'edit' ; }else{ echo 'save'; }?>" class="form-control" required />
						<input type="hidden" id="form-field-1" name="idpemakai" value="<?php if($cek!=''){ echo $idpemakai; }else{ echo ''; }?>" class="form-control" />												
						  <div class="form-group">
							<label class="col-sm-1 control-label no-padding-right" for="form-field-1">Nama</label>
							<div class="col-sm-8">
							  <input type="text" id="form-field-1" name="namapemakai"  value="<?php if($cek!=''){echo $namapemakai; }?>" placeholder="Nama pemakai"  class="form-control" required />
							</div>
						  </div>	
						  <div class="form-group">
							<label class="col-sm-1 control-label no-padding-right" for="form-field-1">Alamat</label>
							<div class="col-sm-8">
							  <input type="text" id="form-field-1" name="alamat"  value="<?php if($cek!=''){echo $alamat; }?>" placeholder="Alamat"  class="form-control" required />
							</div>
						  </div>							  
						  <div class="form-group">
							<label class="col-sm-1 control-label no-padding-right" for="form-field-1">
							</label>
							<div class="col-sm-8">
							<button type="submit" class="btn btn-primary btn-sm" name="button" value="button"  tabindex="1">simpan</button>
							<button type="submit" class="btn btn-success btn-sm" name="kembali" value="kembali"  tabindex="1" formnovalidate >kembali</button>														
							</div>
						  </div>
						<?php echo form_close();?>
					  </div>							
					</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>