SCRIPT SEARCH PHP
SEARCH
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body >
<?php
include 'koneksi.php';
?>
<center><form action="searchizin.php" method="get">
<label>Cari :</label>
<input type="text" name="cari">
<input type="submit" value="Cari">
</form>
<br>
<?php
if(isset($_GET['cari'])){
$cari = $_GET['cari'];
echo "<b>Hasil pencarian : ".$cari."</b>";
}
?>
<center><table width="0" border="10" cellspacing="0" cellpadding="20">
<tr>
<th>No</th>
<th>ID Izin</th>
<th>Nama Siswa</th>
<th>Kelas</th>
<th>Jurusan</th>
<th>Nama Orang Tua</th>
<th>Tanggal Izin</th>
<th>Tanggal Masuk</th>
<th><center>opsi</center></th>
</tr>
<?php
if(isset($_GET ['cari'])){
$cari = $_GET['cari'];
$data = mysqli_query($koneksi,"select * from izin where nama like '%".$cari."%'");
}else{
$data = mysqli_query($koneksi,"select * from izin");
}
$no = 1 ;
while($d = mysqli_fetch_array ($data)){
?>
<tr>
<td><?php echo $no++;?></td>
<td><?php echo $d['id_izin'];?></td>
<td><?php echo $d['nama'];?></td>
<td><?php echo $d['kelas'];?></td>
<td><?php echo $d['jurusan'];?></td>
<td><?php echo $d['ortu'];?></td>
<td><?php echo $d['tgl_izin'];?></td>
<td><?php echo $d['tgl_masuk'];?></td>
<td> <a href="updateizin.php?id=<?php echo $d['id_izin']; ?>"> update </a>
<a href="deleteizin.php?id=<?php echo $d['id_izin']; ?>"> delete </a>
</tr>
<?php } ?>
</table><br>
<td> <button><a href="showizin.php">Show All</a>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body >
<?php
include 'koneksi.php';
?>
<center><form action="searchizin.php" method="get">
<label>Cari :</label>
<input type="text" name="cari">
<input type="submit" value="Cari">
</form>
<br>
<?php
if(isset($_GET['cari'])){
$cari = $_GET['cari'];
echo "<b>Hasil pencarian : ".$cari."</b>";
}
?>
<center><table width="0" border="10" cellspacing="0" cellpadding="20">
<tr>
<th>No</th>
<th>ID Izin</th>
<th>Nama Siswa</th>
<th>Kelas</th>
<th>Jurusan</th>
<th>Nama Orang Tua</th>
<th>Tanggal Izin</th>
<th>Tanggal Masuk</th>
<th><center>opsi</center></th>
</tr>
<?php
if(isset($_GET ['cari'])){
$cari = $_GET['cari'];
$data = mysqli_query($koneksi,"select * from izin where nama like '%".$cari."%'");
}else{
$data = mysqli_query($koneksi,"select * from izin");
}
$no = 1 ;
while($d = mysqli_fetch_array ($data)){
?>
<tr>
<td><?php echo $no++;?></td>
<td><?php echo $d['id_izin'];?></td>
<td><?php echo $d['nama'];?></td>
<td><?php echo $d['kelas'];?></td>
<td><?php echo $d['jurusan'];?></td>
<td><?php echo $d['ortu'];?></td>
<td><?php echo $d['tgl_izin'];?></td>
<td><?php echo $d['tgl_masuk'];?></td>
<td> <a href="updateizin.php?id=<?php echo $d['id_izin']; ?>"> update </a>
<a href="deleteizin.php?id=<?php echo $d['id_izin']; ?>"> delete </a>
</tr>
<?php } ?>
</table><br>
<td> <button><a href="showizin.php">Show All</a>
</body>
</html>
Comments
Post a Comment
Mohon dengan komentar yang sopan dan membangun