<?PHP
include("index.globalconfig.php");
include("index.cma.db.php");
$query = "Select * from $mytable"; 
$result = mysql_query($query); 
if($row = mysql_fetch_array($result)){
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><?PHP echo $satker; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK href="images/index.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="images/jqbtk.css">

<style type="text/css">
<!--
body {
	background-image: url();
	margin-top: 0px;
	margin-left: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
.style2 {color: #FFFFFF}
-->
</style><style type="text/css" media="all">
@import "style.css";
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
.style14 {color: #FFFFFF;
	font-weight: bold;
	font-size: large;
}
.style3 {color: #FFFFFF;
	font-weight: bold;
}
.style3 {color: #FFFFFF;
	font-weight: bold;
}
</style>
<style type="text/css">
#fixmetoo { position: absolute; right: 0px; bottom: 0px; width: 100%;
}
body > div#fixmetoo { position: fixed; }
</style>
<script type="text/javascript">
var message="Sorry, right-click has been disabled";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
</script> </head>

<body>
  <script src="images/jquery.min.js"></script>
		<script src="images/bootstrap.min.js"></script>
		<script src="images/jqbtk.js"></script>
		<script>
			$(function(){
				$('#default').keyboard();
				$('#number').keyboard();
				
			});
		</script>
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><div align="center">
        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="46%" bgcolor="#669900">
              <div align="left">
                <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="700" height="50">
                  <param name="movie" value="themes/top_hijau.swf">
                  <param name="quality" value="high">
                  <embed src="themes/top_hijau.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="700" height="50"></embed>
                </object>
            </div></td>
            <td width="49%" bgcolor="#669900"><div align="center"><span class="style14"><b><?PHP echo $satker; ?></b></span></div></td>
            <td width="5%" bgcolor="#669900">&nbsp;</td>
          </tr>
        </table>
    </div></td>
  </tr>
  <tr>
    <td><div align="left">
        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="90%" colspan="2" bgcolor="#99CC00"><table width="100%"  border="0" cellspacing="8" cellpadding="8">
              <tr>
                <td width="37%"><form name="form1" method="post" action="index.mip.perkara.cari.php">
                    <table width="100%"  border="0" cellspacing="8" cellpadding="8">
                      <tr>
                        <td width="52%"><div align="center" class="style3">PENCARIAN DATA PERKARA </div></td>
                        <td width="48%"><input name="query" type="text" class="keyboard form-control" id="default" size="30"></td>
                      </tr>
                    </table>
                  </form>
                    <script src="images/jquery.min.js"></script>
                    <script src="images/bootstrap.min.js"></script>
                    <script src="images/jqbtk.js"></script>
                    <script>
			$(function(){
				$('#default').keyboard();
				$('#number').keyboard();
				
			});
		      </script></td>
                <td width="63%"><form name="form1" method="post" action="index.mip.denda.cari.php">
                    <table width="100%"  border="0" cellspacing="4" cellpadding="4">
                      <tr>
                        <td width="44%"><div align="center" class="style2"><strong>PILIH BULAN LALU MASUKAN NOMOR TILANG </strong></div></td>
                        <td width="22%"><select name="table" id="select3">
                            <option value="tilang_januari">Januari</option>
                            <option value="tilang_februari">Februari</option>
                            <option value="tilang_maret">Maret</option>
                            <option value="tilang_april">April</option>
                            <option value="tilang_mei">Mei</option>
                            <option value="tilang_juni">Juni</option>
                            <option value="tilang_juli">Juli</option>
                            <option value="tilang_agustus">Agustus</option>
                            <option value="tilang_september">September</option>
                            <option value="tilang_oktober">Oktober</option>
                            <option value="tilang_nopember">Nopember</option>
                            <option value="tilang_desember">Desember</option>
                            <option value="tilang_januari" selected>Pilih Bulan Tilang</option>
                          </select>
                        </td>
                        <td><input name="queryd" type="text" class="keyboard form-control" id="number" size="30"></td>
                      </tr>
                    </table>
                </form></td>
              </tr>
            </table></td>
          </tr>
        </table>
        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="12%"><a href="index.mip.php" class="menu">BERANDA</a></td>
            <td width="15%"><a href="index.mip.pejabat.php" class="menu">PEJABAT KEJARI </a></td>
            <td width="13%"><a href="index.mip.tp4d.php" class="menu">INFO TP4D </a></td>
            <td width="19%"><a href="index.mip.pidum.php" class="menu">INFO PERKARA PIDANA UMUM </a></td>
            <td width="41%"><a href="index.mip.tilang.php" class="menu">INFO DENDA TILANG </a></td>
          </tr>
        </table>
        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="18%" height="420" valign="top">
              <table width="100%" border="0" cellpadding="0" cellspacing="1">
                <tr>
                  <td>
                    <div align="center">
                      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="235" height="60">
                        <param name="movie" value="themes/koruptor.swf">
                        <param name="quality" value="high">
                        <embed src="themes/koruptor.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="235" height="60"></embed>
                      </object>
                  </div></td>
                </tr>
                <tr>
                  <td><table width="235"  border="0" cellspacing="4" cellpadding="4">
                      <tr>
                        <td>Gunakan media ini untuk mengetahui informasi-informasi yang anda butuhkan secara mandiri disini tersaji:</td>
                      </tr>
                      <tr>
                        <td><strong>Informasi Perkara</strong> : Anda dapat mengetahui sampai tahap apa perkara tersebut. bagaimana progress atau perkembangannya. Hingga informasi putusan / vonis pengadilan dapat anda lihat disini. </td>
                      </tr>
                      <tr>
                        <td><strong>Informasi Umum</strong> : Anda dapat mendapatkan informasi lainnya yang akan tersaji melalui Anjungan Media Informasi ini. </td>
                      </tr>
                      <tr>
                        <td><div align="center">TERSEDIA LAYANAN INFORMASI BARANG BUKTI, CEK DAN SEGERA MBIL BARANG BUKTI ANDA </div></td>
                      </tr>
                  </table></td>
                </tr>
            </table></td>
            <td width="82%" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="200" background="themes/camelon_a.jpg" bgcolor="#666600"><img src="themes/camelon_a.jpg" width="1123" height="223"></td>
              </tr>
            </table>
        
              <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td bgcolor="#CCCCCC"><table width="100%"  border="0" cellspacing="8" cellpadding="8">
                    <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'];
	$table = "$tahun_now";
    $min_length = 3;
    if(strlen($query) >= $min_length){
        $query = htmlspecialchars($query);
        $query = mysql_real_escape_string($query);
        $raw_results = mysql_query("SELECT * FROM $table 
        WHERE (`spdp_namatsk` LIKE '%".$query."%') OR (`spdp_pasal` LIKE '%".$query."%') OR (`p16_jaksa1` 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 width="15%"><span class="style1"><strong>NAMA TERSANGKA</strong></span></td>
<td width="15%"><span class="style1"><strong>PENYIDIK</strong></span></td>
<td width="15%"><span class="style1"><strong>PASAL</strong></span></td>
<td width="15%"><span class="style1"><strong>JAKSA</strong></span></td>
<td width="10%"><span class="style1"><strong>P18</strong></span></td>
<td width="10%"><span class="style1"><strong>P21</strong></span></td>
<td width="10%"><span class="style1"><strong>SIDANG</strong></span></td>
<td width="10%"><span class="style1"><strong>PUTUS</strong></span></td>
  </tr>');
            while($results = mysql_fetch_array($raw_results)){
             
    
	  print ('
  <tr bgcolor="#FFF1BB">
    <td>'.$results['spdp_namatsk'].'</td>
    <td>');

	$polisi1 = $results['spdp_dari'];
 mysql_connect("$server", "$username", "$password");
mysql_select_db("$database");
$sql=mysql_query("select * from tab_polisi where p_nomor = '$polisi1'");
while ($data=mysql_fetch_array($sql)){
print(''.$data['p_nama'].'');
}
	
	print ('</td>
    <td>'.$results['spdp_pasal'].'</td><td>');
	

$jaksa1 = $results['p16_jaksa1'];
 mysql_connect("$server", "$username", "$password");
mysql_select_db("$database");
$sql=mysql_query("select * from tab_personil where daftar_pegid = '$jaksa1'");
while ($data=mysql_fetch_array($sql)){
print('<b>'.$data['daftar_nama'].'</b>');
}


	print ('</td>');
  print ('<td>');
if ($results['berkas_tahap1p18tgl'] == "") {print ('-');} elseif ($results['berkas_tahap1p18tgl'] !== "") {print (''.$results['berkas_tahap1p18tgl'] .'');} 
print ('</td>');
print ('<td>');
if ($results['berkas_tahap1p21tgl'] == "") {print ('-');} elseif ($results['berkas_tahap1p21tgl'] !== "") {print (''.$results['berkas_tahap1p21tgl'] .'');} 
print ('</td>');
print ('<td>');
if ($results['berkas_tgltapsidang'] == "") {print ('-');} elseif ($results['berkas_tgltapsidang'] !== "") {print (''.$results['berkas_tgltapsidang'] .'');} 
print ('</td>');
print ('<td>');
if ($results['berkas_ptstgl'] == "") {print ('-');} elseif ($results['berkas_ptstgl'] !== "") {print (''.$results['berkas_ptstgl'] .'');} 
print ('</td></tr>');
  

            }
             print ('</table>');
        }
        else{ 
            echo "Tidak ditemukan nama tersangka tersebut";
        }
         
    }
    else{ // if query length is less than minimum
        echo "Minimum length is ".$min_length;
    }
?></td>
                    </tr>
                  </table></td>
                </tr>
              </table>
              <table width="100%"  border="0" cellspacing="8" cellpadding="8">
                <tr>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                </tr>
              </table></td>
          </tr>
        </table>
    </td>
  </tr>
</table>
<div align="center" class="style2" id="fixmetoo"> 
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td bgcolor="#CCCCCC"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="18%" bgcolor="#669900"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>
                    <div align="center" class="style7"><strong><? echo date('d/m/Y'); ?></strong></div></td>
                </tr>
            </table></td>
            <td width="82%" bgcolor="#66CC00"><table width="100%"  border="0" cellspacing="2" cellpadding="2">
              <tr>
                <td height="30"><marquee>
                  <?PHP
					$tahun=date("Y");
$link = mysql_connect("localhost", "root", "benk"); mysql_select_db("cma", $link);
$SQL     = "SELECT * FROM pengumuman ORDER By i_id DESC LIMIT 5";
$results = mysql_query($SQL);
while ($row = mysql_fetch_array($results)){
print ('<b>PENGUMUMAN</b> DIKIRIM TANGGAL '.$row['i_tgl'].' [ '.$row['i_kegiatan'].' ] --- ');
} 
print (' -E-N-D- ');
?>
                </marquee></td>
              </tr>
            </table></td>
          </tr>
      </table></td>
    </tr>
  </table>
</div>
</body>
</html>
<? } ?>
