<LINK href="images/index.css" rel="stylesheet" type="text/css"><table width="100%"  border="0" cellspacing="4" cellpadding="4">
  <tr>
    <td><form name="form1" method="post" action="">
      <div align="right">
        <input type="button" value="KEMBALI" onclick="history.back(-1)" />
        </div>
    </form></td>
  </tr>
  <tr>
    <td><?
$id = $_GET["id"];
include("../index.cma.db.php");
$query = "Select * from tab_dataperkara where t_id = '1'"; 
$result = mysql_query($query); 
if($row2 = mysql_fetch_array($result)){ 
$mytable = $row2['t_table'];
}
$pagey = $_GET["page"];
if(empty($action))
{
if (empty($order)) $order =  2;
if (empty($pagey))  $pagey  =  1;
if (empty($hits))  $hits  = 100;
$start = $hits*($pagey-1);
$query = "SELECT * FROM $mytable where p16_jaksa1='$id'";
$res = mysql_query("$query"); 
$xnum = mysql_num_rows($res);
$stw2 = (int)($xnum/$hits);
if ($xnum%$hits > 0) {$stw2++;}
$np = $pagey+1;
$pp = $pagey-1;
if ($pagey == 1) { $pp=1; }
if ($np > $stw2) { $np = $stw2;} 
$SQL     = "SELECT * FROM tab_personil where daftar_pegid ='$id'";
$results = mysql_query($SQL);
while ($row = mysql_fetch_array($results)){
$nama = $row["daftar_nama"];
echo "TOTAL PERKARA | JaksaID : <strong>$nama</strong> | <strong>$xnum</strong> | ";
}
for ($i=1;$i<=$stw2;$i++) {if($pagey==$i){
echo "[ <b>$i</b> ]";} 
else{echo "<a href=\"?page=$i\"> $i |</a>";}}
print ('<br><br>');
$query  = "SELECT * FROM ".$mytable." ";
if(!empty($squery)) { $query .= "WHERE uid LIKE \"%$squery%\" ";}
$query .= "where p16_jaksa1='$id' ORDER BY uid DESC LIMIT $start,$hits";
$res = mysql_query($query);
print ('<table id="myTable" width="100%"  border="0" cellspacing="1" cellpadding="1" bgcolor="#B05800">
        <thead><tr>
<td width="20%"><span class="style1"><strong>NAMA TERSANGKA</strong></span></td>
<td width="20%"><span class="style1"><strong>SURAT DARI</strong></span></td>
<td width="60%"><span class="style1"><strong>PASAL SANGKAAN</strong></span></td>

</tr></thead><tbody>');
 $x=0;
  while($row = mysql_fetch_array($res))
  {
   $x++;
   if($x==2) {$barva = "FFFFB7";$x=0;} else {$barva = "FFD8B0";$x=1;}
print ('<tr bgcolor=#'.$barva.'><td>'.$row['spdp_namatsk'] .'</td>');

print ('<td>');
$polisi1 = $row['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>');
print ('<td>'. $row['spdp_pasal'].'</td>');
print ('</tr>');
}
print ('</tbody></table>');
}
?></td>
  </tr>
</table>
