<?php include("config.php"); ?>
<!DOCTYPE html>
<html>
<head>
<title>PPDB KOTA CILEGON</title>
<link rel="stylesheet" type="text/css" href="bootstrap.css">
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="bootstrap.js"></script>
<script type="text/javascript" src="ajax.js"></script>
</head>
<body>
<table class="table table-bordered table-striped">
</header>
<br>
<nav>
<a onclick="daftar()">[+] Tambah Baru</a>
</nav>
<br>
<select>
<option onclick="tampil()">Semua</option>
</select>
<thead>
<tr>
<th>No</th>
<th>Nama</th>
<th>Alamat</th>
<th>Jenis Kelamin</th>
<th>Agama</th>
<th>Asal Sekolah</th>
<th>Sekolah Tujuan</th>
<th>Tindakan</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM ppdbonline";
$query = mysqli_query($db, $sql);
$nomor=0;
while($mhs = mysqli_fetch_array($query)){
echo "<tr>";
$nomor++;
echo "<td>".$nomor."</td>";
echo "<td>".$mhs['nama']."</td>";
echo "<td>".$mhs['alamat']."</td>";
echo "<td>".$mhs['jeniskl']."</td>";
echo "<td>".$mhs['agama']."</td>";
echo "<td>".$mhs['asalskl']."</td>";
echo "<td>".$mhs['skltujuan']."</td>";
echo "<td>";
echo "<a href='form_edit.php?nik=".$mhs['nik']."'>Edit</a> | ";
echo "<a href='hapus.php?nik=".$mhs['nik']."'>Hapus</a>";
echo "</td>";
echo "</tr>";
}
?>
</tbody>
</table>
<center><p>Total: <?php echo mysqli_num_rows($query) ?></p></center>
</body>
</html>