<table width="100%"  border="0" cellspacing="2" cellpadding="2">
  <tr>
    <td><img src="images/bb_pidum.png" width="300" height="100"></td>
  </tr>
  <tr>
    <td><?PHP
include("index.db.php");
mysql_connect("$server", "$username", "$password");
mysql_select_db("$database");
//load year

$query = "Select * from barbuk_db where t_id = '1'"; 
$result = mysql_query($query); 
if($row = mysql_fetch_array($result)){ 
 $mytable = $row['t_table'];

//------end
$page = $_GET["page"];
if(empty($action))
{
if (empty($order)) $order =  2;
if (empty($page))  $page  =  1;
if (empty($hits))  $hits  = 50;
$start = $hits*($page-1);
$query = "SELECT * FROM $mytable WHERE LOKASI ='3' AND STATUS ='0' AND BIDANG ='1'";
$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 PADA PENITIPAN | <strong>$xnum</strong> | ";
for ($i=1;$i<=$stw2;$i++) {if($page==$i){
echo "<b> HAL $i |</b> ";} 
else{echo "<a href=\"?g=rekapgudang&page=$i\"> $i |</a>";}}
print ('<br><br>');
$query  = "SELECT * FROM ".$mytable." ";
if(!empty($squery)) { $query .= "LIKE \"%$squery%\" ";}
$query .= "WHERE LOKASI ='3' AND STATUS ='0' AND BIDANG ='1' ORDER BY ID 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="3%"><span class="style1"><strong>NO</strong></span></td>
<td width="15%"><span class="style1"><strong>NAMA TERDAKWA</strong></span></td>
<td width="10%"><span class="style1"><strong>UKEY</strong></span></td>
<td width="15%"><span class="style1"><strong>NOMOR REG. BARANG BUKTI</strong></span></td>
<td width="15%"><span class="style1"><strong>IJIN SITA</strong></span></td>
<td width="24%"><span class="style1"><strong>DAFTAR BARANG BUKTI</strong></span></td>
<td width="8%"><span class="style1"><strong>LABEL</strong></span></td>
<td width="20%"><span class="style1"><strong>LABEL</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>'.$row['TERDAKWA'] .'</td>');
print ('<td>'.$row['UKEY'] .'</td>');
print ('<td>'.$row['RB'] .'</td>');
print ('<td>'.$row['IJINSITA'] .'</td>');
print ('<td>'.$row['NAMABARANG'] .'</td>');
print ('<td><a href="index.cetaklabel.php?ukey='.$row['RB'] .'" class="menu" target="_blank">CETAK</a></td>');
print ('<td><a href="index.cetaklabel.barcode.php?ukey='.$row['RB'] .'" class="menu" target="_blank">WITH BARCODE</a></td>');
print ('</tr>');
}
print ('</tbody></table>');
echo "<br><br>Ditampilkan $hits /Halaman";
}
}
?>
</td>
  </tr>
  <tr>
    <td><img src="images/bb_pidsus.png" width="300" height="100"></td>
  </tr>
  <tr>
    <td><?PHP
include("index.db.php");
mysql_connect("$server", "$username", "$password");
mysql_select_db("$database");
//load year

$query = "Select * from barbuk_db where t_id = '1'"; 
$result = mysql_query($query); 
if($row = mysql_fetch_array($result)){ 
 $mytable = $row['t_table'];

//------end
$page = $_GET["page"];
if(empty($action))
{
if (empty($order)) $order =  2;
if (empty($page))  $page  =  1;
if (empty($hits))  $hits  = 50;
$start = $hits*($page-1);
$query = "SELECT * FROM $mytable WHERE LOKASI ='3' AND STATUS ='0' AND BIDANG ='2'";
$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 PADA PENITIPAN | <strong>$xnum</strong> | ";
for ($i=1;$i<=$stw2;$i++) {if($page==$i){
echo "<b> HAL $i |</b> ";} 
else{echo "<a href=\"?g=rekapgudang&page=$i\"> $i |</a>";}}
print ('<br><br>');
$query  = "SELECT * FROM ".$mytable." ";
if(!empty($squery)) { $query .= "LIKE \"%$squery%\" ";}
$query .= "WHERE LOKASI ='3' AND STATUS ='0' AND BIDANG ='2' ORDER BY ID 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="3%"><span class="style1"><strong>NO</strong></span></td>
<td width="15%"><span class="style1"><strong>NAMA TERDAKWA</strong></span></td>
<td width="10%"><span class="style1"><strong>UKEY</strong></span></td>
<td width="15%"><span class="style1"><strong>NOMOR REG. BARANG BUKTI</strong></span></td>
<td width="15%"><span class="style1"><strong>IJIN SITA</strong></span></td>
<td width="24%"><span class="style1"><strong>DAFTAR BARANG BUKTI</strong></span></td>
<td width="8%"><span class="style1"><strong>LABEL</strong></span></td>
<td width="20%"><span class="style1"><strong>LABEL</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>'.$row['TERDAKWA'] .'</td>');
print ('<td>'.$row['UKEY'] .'</td>');
print ('<td>'.$row['RB'] .'</td>');
print ('<td>'.$row['IJINSITA'] .'</td>');
print ('<td>'.$row['NAMABARANG'] .'</td>');
print ('<td><a href="index.cetaklabel.php?ukey='.$row['RB'] .'" class="menu" target="_blank">CETAK</a></td>');
print ('<td><a href="index.cetaklabel.barcode.php?ukey='.$row['RB'] .'" class="menu" target="_blank">WITH BARCODE</a></td>');
print ('</tr>');
}
print ('</tbody></table>');
echo "<br><br>Ditampilkan $hits /Halaman";
}
}
?></td>
  </tr>
</table>
