<?php
include("../index.globalconfig.php");
$ukey1 = $_GET['ukey'];
include("index.db.php");
mysql_connect("$server", "$username", "$password");
mysql_select_db("$database");
$mytable = "$tahun_now";
$sql2=mysql_query("select * from $mytable where UKEY='$ukey1' LIMIT 1");
while ($data2=mysql_fetch_array($sql2)){
?>
<script type="text/javascript">
function printF(printData)
{
var a = window.open ('', '',"status=1,scrollbars=1, width=900,height=600");
a.document.write(document.getElementById(printData).innerHTML.replace(/<a\/?[^>]+>/gi, ''));
a.document.close();
a.focus();
a.print();
a.close();
}
</script>

 <script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
<style type="text/css">
<!--
.style1 {
	font-size: 24px;
	font-weight: bold;
}
.style2 {font-size: 14}
-->
</style>
<table width="100%"  border="0" cellspacing="6" cellpadding="6">
    <tr>
      <td width="93%">&nbsp;</td>
      <td width="7%"><a href="#"  onClick="printF('printData')"><img src="print-icon.png" border="0"></a></td>
    </tr>
  </table>
<div id="printData"><LINK href="../images/index.css" rel="stylesheet" type="text/css">
  
  <table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td bgcolor="#000000"><table width="100%"  border="0" cellspacing="4" cellpadding="4">
        <tr>
          <td bgcolor="#FFFFFF"><table width="100%"  border="0" cellspacing="2" cellpadding="2">
            <tr>
              <td><div align="right">
                <table width="100%"  border="0" cellspacing="1" cellpadding="1">
                  <tr>
                    <td width="92%"><strong><?PHP echo "$satker"; ?></strong></td>
                    <td width="8%"><strong>B-10</strong></td>
                  </tr>
                </table>
                </div></td>
            </tr>
            <tr>
              <td><div align="center" class="style1 style2">
              KARTU BARANG BUKTI </div></td>
            </tr>
            <tr>
              <td><hr size="1"></td>
            </tr>
            <tr>
              <td><table width="100%"  border="0" cellspacing="1" cellpadding="1">
                <tr>
                  <td width="12%" bgcolor="#EFEFEF">Tanggal</td>
                  <td width="2%"><div align="center">:</div></td>
                  <td width="86%"><?PHP print('<b>'.$data2["TGLPROSES"].'</b>'); ?> (tanggal pemeriksaan BB/tahap 2) </td>
                </tr>
                <tr>
                  <td bgcolor="#EFEFEF">Nama Terdakwa </td>
                  <td><div align="center">:</div></td>
                  <td><?PHP print('<b>'.$data2["TERDAKWA"].'</b>'); ?></td>
                </tr>
                <tr>
                  <td bgcolor="#EFEFEF">Perkara No </td>
                  <td><div align="center">:</div></td>
                  <td><?PHP print('<b>'.$data2["PDM"].'</b>'); ?></td>
                </tr>
                <tr>
                  <td bgcolor="#EFEFEF">Register BB </td>
                  <td><div align="center">:</div></td>
                  <td><?PHP print('<b>'.$data2["RB"].'</b>'); ?></td>
                </tr>
                <tr>
                  <td bgcolor="#EFEFEF">Pasal</td>
                  <td><div align="center">:</div></td>
                  <td><?PHP print('<b>'.$data2["PASAL"].'</b>'); ?></td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td><div align="center">
                  <table width="100%"  border="0" cellspacing="1" cellpadding="1">
                    <tr bgcolor="#CCCCCC">
                      <td width="23%" rowspan="2"><div align="center">Jenis BB </div></td>
                      <td colspan="2"><div align="center">Tanggungjawab diterima <br>di Kejaksaan </div></td>
                      <td width="15%" rowspan="2"><div align="center">Tgl <br>Pelimpahan PN </div></td>
                      <td width="6%" rowspan="2"><div align="center">Diktum <br>TUT </div></td>
                      <td width="11%" rowspan="2"><div align="center">Tgl/<br>
                        Putusan</div></td>
                      <td width="7%" rowspan="2"><div align="center">Amar BB </div></td>
                      <td width="9%" rowspan="2"><div align="center">Pelaksanaan</div></td>
                      <td width="4%" rowspan="2"><div align="center">Ket</div></td>
                    </tr>
                    <tr>
                      <td width="14%" bgcolor="#999999"><div align="center">Tgl<br>Jaksa </div></td>
                      <td width="11%" bgcolor="#999999"><div align="center">TTD <br>Petugas </div></td>
                      </tr>
                    <tr bgcolor="#FFF0F0">
                      <td><p>&nbsp;</p>
                        <p>&nbsp;</p>
                        <table  border="0" align="center" cellpadding="2" cellspacing="2">
                          <tr>
                            <td>Sesuai Daftar </td>
                          </tr>
                        </table>                        <p>&nbsp;</p>
                        <p>&nbsp;</p></td>
                      <td><table  border="0" align="center" cellpadding="1" cellspacing="1">
                        <tr>
                          <td><?PHP print('<b>'.$data2["TGLPROSES"].'</b>'); ?></td>
                        </tr>
                        <tr>
                          <td><?PHP print('<b>'.$data2["JAKSA"].'</b>'); ?></td>
                        </tr>
                      </table></td>
                      <td>
                        <table  border="0" align="center" cellpadding="2" cellspacing="2">
                          <tr>
                            <td><?PHP print('<b>'.$data2["PETUGAS"].'</b>'); ?></td>
                          </tr>
                        </table></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                  </table>
                  </div></td>
            </tr>
          </table>
            <table width="100%"  border="0" cellspacing="1" cellpadding="1">
              <tr>
                <td><table width="100%"  border="0" cellspacing="6" cellpadding="6">
                  <tr>
                    <td><div align="center"><strong>BON / PINJAM BARANG BUKTI UNTUK KEPERLUAN SIDANG </strong></div></td>
                  </tr>
                </table>
                 <hr size="1">             
                    </td>
              </tr>
              <tr>
                <td bgcolor="#FFFFE8"><?PHP print (' <table width="100%"  border="0" cellspacing="2" cellpadding="2">
                    <tr>
                      <td width="4%">No</td>
                      <td width="34%">Rincian / Deskripsi </td>
                      <td width="40%">Lokasi Barang Bukti </td>
                      <td width="22%">UKEY</td>
                    </tr>
                    ');
include("index.db.php");
mysql_connect("$server", "$username", "$password");
mysql_select_db("$database");
$mytable = "$tahun_now";
$sql=mysql_query("select * from $mytable where UKEY='$ukey1'");
$no=1; // fungsi nomor
 $x=0;
while ($data=mysql_fetch_array($sql)){


   $x++;
   if($x==2) {$barva = "FFFFB7";$x=0;} else {$barva = "FFD8B0";$x=1;}
   print ('<tr bgcolor=#'.$barva.'>');
print('<td>'.$no++.'</td><td>'.$data["NAMABARANG"].'</td><td>');
if($data['LOKASI'] == "1"){ echo "GUDANG KEJARI"; }
if($data['LOKASI'] == "2"){ echo "RUBASAN"; }
if($data['LOKASI'] == "3"){ echo "PENITIPAN"; }
print ('</td><td>'.$data["UKEY"].'</td></tr>
                  </table>');
}
?></td>
              </tr>
            </table>
            <table width="100%"  border="0" cellspacing="1" cellpadding="1">
              <tr bgcolor="#CCCCCC">
                <td width="18%"><div align="center">Hari/<br>
                  Tanggal</div></td>
                <td width="19%"><div align="center">UKEY</div></td>
                <td width="25%"><div align="center">KELUAR <br>
                  TANDATANGAN</div></td>
                <td width="25%"><div align="center">KEMBALI <br>
                  TANDATANGAN </div></td>
                <td width="13%"><div align="center">KETERANGAN</div></td>
              </tr>
              <tr>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
              </tr>
              <tr bgcolor="#F5F5F5">
                <td height="50">&nbsp;</td>
                <td height="50" bgcolor="#F5F5F5">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
              </tr>
              <tr>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
              </tr>
              <tr bgcolor="#F5F5F5">
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
              </tr>
              <tr>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
              </tr>
              <tr>
                <td height="50" bgcolor="#F5F5F5">&nbsp;</td>
                <td height="50" bgcolor="#F5F5F5">&nbsp;</td>
                <td height="50" bgcolor="#F5F5F5">&nbsp;</td>
                <td height="50" bgcolor="#F5F5F5">&nbsp;</td>
                <td height="50" bgcolor="#F5F5F5">&nbsp;</td>
              </tr>
              <tr>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
              </tr>
              <tr bgcolor="#F5F5F5">
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
                <td height="50">&nbsp;</td>
              </tr>
            </table>
            <table width="100%"  border="0" cellspacing="2" cellpadding="2">
              <tr>
                <td>Catatan : Apabila Keluar dan kembali tidak pada hari yang sama label ini dapat digunakan lagi tanpa perlu mencetak ulang. jangan lupa masukkan nomor UKEY sesuai daftar barang bukti diatas </td>
              </tr>
            </table></td>
        </tr>
      </table></td>
    </tr>
  </table>
</div>
<table width="100%"  border="0" cellspacing="6" cellpadding="6">
  <tr>
    <td width="93%">&nbsp;</td>
    <td width="7%"><a href="#"  onClick="printF('printData')"><img src="print-icon.png" border="0"></a></td>
  </tr>
</table>
<?PHP } ?>