Skip to content

Instantly share code, notes, and snippets.

Created September 4, 2016 14:42
Show Gist options
  • Save anonymous/183e5afc283fa12c9e8edcbe5b791f6c to your computer and use it in GitHub Desktop.
Save anonymous/183e5afc283fa12c9e8edcbe5b791f6c to your computer and use it in GitHub Desktop.
<script type="text/javascript">
$(document).ready(function(){
$("#show").click(function(){
$('.sub').toggle();
});
});
</script>
<div class="container col-lg-12">
<div class="kotak">
<center><h1>KATEGORI</h1></center>
<a href=""><button class="tambah"><i class="fa fa-print"></i> CETAK</button></a>
<table width="100%" >
<tr>
<td>NO</td>
<td>KATEGORI</td>
</tr>
<?php
$no = 1 ;
foreach ($db -> tampilkategori() as $lihatkat){
?>
<tr>
<td><?php echo $no++; ?></td>
<td><button id="show">KLIK</button><?php echo $lihatkat['nama_kategori']; ?></td>
</tr>
<?php $idkat = $lihatkat['id_kategori']; ?>
<?php foreach ($db -> tampilsubkategori($idkat) as $lihatsubkat) {
?>
<tr>
<td>
</td>
<td>
<ul>
<li class="sub">
<?php echo $lihatsubkat['nama_subkat']; ?>
</li>
</ul>
</td>
</tr>
<?php
}
?>
<?php } ?>
</table>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment