

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>CAMELON  | PERPUSTAKAAN</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK href="../images/index.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--

.style1 {color: #FFFFFF}
body {
	margin-top: 0px;
	background-image: url(../images/green_wallpaper.jpg);
	margin-bottom: 0px;
}
-->
</style></head>

<body>
<table width="1100"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="200" valign="bottom" background="../images/camelon_a.jpg"><table width="100%"  border="0" cellspacing="5" cellpadding="5">
      <tr>
        <td><div align="center"></div></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="22%" valign="top" bgcolor="#336600"><table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td bgcolor="#669900"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><form name="form1" method="post" action="index.auth.php">
                  <table width="300" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td background="../images/bg.jpg"><table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                          <td><a href="index.php" class="menu">BERANDA</a></td>
                        </tr>
                      </table>                        </td>
                    </tr>
                  </table>
                </form></td>
              </tr>
            </table></td>
          </tr>
        </table>
          <table width="300" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="449" valign="top" background="../images/camelon_library.jpg"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><form name="form2" method="post" action="perpus_search.php">
                        <table width="80%" border="0" align="center" cellpadding="8" cellspacing="8">
                          <tr>
                            <td><div align="center"></div></td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                          <tr>
                            <td><div align="center"><span class="style1">PENCARIAN BUKU </span></div></td>
                          </tr>
                          <tr>
                            <td><div align="center">
                                <input name="query" type="text" id="query22">
                            </div></td>
                          </tr>
                          <tr>
                            <td><div align="center">
                                <input type="submit" name="Submit2" value="CARI JUDUL BUKU">
                            </div></td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                        </table>
                    </form></td>
                  </tr>
              </table></td>
            </tr>
          </table></td>
        <td width="78%" valign="top" bgcolor="#CCCCCC"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td bgcolor="#FF9900"><table width="100%"  border="0" cellspacing="4" cellpadding="4">
                  <tr>
                    <td><strong>PENCARIAN BUKU </strong></td>
                  </tr>
              </table></td>
            </tr>
          </table>
          <table width="100%"  border="0" cellspacing="4" cellpadding="4">
            <tr>
              <td><table width="100%"  border="0" cellspacing="5" cellpadding="5">
                <tr>
                  <td><strong>Hasil Pencarian Buku Menurut Judul Maupun Pengarang </strong></td>
                </tr>
                <tr>
                  <td>&nbsp; </td>
                </tr>
                <tr>
                  <td><?php
mysql_connect("localhost", "root", "benk") or die("Error connecting to database: ".mysql_error());
mysql_select_db("cma") or die(mysql_error());
?>
                      <?php
			
			
    $query = $_POST['query'];
    $min_length = 3;
    if(strlen($query) >= $min_length){
        $query = htmlspecialchars($query);
        $query = mysql_real_escape_string($query);
        $raw_results = mysql_query("SELECT * FROM perpustakaan
        WHERE (`p_judul` LIKE '%".$query."%') OR (`p_pengarang` LIKE '%".$query."%')") or die(mysql_error());
	
        if(mysql_num_rows($raw_results) > 0){ // if one or more rows are returned do following
             print ('<table width="100%"  border="0" cellspacing="2" cellpadding="2">
  <tr bgcolor="#FF9900">
    <td><div align="center"><strong>Judul Buku </strong></div></td>
  <td><div align="center"><strong>Pengarang</strong></div></td>
    <td><div align="center"><strong>Jumlah Buku </strong></div></td>
    <td><div align="center"><strong>Tahun</strong></div></td>
  <td><div align="center"><strong>RAK</strong></div></td>
  </tr>');
            while($results = mysql_fetch_array($raw_results)){
             
    
	  print ('
  <tr bgcolor="#FFF1BB">
    <td>'.$results['p_judul'].'</td>
    <td>'.$results['p_pengarang'].'</td>
    <td>'.$results['p_jmlh'].'</td>
    <td>'.$results['p_dicetak'].'</td>
    <td>'.$results['p_kat'].'</td>
  </tr>
');
            }
             print ('</table>');
        }
        else{ 
            echo "Tidak ditemukan judul maupun pengarang tersebut";
        }
         
    }
    else{ // if query length is less than minimum
        echo "Minimum length is ".$min_length;
    }
?></td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                </tr>
              </table></td>
            </tr>
          </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<table width="1100" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#EEEEEE"><table width="699"  border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td><div align="center">Thank you for using Camelon (Pro Version) Need upgrade <a href="readme/index.php"><strong>Click Here</strong></a> </div></td>
      </tr>
      <tr>
        <td><div align="center">(c) 2016 Created By <a href="http://www.chendia.net"><strong>Chendia Studio</strong></a></div></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>


