oke...
kali ini saya akan melanjutkan progress dari tugas integrasi yang kemarin.
kali ini saya akan membuat aplikasi untuk menampilkan rekap absensi dari pegawainya dengan pencarian.
pertama membuat form Rekap Absen Pegawainya
script rekapAbsen.php
------------------------------------------------------------------------------------------------------------<HTML>
<head>
<titte><h1>Rekap Absensi</h1></titte>
<head>
<body>
<div id="Container">
<form action="search.php" method="POST">
<table>
<tr>
<td>Pencarian Rekap Absensi</td>
</tr>
<tr>
<td><input type="text" name="nip" placeholder="nip"></td></tr>
<tr>
<td></td><td></td><td><input type="submit" name="SUBMIT" id="SUBMIT" value="Search"></td></tr>
</table>
</form>
<form>
<table bgcolor="#FFF1234">
<tr bgcolor="#DFE6EF" style="color:#FF3333;">
<th>NIP</th>
<th>Jumlah Masuk</th>
<th>Jumlah Alfa</th>
<th>Bulan Absen</th>
</tr>
<?php
include "koneksi.php";
$tampil="select * from rekap_absensi";
$q=$mysqli->query($tampil);
$no=0;
while ($record=$q->fetch_array()) {
$no++;
?>
<tr style="background-color:#FFFFFF;">
<td><center><?php echo $record ['nip'];?></center></td>
<td><center><?php echo $record ['jumlah_masuk'];?></center></td>
<td><center><?php echo $record ['jumlah_alfa'];?></center></td>
<td><center><?php echo $record ['bulan_absen'];?></center></td>
</td>
</tr>
<?php
}
?>
</table>
</div>
</body>
</html>
------------------------------------------------------------------------------------------------------------
tampilan form rekap absensi
kemudian buat file search.php sebagai executor untuk pencariannya
script search.php
------------------------------------------------------------------------------------------------------------
<?php
?>
<head>
<titte><h1>Rekap Absensi</h1></titte>
<head>
<body>
<div id="Container">
<form action="search.php" method="POST">
<table>
<tr>
<td>Pencarian Rekap Absensi</td>
</tr>
<tr>
<td><input type="text" name="nip" placeholder="nip"></td></tr>
<tr>
<td></td><td></td><td><input type="submit" name="SUBMIT" id="SUBMIT" value="Search"></td></tr>
</table>
</form>
<form>
<table bgcolor="#FFF1234">
<tr bgcolor="#DFE6EF" style="color:#FF3333;">
<th>NIP</th>
<th>Jumlah Masuk</th>
<th>Jumlah Alfa</th>
<th>Bulan Absen</th>
</tr>;
<?php
include "koneksi.php";
$nip= $_POST['nip']; //mengambil nilai yang diinputkan di kotak pencarian nip
$q = " select * from rekap_absensi where nip like '%$nip%' "; //untuk menjalankan query sql pencarian
$result = $mysqli->query($q);
while ($record=$result->fetch_array()) {
?>
<tr style="background-color:#FFFFFF;">
<td><center><?php echo $record ['nip'];?></center></td>
<td><center><?php echo $record ['jumlah_masuk'];?></center></td>
<td><center><?php echo $record ['jumlah_alfa'];?></center></td>
<td><center><?php echo $record ['bulan_absen'];?></center></td>
</td>
</tr>
<?php
}
?>
</table>
</div>
</body>
------------------------------------------------------------------------------------------------------------
kemudian buka http://localhost/integrasi1/rekapAbsen.php (jangan lupa jalankan dulu servernya)
lalu input-kan nip pegawai yang akan di lihat rekapannya.
maka hasil yang akan keluar yaitu hanya absensi untuk pegawai dengan nip "1111"
sekian dulu tulisan hari ini.
semoga ilmu yang saya share di sini dapat bermanfaat.
apa bila membutuhkan informasi tambahan dapat mengunjungi halaman berikut http://www.taufiknuradi.com/
TERIMAKASIH ^_^
Santiaji Trapsilo
1106110109
SI-35-03
Sistem Informasi
Telkom Engineering School
Telkom University
Tidak ada komentar:
Posting Komentar