<?PHP
include("../index.globalconfig.php");
mysql_connect("localhost", "root", "benk");
mysql_select_db("cma");
$mytable = "besuk_events";
$tiket1 = $_GET["tiket"];
$query = "Select * from $mytable where event_tiket = '$tiket1'"; 
$result = mysql_query($query); 
if($row = mysql_fetch_array($result)){
$identitas = $row["event_identitas"];
$cuts = explode("|", $identitas);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>PRINT BESUK</title>
<LINK href="../images/index.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">


<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: 14px;
	font-weight: bold;
}
-->
 </style>
</head>

<body>
 <div id="printData"><LINK href="../images/index.css" rel="stylesheet" type="text/css">
   <table width="100%"  border="0" cellspacing="4" cellpadding="4">
  <tr>
    <td width="3%">
        <div align="left"></div></td>
    <td width="56%"><table width="100%"  border="0" cellspacing="1" cellpadding="0">
      <tr>
        <td><div align="center"><?PHP echo "$satker"; ?></div></td>
      </tr>
      <tr>
        <td><div align="center"><strong><?PHP echo "$alamat"; ?></strong></div></td>
      </tr>
      <tr>
        <td><div align="center"></div></td>
      </tr>
      <tr>
        <td><div align="center"></div></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table></td>
    <td width="41%"></td>
  </tr>
  <tr>
    <td colspan="3"><div align="center">
      <table width="100%"  border="0" cellspacing="1" cellpadding="1">
        <tr>
          <td width="25%">&nbsp;</td>
          <td width="48%"><div align="center"><strong>SURAT IZIN MENGUNJUNGI TAHANAN
                  
            </strong>
            </div>
            <hr size="1"></td>
          <td width="27%">&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><div align="center">Nomor:
              <b><?PHP echo htmlspecialchars($row['event_nobesuk']); ?></b></div></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td><div align="center" class="style1">T-10</div></td>
        </tr>
      </table>
      <strong></strong></div></td>
  </tr>
</table>
<table width="100%"  border="0" cellspacing="1" cellpadding="1">
  <tr>
    <td><table width="90%"  border="0" align="center" cellpadding="4" cellspacing="4">
      <tr>
        <td colspan="5"><strong>Diberikan Kepada : </strong></td>
      </tr>
      <tr>
        <td width="5%">&nbsp;</td>
        <td width="26%">Nama Lengkap </td>
        <td width="3%">:</td>
        <td colspan="2"><b><?PHP echo $cuts[0]; ?></b></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>Alamat</td>
        <td>:</td>
        <td colspan="2"><b><?PHP echo $cuts[1]; ?></b></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>Pekerjaan</td>
        <td>:</td>
        <td colspan="2"><b><?PHP echo $cuts[2]; ?></b></td>
      </tr>
      <tr>
        <td rowspan="2">&nbsp;</td>
        <td>Hubungan</td>
        <td>:</td>
        <td colspan="2"><b><?PHP echo $cuts[3]; ?></b></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="2">&nbsp;</td>
      </tr>
      <tr>
        <td colspan="5"><strong>Untuk mengunjungi Tahanan : </strong></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>Nama Lengkap </td>
        <td>:</td>
        <td colspan="2"><b><?PHP echo $cuts[4]; ?></b></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>Tempat Lahir </td>
        <td>:</td>
        <td colspan="2"><b><?PHP echo $cuts[5]; ?></b></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>Umur/Tanggal Lahir </td>
        <td>:</td>
        <td colspan="2"><b><?PHP echo $cuts[6]; ?></b></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>Jenis Kelamin </td>
        <td>:</td>
        <td colspan="2"><b><?PHP echo $cuts[7]; ?></b></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>Kebangsaan</td>
        <td>:</td>
        <td colspan="2"><b><?PHP echo $cuts[8]; ?></b></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>Tempat Tinggal </td>
        <td>:</td>
        <td colspan="2"><b><?PHP echo $cuts[9]; ?></b></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>Agama</td>
        <td>:</td>
        <td colspan="2"><b><?PHP echo $cuts[10]; ?></b></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>Pekerjaan</td>
        <td>:</td>
        <td colspan="2"><b><?PHP echo $cuts[11]; ?></b></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>Reg. Tahanan Nomor </td>
        <td>:</td>
        <td colspan="2"><b><?PHP echo htmlspecialchars($row['event_regtahanan']); ?></b></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>Reg. Perkara Nomor </td>
        <td>:</td>
        <td colspan="2"><b><?PHP echo htmlspecialchars($row['event_pdm']); ?></b></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>Keperluan</td>
        <td>:</td>
        <td colspan="2"><b><?PHP echo $cuts[14]; ?></b></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>Izin Berlaku </td>
        <td>:</td>
        <td colspan="2">Hari
            
          <b><?PHP echo $cuts[15]; ?></b> Tanggal
          <b><?PHP echo $cuts[16]; ?></b> / <?PHP echo $tgl2=date("d M Y");?> </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="2">Jam 08.00 WIB sampai dengan 12.00 WIB </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="2">&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td width="10%">&nbsp;</td>
        <td width="56%">&nbsp;</td>
      </tr>
      <tr>
        <td rowspan="3">&nbsp;</td>
        <td rowspan="3"><div align="center">YOUR TIKET NUMBER IS/NOMOR TIKET ANDA:<br>
              <table  border="0" align="center" cellpadding="2" cellspacing="2">
                <tr>
                  <td><img src="index.barcode.php?text=<?PHP echo htmlspecialchars($row['event_tiket']); ?>" alt="barcode" /></td>
                </tr>
                        </table>
              <br>
              PLEASE SAVE IT /MOHON SIMPAN
              </p>
        </div></td>
        <td rowspan="3">&nbsp;</td>
        <td rowspan="3">&nbsp;</td>
        <td><center><?PHP echo "$kota"; ?>, <?PHP echo $tgl2=date("d M Y");?></center></td>
      </tr>
      <tr>
        <td><div align="center">AN. KEPALA <?PHP echo "$kejari"; ?></div></td>
      </tr>
      <tr>
        <td><div align="center">KEPALA SEKSI TINDAK PIDANA UMUM</div></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><div align="center"><b>  </b> </div></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><center><?PHP
mysql_connect("localhost", "root", "benk");
mysql_select_db("cma");
$query = "Select * from tab_personil where daftar_set  = 'ksp'"; 
$result = mysql_query($query); 
if($row = mysql_fetch_array($result)){
print (''.$row['daftar_nama'].'<br>'.$row['daftar_nip'].'<br>');
?>

<? } ?></center></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table></div>
<table width="100%"  border="0" cellspacing="2" cellpadding="2">
  <tr>
    <td><div align="right"></div></td>
  </tr>
</table>
<table width="100%"  border="0" cellspacing="1" cellpadding="1">
  <tr>
    <td bgcolor="#FF9900"><table width="100%"  border="0" cellspacing="4" cellpadding="4">
      <tr>
        <td width="71%" valign="top">&nbsp;</td>
        <td width="22%"><div align="center">PRINT TANDA TERIMA INI </div></td>
        <td width="7%"><div align="center"><a href="#"  onClick="printF('printData')"><img src="print-icon.png" border="0"></a></div></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
<? } ?>