<table width="100%"  border="0" cellspacing="4" cellpadding="4">
  <tr>
    <td><strong>PROSES TAHAP 2 </strong></td>
  </tr>
  <tr>
    <td>&nbsp;      </td>
  </tr>
  <tr>
    <td><table width="100%"  border="0" cellspacing="4" cellpadding="4" class="panel">
      <tr>
        <td>Lakukan informasi Tahap 2 Terhadap Perkara. (SOP) Penanganan perkara.</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>      <table width="100%"  border="0" cellspacing="8" cellpadding="8">
        <tr>
          <td><?PHP
	$page = $_GET["page"];
mysql_connect("localhost", "root", "benk");
mysql_select_db("cma_pidsus");
$mytable = "p_perkara";
if(empty($action))
{
if (empty($order)) $order =  2;
if (empty($page))  $page  =  1;
if (empty($hits))  $hits  = 20;
$start = $hits*($page-1);
$query = "SELECT * FROM $mytable where berkas_p21 !=''";
$res = mysql_query("$query"); 
$xnum = mysql_num_rows($res);
$stw2 = (int)($xnum/$hits);
if ($xnum%$hits > 0) {$stw2++;}
$np = $page+1;
$pp = $page-1;
if ($page == 1) { $pp=1; }
if ($np > $stw2) { $np = $stw2;} 
echo "DAFTAR PERKARA <strong>$xnum</strong> | ";
for ($i=1;$i<=$stw2;$i++) {if($page==$i){
echo "Halaman <b>$i</b> ";} 
else{echo " <font size=\"2\"><a href=\"?id=$id1&page=$i\">$i</A></font> ";}}
print ('<br><br>');
$query  = "SELECT * FROM ".$mytable." ";
if(!empty($squery)) { $query .= "WHERE uid LIKE \"%$squery%\" ";}
$query .= "where berkas_p21 !='' ORDER BY uid DESC LIMIT $start,$hits";
$res = mysql_query($query);
print ('<table id="myTable" width="100%"  border="0" cellspacing="1" cellpadding="1" bgcolor="#663333">
        <thead><tr>
<td width="5%"><span class="style1"><strong>NO</strong></span></td>
<td width="10%"><span class="style1"><strong>LINK</strong></span></td>
<td width="15%"><span class="style1"><strong>NAMA TERSANGKA</strong></span></td>
<td width="20%"><span class="style1"><strong>PASAL</strong></span></td>

<td width="10%"><span class="style1"><strong>P21</strong></span></td>
<td width="10%"><span class="style1"><strong>TAHAP 2</strong></span></td>
<td width="20%"><span class="style1"><strong>Jaksa P16A</strong></span></td>
<td width="10%"><span class="style1"><strong>DETAIL</strong></span></td>

</tr></thead><tbody>');
 $x=0;
  while($row = mysql_fetch_array($res))
  {
   $x++;
   if($x==2) {$barva = "CB9898";$x=0;} else {$barva = "FFCCFF";$x=1;}


print ('<tr bgcolor=#'.$barva.'>');
print ('<td><center>'.$row['uid'] .'</center></td>');

print ('<td>');
if ($row['uid_laporan'] == "") {
print ('<center>-</center>');
} 
 elseif ($row['uid_laporan'] !== "") {
print ('<a href="?g=daftarperkaraview&d=inc&id='.$row['uid_laporan'] .'" class="menupidsus">LINKLAP</a>');
 } 
print ('</td>');


print ('<td>'.$row['spdp_namatsk'].'</td>');
print ('<td>'.$row['spdp_pasal'].'</td>');

print ('<td>'.$row['berkas_p21'].'</td>');
print ('<td>'.$row['berkas_tahap2tgl'].'</td>');
print ('<td>'.$row['p16a_jaksa'].'</td>');

print ('<td>');
if ($row['berkas_tahap2tgl'] == "") {
print ('<a href="?g=tahap2view&d=inc&id='.$row['uid'] .'" class="menupidsus">SET TAHAP II</a>');
} 
 elseif ($row['berkas_tahap2tgl'] !== "") {
print ('<a href="?g=tahap2view&d=inc&id='.$row['uid'] .'">SUDAH TAHAP 2</a>');
 } 
print ('</td>');










print ('</tr>');
}
print ('</tbody></table>');
echo "<br><br>Ditampilkan $hits /Halaman";
}
?></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
