Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head><title>Perancangan Sistem Informasi Pendataan Hasil Industri</title></head>
- <body>
- <form name="form cari" method="post" action="Tampil Industri.php">
- <table width="330" border="0" align="center" cellpadding="0">
- <tr bgcolor="blue sky">
- <td height="25" colspan="3">
- <strong> Pencarian </strong>
- </td>
- </tr>
- <tr> <td> Nama Perusahaan </td>
- <td> <input type="text" name="nama_perusahaan"> </td>
- </tr>
- <td></td>
- <td> <input type="SUBMIT" name="cari" id="SUBMIT" value="cari" > </td>
- </table>
- </form>
- <form name="form cari" method="post" action="Tampil Industri.php">
- <table width="330" border="0" align="center" cellpadding="0">
- <tr bgcolor="blue sky">
- <td height="25" colspan="3">
- <strong> Pencarian </strong>
- </td>
- </tr>
- <tr> <td> Jenis Industri </td>
- <td> <input type="text" name="jenis_industri"> </td>
- </tr>
- <td></td>
- <td> <input type="SUBMIT" name="cari" id="SUBMIT" value="cari" > </td>
- </table>
- </form>
- <h3>Data Industri di Kabupaten Kebumen</h3>
- <?php
- $host="localhost";
- $user="root";
- $pass="";
- $db="industri2";
- $koneksi=mysql_connect($host,$user,$pass)
- or die (mysql_error());
- mysql_select_db($db,$koneksi) or die (mysql_error());
- $query = mysql_query ("select * from tabelperusahaan", $koneksi)
- or die (mysql_error());
- //untuk pencarian pada mysql
- if(isset($_POST['cari'])){
- $query=mysql_query("select * from tabelperusahaan where nama_perusahaan Like '%".$_POST['nama_perusahaan']."'");
- }else{
- $query =mysql_query("select * from tabelperusahaan");
- }
- $query = mysql_query ("select * from tabel_data_industri", $koneksi)
- or die (mysql_error());
- //untuk pencarian pada mysql
- if(isset($_POST['cari'])){
- $query=mysql_query("select * from tabel_data_industri where jenis_industri Like '%".$_POST['jenis_industri']."'");
- }else{
- $query =mysql_query("select * from tabel_data_industri");
- }
- $jumlah = mysql_num_rows($query);
- echo "Jumlah record : $jumlah";
- echo "<br><br>";
- echo "<table border=\"1\" align=\"center\">
- <tr>
- <th>No Urut Perusahaan</th>
- <th>Nama Perusahaan</th>
- <th>Alamat Perusahaan</th>
- <th>Nama Pemilik</th>
- <th>Alamat Pemilik</th>
- <th>Nama Satuan</th>
- <th>Jenis Industri</th>
- <th>Jenis Ijin</th>
- <th>Action</th>
- </tr>";
- while ($row=mysql_fetch_array($query))
- {
- echo "<td>";
- echo $row["no_urut_perusahaan"];
- echo "<td>";
- echo $row["nama_perusahaan"];
- echo "<td>";
- echo $row["alamat_perusahaan"];
- echo "<td>";
- echo $row["nama_pemilik"];
- echo "<td>";
- echo $row["alamat_pemilik"];
- echo "<td>";
- echo $row["nama_satuan"];
- echo "<td>";
- echo $row["jenis_industri"];
- echo "<td>";
- echo $row["jenis_ijin"];
- echo "</td>
- <td>
- <a href=\"Hapus Industri.php?no_urut_perusahaan=$row[0]\">delete</a>
- <a href=\"Form Ubah Industri.php?no_urut_perusahaan=$row[0]\">edit</a>
- </td>";
- echo "</tr>";
- }
- echo "</table>";
- ?>
- <a href="pdf Laporan.php">Lihat Laporan Industri<a>
- </body>
- </html>
- <?php
- include "koneksi.php";
- $name= $_POST['name']; //get the nama value from form
- $q = "SELECT * from tabel_data_industri where detail like '%$cari%' "; //query to get the search result
- $q = "SELECT * from tabelperusahaan where detail like '%$cari%' "; //query to get the search result
- $result = mysql_query($q); //execute the query $q
- echo "<center>";
- echo "<h2> Hasil Searching </h2>";
- echo "<table border='1' cellpadding='5' cellspacing='8'>";
- echo "
- <tr bgcolor='orange'>
- <td>No</td>
- <td>Nama Perusahaan</td>
- <td>Alamat Perusahaan</td>
- <td>Nama Pemilik</td>
- <td>Alamat Pemilik</td>
- <td>Jenis Industri</td>
- <td>Jenis Ijin</td>
- <td></td>
- <td></td>
- </tr>";
- while ($data = mysql_fetch_array($result)) { //fetch the result from query into an array
- echo "
- <tr>
- <td>".$data['no']."</td>
- <td>".$data['nama_perusahaan']."</td>
- <td>".$data['alamat_perusahaan']."</td>
- <td>".$data['nama_pemilik']."</td>
- <td>".$data['alamat_pemilk']."</td>
- <td>".$data['jenis_industri']."</td>
- <td>".$data['jenis_ijin']."</td>
- </tr>";
- }
- echo "</table>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement