<?PHP
mysql_connect("localhost", "root", "benk");
mysql_select_db("cma_tahap2");
$mytable = "pidsus";
$conid1 = $_GET["conid"];
$uid1 = $_GET["uid"];
$query = "Select * from $mytable where uid = '$uid1'"; 
$result = mysql_query($query); 
if($row = mysql_fetch_array($result)){

$identitas = $row["t_identitasterdakwa"];
$cuts = explode("|", $identitas);
?>
<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>

<div id="printData"><LINK href="../images/index.css" rel="stylesheet" type="text/css"><table width="100%"  border="0" cellspacing="2" cellpadding="2">
  <tr>
    <td bgcolor="#FFFFFF">
      <table width="100%"  border="0" align="center" cellpadding="2" cellspacing="2">
        <tr>
          <td width="91%">             
<table width="100%"  border="0" cellspacing="1" cellpadding="0">
  <tr>
    <td width="30%">
      </td>
    <td width="44%">&nbsp;</td>
    <td width="26%"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><div align="center"><strong>KARTU RECORD TERSANGKA </strong>
        <hr width="300" size="1">
    </div></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><div align="center"></div></td>
    <td>&nbsp;</td>
  </tr>
</table>
</td>
        </tr>
        <tr>
          <td>
          </td>
        </tr>
        <tr>
          <td><table width="100%"  border="0" cellspacing="2" cellpadding="2">
            <tr>
              <td width="3%">&nbsp;</td>
              <td width="97%"><table width="90%"  border="0" align="center" cellpadding="2" cellspacing="2">
                <tr>
                  <td width="45%" bgcolor="#000000"><table width="100%"  border="0" cellspacing="1" cellpadding="0">
                      <tr>
                        <td height="250" bgcolor="#FFFFFF"><p align="center"><img src="./digrecog/<?PHP echo $foto = $row["t_foto"]; ?>"></p>                            </td>
                      </tr>
                  </table></td>
                </tr>
              </table>
              <table width="100%"  border="0" cellspacing="2" cellpadding="2">
                <tr>
                  <td colspan="4">&nbsp; </td>
                </tr>
                <tr>
                  <td colspan="4"><strong>1. IDENTITAS</strong> <em>Psl 143 ayat (2a) KUHAP </em></td>
                </tr>
                <tr>
                  <td width="6%"><div align="center">a.</div></td>
                  <td width="25%">Nama Terdakwa </td>
                  <td width="2%">:</td>
                  <td width="67%"><b><?PHP echo $cuts[0]; ?></b></td>
                </tr>
                <tr>
                  <td><div align="center">b. </div></td>
                  <td>Tempat  Lahir </td>
                  <td>:</td>
                  <td><b><?PHP echo $cuts[1]; ?></b></td>
                </tr>
                <tr>
                  <td><div align="center">c. </div></td>
                  <td>Umur / Tgl. Lahir </td>
                  <td>:</td>
                  <td><b><?PHP echo $cuts[2]; ?> ( <?PHP echo $cuts[3]; ?> )</b></td>
                </tr>
                <tr>
                  <td><div align="center">d. </div></td>
                  <td>Jenis Kelamin </td>
                  <td>:</td>
                  <td><b><?PHP echo $cuts[4]; ?></b></td>
                </tr>
                <tr>
                  <td><div align="center">e.</div></td>
                  <td>Kewarganegaraan </td>
                  <td>:</td>
                  <td><b><?PHP echo $cuts[5]; ?></b></td>
                </tr>
                <tr>
                  <td><div align="center">f.</div></td>
                  <td>Alamat/ Tempat tinggal </td>
                  <td>:</td>
                  <td><b><?PHP echo $cuts[6]; ?></b></td>
                </tr>
                <tr>
                  <td><div align="center">g.</div></td>
                  <td>Agama / Kepercayaan </td>
                  <td>:</td>
                  <td><b><?PHP echo $cuts[7]; ?></b></td>
                </tr>
                <tr>
                  <td><div align="center">h.</div></td>
                  <td>Pekerjaan </td>
                  <td>:</td>
                  <td><b><?PHP echo $cuts[8]; ?></b></td>
                </tr>
                <tr>
                  <td><div align="center">i.</div></td>
                  <td>Pendidikan</td>
                  <td>:</td>
                  <td><b><?PHP echo $cuts[9]; ?></b></td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
              </table></td>
            </tr>
          </table>
            <table width="100%"  border="0" cellspacing="2" cellpadding="2">
              <tr>
                <td width="3%">&nbsp;</td>
                <td width="97%"><table width="100%"  border="0" cellspacing="2" cellpadding="2">
                    <tr>
                      <td colspan="4"> <strong>2. Data Perkara </strong>                          </td>
                    </tr>
                    <tr>
                      <td width="6%"><div align="center">1.</div></td>
                      <td width="25%">No Reg Perkara </td>
                      <td width="2%">:</td>
                      <td width="67%"><b><?PHP echo $pdm = $row["t_regperkara"]; ?></b></td>
                    </tr>
                    <tr>
                      <td><div align="center">2.</div></td>
                      <td>No Reg Tahanan </td>
                      <td>:</td>
                      <td><b><?PHP echo $pdm = $row["t_regtah"]; ?></b></td>
                    </tr>
                    <tr>
                      <td><div align="center">3.</div></td>
                      <td>No Reg Barang Bukti </td>
                      <td>:</td>
                      <td><b><?PHP echo $pdm = $row["t_regbb"]; ?></b></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                </table>
                  <table width="100%"  border="0" cellspacing="2" cellpadding="2">
                    <tr>
                      <td colspan="4"> <strong><?PHP mysql_connect("localhost", "root", "benk");
mysql_select_db("cma_pidsus");
$conid2 = $_GET["conid"];
$query2 = "Select * from p_perkara where uid = '$conid2'"; 
$result2 = mysql_query($query2); 
if($row2 = mysql_fetch_array($result2)){ ?>3. Informasi Penanganan Perkara </strong></td>
                    </tr>
                    <tr>
                      <td width="6%"><div align="center">1.</div></td>
                      <td width="25%">Pasal Dakwaan </td>
                      <td width="2%">:</td>
                      <td width="67%"><b><?PHP echo $dakwaan = $row2["spdp_pasal"]; ?></b></td>
                    </tr>
                    <tr>
                      <td><div align="center">2.</div></td>
                      <td>Jaksa / Penuntut Umum </td>
                      <td>:</td>
                      <td><b><?PHP echo $dakwaan = $row2["p16a_jaksa"]; ?></b></td>
                    </tr>
                    <tr>
                      <td><div align="center">3.</div></td>
                      <td>Tanggal P21 </td>
                      <td>:</td>
                      <td><b><?PHP echo $tp21 = $row2["berkas_p21"]; ?></b></td>
                    </tr>
                    <tr>
                      <td><div align="center">4.</div></td>
                      <td>Tanggal Tahap 2 </td>
                      <td>:</td>
                      <td><b><?PHP echo $t2 = $row2["berkas_tahap2tgl"]; ?></b></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                  </table>
                  <table width="100%"  border="0" cellspacing="2" cellpadding="2">
                    <tr>
                      <td width="100%">&nbsp;  </td>
                    </tr>
                    <tr>
                      <td>Dibuat dengan Camelon Unity </td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
      </table>
   </td>
  </tr>
</table></div>
<table width="100%"  border="0" cellspacing="1" cellpadding="1">
  <tr>
    <td width="10%">&nbsp;</td>
    <td width="79%"><table width="100%"  border="0" cellspacing="1" cellpadding="1">
        <tr>
          <td width="90%"><div align="center"><strong>Anda ingin print data ini silahkan tekan icon printer disamping ini </strong></div></td>
          <td width="10%"><div align="center"><a href="#"  onClick="printF('printData')"><img src="print-icon.png" border="0"></a></div></td>
        </tr>
    </table></td>
    <td width="11%">&nbsp;</td>
  </tr>
</table>
<?PHP }} ?>