if ($tipe==0)
{$query_cek2 = "SELECT nim_akhir FROM `mahasiswa` WHERE `nama_siswa` LIKE '%$cari%'";
$hasil_cek2 = mysql_query($query_cek2) or die("Gagal");
$data_cek2 = mysql_fetch_array($hasil_cek2);
$nim_cek2 = $data_cek2['nim_akhir'];
if(isset($nim_cek2))
{?>
<table width="300" border="0">
<?php
$banyakData = $data_cek2[0];
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$limit = 3;
$mulai_dari = $limit * ($page - 1);
$query_nama = "SELECT * FROM `mahasiswa` WHERE `nama_siswa` LIKE '%$cari%' LIMIT $mulai_dari, $limit";
$hasil_nama = mysql_query($query_nama);
while($row_nama = mysql_fetch_array($hasil_nama)or die (mysql_error()))
{ ?>
<tr>
<td width="210"><?php echo $row_nama['nama_siswa']; ?></td>
<td width="80"><a href="lihat_datams_detail.php?nim_akhir=<?php echo $row_nama['nim_akhir']; ?>">Detail</a></td>
</tr>
<tr>
<td><?php echo $row_nama['nim_akhir']; ?></td>
<td><a href="edit_datams.php?nim_akhir=<?php echo $row_nama['nim_akhir']; ?>">Edit</a></td>
</tr>
<tr>
<td><?php echo $row_nama['angkatan']; ?></td>
<td><a href="konfirmasi_hapus_datams.php?nim_akhir=<?php echo $row_nama['nim_akhir']; ?>">Hapus</a></td>
</tr>
<tr><td><?php echo $row_nama['konsentrasi']; ?></td><td> </td></tr><?php }?>
</table>
<?php $banyakHalaman = ceil($banyakData / $limit);
echo 'Halaman: ';
for($x = 1; $x <= $banyakHalaman; $x++){
if($page != $x)
{echo '[<a href="hasilcari_lihat_datams.php?page='.$x.'&cari='.$cari.'&tipe=0">'.$x.'</a>] ';}
else
{echo "[$x] ";}}}
else
{echo "<h2>Nama Tidak ditemukan</h2>";}}?>
<?php
if ($tipe == 0) {
$query_cek2 = "SELECT count(nim_akhir) as jml FROM `mahasiswa` WHERE `nama_siswa` LIKE '%$cari%'";
$hasil_cek2 = mysql_query($query_cek2) or die("Gagal");
$data_cek2 = mysql_fetch_array($hasil_cek2);
$banyakData = $data_cek2['jml'];
if ($banyakData > 0) {
?>
<table width="300" border="0">
<?php
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$limit = 3;
$mulai_dari = $limit * ($page - 1);
$query_nama = "SELECT * FROM `mahasiswa` WHERE `nama_siswa` LIKE '%$cari%' LIMIT $mulai_dari, $limit";
$hasil_nama = mysql_query($query_nama);
while ($row_nama = mysql_fetch_array($hasil_nama)) {
?>
<tr>
<td width="210"><?php echo $row_nama['nama_siswa']; ?></td>
<td width="80"><a href="lihat_datams_detail.php?nim_akhir=<?php echo $row_nama['nim_akhir']; ?>">Detail</a></td>
</tr>
<tr>
<td><?php echo $row_nama['nim_akhir']; ?></td>
<td><a href="edit_datams.php?nim_akhir=<?php echo $row_nama['nim_akhir']; ?>">Edit</a></td>
</tr>
<tr>
<td><?php echo $row_nama['angkatan']; ?></td>
<td><a href="konfirmasi_hapus_datams.php?nim_akhir=<?php echo $row_nama['nim_akhir']; ?>">Hapus</a></td>
</tr>
<tr><td><?php echo $row_nama['konsentrasi']; ?></td><td> </td></tr><?php } ?>
</table>
<?php
$banyakHalaman = ceil($banyakData / $limit);
echo 'Halaman: ';
for ($x = 1; $x <= $banyakHalaman; $x++) {
if ($page != $x) {
echo '[<a href="hasilcari_lihat_datams.php?page=' . $x . '&cari=' . $cari . '&tipe=0">' . $x . '</a>] ';
} else {
echo "[$x] ";
}
}
} else {
echo "<h2>Nama Tidak ditemukan</h2>";
}
}?>