<div class="clearfix">
<div class="row">
  <div class="col-lg-12">
	
	<div class="navbar navbar-inverse">
		<div class="container">
			<div class="navbar-header">
				<a class="navbar-brand" href="<?php echo base_URL()?>user_siakad/list_data">Data Pengguna</a>
			</div>
		<div class="navbar-collapse collapse navbar-inverse-collapse" style="margin-right: -20px">
				<ul class="nav navbar-nav">
				<li><a href="<?php echo base_URL(); ?>user_siakad/tambah_" class="btn-info"><i class="icon-plus-sign icon-white"> </i> Tambah Data</a></li>
			</ul>
			<ul class="nav navbar-nav navbar-right">
				<form class="navbar-form navbar-left" method="post" action="<?php echo base_URL(); ?>user_siakad/list_data/cari">
					<input type="text" class="form-control" name="q" style="width: 200px" placeholder="Kata kunci pencarian ..." required>
					<button type="submit" class="btn btn-danger"><i class="icon-search icon-white"> </i> Cari</button>
				</form>
			</ul>
		</div><!-- /.nav-collapse -->
		</div><!-- /.container -->
	</div><!-- /.navbar -->

  </div>
</div>

<?php echo $this->session->flashdata("k");?>


<table class="table table-bordered table-hover">
	<thead>
		<tr>
			<th width="4%">No.</th>
			<th width="30%">Nama Lengkap</th>
			<th width="25%">Username</th>
			<th width="13%">Keterangan</th>
			<th width="25%">Aksi</th>
		</tr>
	</thead>
	
	<tbody>
		<?php 
		if (empty($data)) {
			echo "<tr><td colspan='5'  style='text-align: center; font-weight: bold'>--Data tidak ditemukan--</td></tr>";
		} else {
			$no 	= ($this->uri->segment(4) + 1);
			foreach ($data as $b) {
				if ($b->level == 1){ 
						$level ="Super Admin"; 
					}elseif($b->level == 2){ $level = "Kasir / Bendahara"; 
					}else { $level = "by Hacker"; }
				if ($b->blokir == "Y"){ 
						$aktifpost ="N";
						$aktif ="Aktifkan User"; 
						$aktiftitel ="Non Aktifkan";
						$aktificon ="icon-eye-open icon-white"; 
						$aktifbtn ="btn btn-warning btn-sm"; 
					}else { $aktif = "Non Aktifkan";
						$aktifpost ="Y";
						$aktifbtn ="btn btn-success btn-sm"; 
						$aktificon ="icon-eye-close icon-white";
						$aktiftitel ="Aktifkan";					
					}
		?>
		<tr>
			<td style="text-align: center;"><?php echo $no;?></td>
			<td><?php echo $b->nama_lengkap; ?></td>
			<td><?php echo $b->username;?></td>
			<td><?php echo $level;?></td>
			<td class="ctr">
				<?php  
				if ( $this->session->userdata('admin_level') == 1) {
				?>
				<div class="btn-group">
					<a href="<?php echo base_URL()?>user_siakad/list_data/aktif/<?php echo $aktifpost;?>/<?php echo $b->user_id;?>" class="<?php echo $aktifbtn;?>" title="<?php echo $aktiftitel;?>"><i class="<?php echo $aktificon;?>"> </i> <?php echo $aktif;?></a>
					<a href="<?php echo base_URL()?>user_siakad/list_data/reset/<?php echo $aktifpost;?>/<?php echo $b->user_id?>" class="btn btn-default btn-sm"  title="Reset Password"><i class="icon-warning-sign icon-list"> </i> Reset</a>	
				</div>	
				
				<?php 
				} else {
					echo "-";
				}
				?>
				
			</td>
		</tr>
		<?php 
			$no++;
			}
		}
		?>
	</tbody>
</table>
<center><ul class="pagination"><?php echo $pagi; ?></ul></center>
</div>
