<title>Level</title>
<div id="pagetitle">LEVEL</div>
<div id="batascontent">
	<?php if ($udt['admincat_id'] != "1") {} else { ?>
		<div id="tomboltambah">
			<a href="?m=admincat_input" class="addbutton">ADD LEVEL</a>
		</div>
	<?php } ?>
	<div id="tableres">
		<table width="100%" cellpadding="0" cellspacing="0" border="0" class="display" id="example">
			<thead>
				<tr align="left">
					<th>NO</th>
					<th>LEVEL</th>
					<th>ADMIN</th>
					<th></th>
				</tr>
			</thead>
			<tbody>
				<?php
					$nomor = 1;
					$db = mysqli_query($koneksi, "SELECT * FROM cmas_admincat ORDER BY admincat_id ASC");
					while($dt = mysqli_fetch_array($db)) {
				?>
					<tr>
						<td align="center" width="1%">
							<?php echo $nomor; ?>
						</td>
						<td>
							<a href="?m=admincat_edit&id=<?php echo $dt['admincat_id']; ?>">
								<?php echo $dt["admincat_nama"]; ?>
							</a>
						</td>
						<td>
							<a href="?m=admin_index">
								<?php
									$adb = mysqli_query($koneksi, "SELECT COUNT(admin_id) AS JumlahAdmin FROM cmas_admin WHERE admincat_id='$dt[admincat_id]'");
									$adt = mysqli_fetch_array($adb);
									echo $adt['JumlahAdmin'];
									echo " User";
								?>
							</a>
						</td>
						<td align="center" width="5%">
							<a href="?m=admincat_edit&id=<?php echo $dt['admincat_id']; ?>">
								<img src="assets/images/icons/icon_edit.png" width="20" title="Edit Data">
							</a>
							<a href="?m=admincat_hapus&id=<?php echo $dt['admincat_id']; ?>" onclick="return confirm('DATA AKAN DIHAPUS, ANDA YAKIN?');">
								<img src="assets/images/icons/icon_delete.png" width="20" title="Hapus Data">
							</a>
						</td>
					</tr>
				<?php $nomor++; } ?> 
			</tbody>
		</table>
	</div>
</div>