Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "./include/koneksi_db.php";
- $sql=mysql_query("SELECT * FROM data_anggota WHERE {$_POST['per']} "
- .($_POST['per']=='id'?"='{$_POST['text']}' ":"LIKE '%{$_POST['text']}%' "));
- if(mysql_num_rows($sql)>0){
- while($res=mysql_fetch_array($sql)){
- ?>
- <table width="90%" border="4" cellspacing="4" cellpadding="4">
- <tr>
- <td colspan="2"><strong>Hasil Pencarian</strong><hr></td>
- </tr>
- <tr>
- <td width="50%"><strong>ID Anggota</strong></td>
- <td width="50%"><strong>: </strong><?=$res['id'];?></td>
- </tr>
- <tr>
- <td><strong>Nomor induk</strong></td>
- <td><strong>: </strong><?=$res['no_induk'];?></td>
- </tr>
- <tr>
- <td><strong>nama</strong></td>
- <td><strong>: </strong><?=$res['nama'];?></td>
- </tr>
- <tr>
- <td><strong>jenis kelamin</strong></td>
- <td><strong>:</strong> <?=$res['jk'];?></td>
- </tr>
- <tr>
- <td><strong>kelas</strong></td>
- <td><strong>:</strong> <?=$res['kelas'];?></td>
- </tr>
- <tr>
- <td><strong>tempat tanggal lahir</strong></td>
- <td><strong>:</strong> <?=$res['ttl'];?></td>
- </tr>
- <tr>
- <td><strong>alamat</strong></td>
- <td><strong>:</strong> <?=$res['alamat'];?></td>
- </tr>
- </table>
- <?php
- }
- }
- if($_POST['per']=='id'){
- $sql=mysql_query("SELECT * FROM data_buku WHERE id='".$_POST['text']."'");
- if(mysql_num_rows($sql)>0){
- $res=mysql_fetch_array($sql);
- ?>
- <table width="50%" border="0" cellspacing="1" cellpadding="4">
- <tr>
- <td colspan="2"><strong>Hasil Pencarian</strong><hr></td>
- </tr>
- <tr>
- <td><strong>ID Buku</strong></td>
- <td><strong>:</strong> <?=$res['id'];?></td>
- </tr>
- <tr>
- <td><strong>Judul</strong></td>
- <td><strong>: </strong><?=$res['judul'];?></td>
- </tr>
- <tr>
- <td><strong>Pengarang</strong></td>
- <td><strong>:</strong> <?=$res['pengarang'];?></td>
- </tr>
- <tr>
- <td><strong>tahun Penerbit</strong></td>
- <td><strong>:</strong> <?=$res['th_terbit'];?></td>
- </tr>
- <tr>
- <td><strong>penerbit</strong></td>
- <td><strong>:</strong> <?=$res['penerbit'];?></td>
- </tr>
- <tr>
- <td><strong>isbn</strong></td>
- <td><strong>:</strong> <?=$res['isbn'];?></td>
- </tr>
- <tr>
- <td><strong>kategori</strong></td>
- <td><strong>:</strong> <?=$res['kategori'];?></td>
- </tr>
- <tr>
- <td><strong>kode kelas</strong></td>
- <td><strong>:</strong> <?=$res['kode_klas'];?></td>
- </tr>
- <tr>
- <td><strong>jumlah buku</strong></td>
- <td><strong>:</strong> <?=$res['jumlah_buku'];?></td>
- </tr>
- <tr>
- <td><strong>lokasi</strong></td>
- <td><strong>:</strong> <?=$res['lokasi'];?></td>
- </tr>
- <tr>
- <td><strong>asal</strong></td>
- <td><strong>:</strong> <?=$res['asal'];?></td>
- </tr>
- <tr>
- <td><strong>jum_temp</strong></td>
- <td><strong>:</strong> <?=$res['jum_temp'];?></td>
- </tr>
- <tr>
- <td><strong>tanggal input</strong></td>
- <td><strong>:</strong> <?=$res['tgl_input'];?></td>
- </tr>
- </table>
- <? }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement