<?php echo $this->session->flashdata("k");?>
<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="#">Cara Penggunaan SIAKAD</a>
			</div>
		<div class="navbar-collapse collapse navbar-inverse-collapse" style="margin-right: -20px">
			<?php 
			if ($this->session->userdata('admin_level') == 1) {
			?>
			<ul class="nav navbar-nav">
				<li><a href="<?php echo base_URL(); ?>bantuan/list_data/add" class="btn-info"><i class="icon-plus-sign icon-white"> </i> Tambah Data</a></li>
			</ul>
			
			<?php 
			} else {
				echo "";
			}
			?>
			<ul class="nav navbar-nav navbar-right">
				<form class="navbar-form navbar-left" method="post" action="<?php echo base_URL(); ?>bantuan/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>




<table class="table table-bordered table-hover">
	<thead>
		<tr>
			<th width="3%">No.</th>
			<th width="32%">Pertanyaan</th>
			<th width="40%">Jawaban</th>
			<th width="25%">Aksi</th>
		</tr>
	</thead>
	
	<tbody>
		<?php 
		if (empty($data)) {
			echo "<tr><td colspan='4'  style='text-align: center; font-weight: bold'>--Data tidak ditemukan--</td></tr>";
		} else {
			$no 	= ($this->uri->segment(4) + 1);
			foreach ($data as $b) {
		?>
		<tr>
			<td><?php echo $no;?></td>
			<td><?php echo $b->kategori; ?></td>
			<td><?php echo $b->keterangan; ?></td>
			<td class="ctr">
				<?php  
				if ( $this->session->userdata('admin_level') == 1 OR $this->session->userdata('admin_level') == 3) {
				?>
				<div class="btn-group">
					<a href="<?php echo base_URL()?>bantuan/list_data/edt/<?php echo $b->id?>" class="btn btn-success btn-sm" title="Edit Data"><i class="icon-edit icon-white"> </i> Edit</a>
					<a href="<?php echo base_URL()?>bantuan/list_data/del/<?php echo $b->id?>" class="btn btn-danger btn-sm" title="Hapus Data" onclick="return confirm('Anda Yakin akan menghapus..?')"><i class="icon-trash icon-remove">  </i> Hapus</a>			
					
				</div>	
				
				<?php 
				} else {
					echo "-";
				}
				?>
				
			</td>
		</tr>
		<?php 
			$no++;
			}
		}
		?>
	</tbody>
</table>
<center><ul class="pagination"><?php echo $pagi; ?></ul></center>
</div>
