cahyadsn

cari data

Apr 6th, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.99 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.   <head>
  4.     <title>Teknik Komputer Dan Jaringan</title>
  5.     <link type="text/css" rel="stylesheet" href="style.css" />
  6.   </head>
  7.   <body>
  8.     <div id="header-outer">
  9.       <div id="header">
  10.         <div id="header-kiri">
  11.           <div id="header-kiri1">
  12.             <a href="index.php" title="Teknik Komputer dan Jaringan">
  13.             <h2>K<img src="images/ubuntu.png" />mPu<img src="images/monitor.png"/>er</h2>
  14.             </a>
  15.           </div>
  16.         </div>
  17.         <div id="header-kanan">
  18.           <ul>
  19.             <li><a href="index.php">HOME</a></li>
  20.             <li><a href="lihat.php" class="aktive">PSB</a></li>
  21.             <li><a href="gallery.php">GALLERY</a></li>
  22.             <li><a href="tutorial.php">TUTORIAL</a></li>
  23.           </ul>
  24.         </div>
  25.       </div> <!-- Header -->
  26.     </div> <!-- Header-outer -->
  27.     <div class="clear"></div>
  28.     <div id="content-outer">
  29.       <div id="content">
  30.         <center>
  31.           <form method='post'>
  32.             Cari data
  33.             <input type='text' name='search' value='<?php echo isset($_POST['search'])?$_POST['search']:'';?>'/>
  34.             berdasarkan
  35.             <select name='field'>
  36.               <option value='nama'>nama</option>
  37.               <option value='alamat'>alamat</option>
  38.             </select>
  39.             <input type='submit' name='submit' value='cari'/>
  40.           </form>
  41.           <b>Data Siswa</b>
  42.         </center>
  43.         <table align="center" border="1">
  44.           <tr>
  45.             <th>No.</th>
  46.             <th>No. Induk</th>
  47.             <th>Nama</th>
  48.             <th>Jenis Kelamin</th>
  49.             <th>Kelas</th>
  50.             <th>Alamat</th>
  51.             <th colspan="2">Action</th>
  52.           </tr>
  53.           <?php
  54.           include "koneksi.php";
  55.           $sql="SELECT * FROM siswa WHERE 1 "
  56.               .(isset($_POST['search'])?" AND {$_POST['field']} LIKE '%{$_POST['search']}%'":"";
  57.           $query = mysql_query($sql);
  58.           $id = 0;
  59.           while ($d = mysql_fetch_array($query)) {
  60.           ?>
  61.           <tr>
  62.             <td align="center"><?php echo ++$id; ?></td>
  63.             <td align="center"><?php echo $d['no_induk'];?></td>
  64.             <td><?php echo $d['nama'];?></td>
  65.             <td><?php echo $d['jeniskelamin'];?></td>
  66.             <td><?php echo $d['kelas'];?></td>
  67.             <td><?php echo $d['alamat'];?></td>
  68.             <td><a href="./edit.php?id=<?php echo $d['id']; ?>">Edit/Delete</a></td>
  69.            </tr>
  70.            <?php
  71.            }
  72.            ?>
  73.          </table>
  74.          <center>
  75.            <a href="./psb.php">Tambah Data</a>
  76.          </center>
  77.        </div>
  78.      </div> <!-- Content-outer -->
  79.      <div class="clear"></div>
  80.      <div id="footer-outer">
  81.        <div id="footer">
  82.           <div id="footer-kiri">
  83.             <div id="gambar">
  84.               <img src="images/ftlogo.png" />
  85.             </div>
  86.             <div id="tulisan">
  87.               <h3>Tentang Saya</h3>
  88.               <p>Nama : Aji Nurhidayatulloh</p>
  89.             </div>
  90.           </div>
  91.           <div id="footer-kanan">
  92.             <h3> Connect With Us</h3>
  93.             <ul>
  94.               <li>
  95.                 <a href="https://www.facebook.com/aji.nur.hidayatulloh" title="Facebook">
  96.                   <img src="images/facebook2.png" />
  97.                 </a>
  98.               </li>
  99.               <li>
  100.                 <a href="https://twitter.com/ajinoer28" title="Twitter">
  101.                   <img src="images/twitter2.png" />
  102.                 </a>
  103.               </li>
  104.               <li>
  105.                 <a href="https://plus.google.com/u/0/117392210595787159447" title="Google+">
  106.                   <img src="images/google2.png" />
  107.                 </a>
  108.               </li>
  109.             </ul>
  110.           </div>
  111.           <div class="clear"></div>
  112.           <div id="copy">
  113.             <p> @Copyright 2014 - Teknik Komputer Dan Jaringan</p>
  114.           </div>
  115.        </div>
  116.      </div> <!-- Footer-outer -->
  117.   </body>
  118. </html>
Advertisement
Add Comment
Please, Sign In to add comment