<?PHP include("../index.cma.db.php"); ?>
<table width="100%"  border="0" cellspacing="6" cellpadding="6">
  <tr>
    <td>UPDATE PERKARA BERKAS TAHAP 1 DATANG </td>
  </tr>
  <tr>
    <td>Yang akan ditampilkan disini adalah berkas dengan SPDP yang telah ditunjuk Jaksa / P16 </td>
  </tr>
  <tr>
    <td><?
include("../index.cma.db.php");
mysql_connect("$server", "$username", "$password");
mysql_select_db("$database");
$query = "Select * from tab_dataperkara where t_id = '1'"; 
$result = mysql_query($query); 
if($row2 = mysql_fetch_array($result)){ 
$mytable = $row2['t_table'];
$edisi = $row2['t_tahun'];
$page2 = $_GET["page2"];
if(empty($action))
{
if (empty($order)) $order =  2;
if (empty($page2))  $page2  =  1;
if (empty($hits))  $hits  = 500;
$start = $hits*($page2-1);
$query = "SELECT * FROM $mytable WHERE p16_jaksa1 !='0' ORDER BY uid DESC";
$res = mysql_query("$query"); 
$xnum = mysql_num_rows($res);
$stw2 = (int)($xnum/$hits);
if ($xnum%$hits > 0) {$stw2++;}
$np = $page2+1;
$pp = $page2-1;
if ($page2 == 1) { $pp=1; }
if ($np > $stw2) { $np = $stw2;} 
echo "TOTAL PERKARA $edisi SEBANYAK <strong>$xnum</strong> TERSANGKA | ";
for ($i=1;$i<=$stw2;$i++) {if($page2==$i){
echo "<b> HAL $i |</b> ";} 
else{echo "<a href=\"?g=pratut&i=index&page2=$i#tab1\"> $i |</a>";}}
print ('<br><br>');
$query  = "SELECT * FROM $mytable ";
if(!empty($squery)) { $query .= "LIKE \"%$squery%\" ";}
$query .= "WHERE p16_jaksa1 !='0' ORDER BY uid DESC LIMIT $start,$hits";
$res = mysql_query($query);
print ('<table class="tableWithFloatingHeader" width="100%"  border="0" cellspacing="1" cellpadding="1" bgcolor="#B05800">
        <thead><tr>
<th width="40%"><strong>NAMA TERSANGKA <br>SURAT DARI<br>PASAL</strong></th>
<th width="20%"><strong>JAKSA</strong></th>
<th width="10%"><strong>Tanggal SPDP</strong></th>
<th width="30%"><strong>Berkas Tahap 1</strong></th>
</tr></thead>');
 $x=0;
  while($row = mysql_fetch_array($res))
  {
   $x++;
   if($x==2) {$barva = "FF6600";$x=0;} else {$barva = "FFFFCC";$x=1;}
   
//---------kolom 1
print ('<tbody><tr bgcolor=#'.$barva.'><td><b>'.$row['spdp_namatsk'] .'</b><br>');
$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 ('<br><i>'. $row['spdp_pasal'].'</i></td>');
print ('<td>');
$jaksa1 = $row['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><center>'. $row['spdp_terimatgl'].'</center></td>');

print ('<td>');
$id = $row['uid'];
if ($row['berkas_tahap1tgl'] !== "") {print '<center>'.$row['berkas_tahap1tgl'].'</center>';} 
elseif ($row['berkas_tahap1tgl'] == "") {
echo "<br><center><a href=\"../pidum/index.pratut.post.tahapan.php?uid=$id&table=$mytable&do=berkastahap1\" onclick=\"NewWindow(this.href,'mywin','600','200','yes','center');return false\" onfocus=\"this.blur()\" class=\"menu\"><b>POSTING</b></a></center>";
print ('</td>');
}
print ('</tr>');} 
print ('</tbody> </table>');
echo "<br><br>Ditampilkan $hits /Halaman";
}
}
?></td>
  </tr>
</table>
