<table width="100%"  border="0" cellspacing="4" cellpadding="4">
  <tr>
    <td width="84%"><strong>SURAT MASUK PIDSUS LAPORAN TERJADINYA TINDAK PIDANA KORUPSI </strong></td>
    <td width="16%"><a href="?g=inputlaporan&d=inc" class="menupidsus">INPUT SURAT BARU  </a></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;      </td>
  </tr>
  <tr>
    <td colspan="2"><table width="100%"  border="0" align="center" cellpadding="4" cellspacing="4" class="panel">
      <tr>
        <td><table width="100%"  border="0" cellspacing="4" cellpadding="4">
          <tr>
            <td width="12%" bgcolor="#FFCC00"><div align="center">TIPS</div></td>
            <td width="88%">Pencatatan laporan masuk ini adalah olah digital dari data sumber manual ke elektronik. beberapa data yang sangat penting agar tidak disertakan dalam aplikasi 'inisial&quot; atau gunakan minimal data hingga proses penuntutan baru dilakukan perbaikan. </td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="2"></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2"><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_laporan";
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";
$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 "TOTAL LAPORAN MASUK <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 p_uid LIKE \"%$squery%\" ";}
$query .= "ORDER BY p_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="8%"><span class="style1"><strong>TGL SURAT</strong></span></td>
<td width="15%"><span class="style1"><strong>ASAL SURAT</strong></span></td>
<td width="15%"><span class="style1"><strong>NO SURAT</strong></span></td>
<td width="5%"><span class="style1"><strong>BUNDEL</strong></span></td>
<td width="8%"><span class="style1"><strong>TGL AGENDA</strong></span></td>
<td width="15%"><span class="style1"><strong>KASUS POSISI</strong></span></td>
<td width="2%"><span class="style1"><strong><center>*</center></strong></span></td>
<td width="15%"><span class="style1"><strong>DISPOSISI</strong></span></td>
<td width="12%"><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['p_uid'] .'</center></td>');
print ('<td><center>'.$row['p_tglsrt'].'</center></td>');
print ('<td>'.$row['p_asalsrt'].'</td>');
print ('<td>'.$row['p_nosrt'].'</td>');
print ('<td>'.$row['p_bundel'].'</td>');
print ('<td><center>'.$row['p_tglagenda'].'</center></td>');


print ('<td>');
$i_info1 = $row['p_kasusposisi'];
$maxlen=50;
if (strlen($i_info1)>$maxlen)
echo $i_info2 = substr($i_info1,0,$maxlen-3)."...";
else 
echo $i_info2  = $i_info1;
print ('</td>');

print ('<td>');
if ($row['p_tindaklanjut'] == "1") {echo "<center><img src=\"images/aktif.jpg\" width=\"10\" height=\"10\"></center>";} 
elseif ($row['p_tindaklanjut'] == "0") {echo "<center><img src=\"images/nonaktif.jpg\" width=\"10\" height=\"10\"></center>";} 
print ('</td>');




print ('<td>');
if ($row['p_isidisposisi'] !== "") {
print (''.$row['p_isidisposisi'] .'');
} 
 elseif ($row['p_isidisposisi'] == "") {echo "<center><b>--BELUM DI TELAAH--</b></center>";} 
print ('</td>');

print ('<td> <a href="?g=lapmasukview&d=inc&id='.$row['p_uid'] .'" class="menupidsus">VIEW/EDIT</a></td>');
print ('</tr>');
}
print ('</tbody></table>');
echo "<br><br>Ditampilkan $hits /Halaman";
}
?></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
</table>
