<table width="100%"  border="0" cellspacing="6" cellpadding="6">
  <tr>
    <td>Menu Delete dari Register Barang Bukti (BB PIDUM &amp; PIDSUS) </td>
  </tr>
</table>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><?PHP
include("index.db.php");
mysql_connect("$server", "$username", "$password");
mysql_select_db("$database");
$mytable = "$tahun_now";
$page = $_GET["page"];
if(empty($action))
{
if (empty($order)) $order =  2;
if (empty($page))  $page  =  1;
if (empty($hits))  $hits  = 500;
$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 BARANG BUKTI MASIH DALAM PROSES | <strong>$xnum</strong> | ";
for ($i=1;$i<=$stw2;$i++) {if($page==$i){
echo "<b> HAL $i |</b> ";} 
else{echo "<a href=\"?g=daftartahanan&d=inc_op&page=$i\"> $i |</a>";}}
print ('<br><br>');
$query  = "SELECT * FROM ".$mytable." ";
if(!empty($squery)) { $query .= "LIKE \"%$squery%\" ";}
$query .= "ORDER BY ID DESC LIMIT $start,$hits";
$res = mysql_query($query);
print ('<table width="100%"  border="0" cellspacing="1" cellpadding="1" bgcolor="#B05800">
        <thead><tr>
<td width="3%"><span class="style1"><strong>NO</strong></span></td>
<td width="7%"><span class="style1"><strong>BIDANG</strong></span></td>
<td width="17%"><span class="style1"><strong>NAMA TERDAKWA</strong></span></td>
<td width="20%"><span class="style1"><strong>NOMOR REG. BARANG BUKTI</strong></span></td>
<td width="29%"><span class="style1"><strong>NAMA BARANG</strong></span></td>
<td width="15%"><span class="style1"><strong>STATUS</strong></span></td>
<td width="16%"><span class="style1"><strong>PROSES</strong></span></td>

</tr></thead>');
$no=1; // fungsi nomor
 $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><center>'.$no++.'<center></td>');
print ('<td>');
if ($row['BIDANG'] == "1") {
print ('<center><img src="images/pidum.jpg" width="80" height="20"></center>');
} 
 elseif ($row['BIDANG'] == "2") {
print ('<center><img src="images/pidsus.jpg" width="80" height="20"></center>');
 } 
 print ('</td>');
print ('<td>'.$row['TERDAKWA'] .'</td>');
print ('<td>'.$row['RB'] .'</td>');
print ('<td>'.$row['NAMABARANG'] .'</td>');
print ('<td>');
if ($row['STATUS'] == "0") {
print ('BLM DIEKSEKUSI');
} 
 elseif ($row['STATUS'] == "1") {
print ('KEMBALI');
 } 
  elseif ($row['STATUS'] == "2") {
print ('LELANG');
 } 
  elseif ($row['STATUS'] == "3") {
print ('MUSNAH');
 } 
   elseif ($row['STATUS'] == "4") {
print ('DIRAMPAS UNTUK NEGARA');
 } 
print ('</td>');
print ('<td><a href="index.tahapan.php?ukey='.$row['UKEY'] .'&t=delete" ');
echo "onclick=\"NewWindow(this.href,'mywin','600','400','yes','center');return false\" onfocus=\"this.blur()\" class=\"menu\" target=\"_blank\">DELETE</a></td>";
print ('</tr>');
}
print ('</tbody></table>');
echo "<br><br>Ditampilkan $hits /Halaman";
}
?>
    </td>
  </tr>
</table>

