<LINK href="./images/index.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	background-image: url();
}
-->
</style>
<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>
<?PHP
include("../index.globalconfig.php");
?>
<?PHP
$id1 = $_POST["id"];
$p_nama1 = $_POST["t_nama"];
$p_alamat1 = $_POST["t_alamat"];
$p_keterangan1 = $_POST["t_keterangan"];
$p_bertemu1 = $_POST["t_bertemu"];
$tgl1 = date("d F Y");

$error = "";
if ($id1 == ""){$error = "ID Simpan Tidak Boleh Kosong<BR>";}
if ($p_nama1 == ""){$error = "Nama harus diisi<BR>";}
if ($p_alamat1 == ""){$error = "Alamat Harus Diisi!.<BR>";}
if ($p_keterangan1 == ""){$error = "Keperluan / Keterangan Harus Di Isi.<BR>";}
if ($p_bertemu1 == ""){$error = "Tujuan Bertemu dengan Harus Di Isi.<BR>";}
include("tamu_postdb.php");
//$query = "Select * from $mytable where tamu_id = '$id1'";
//$result = mysql_query($query); 
//if ($row = mysql_fetch_array($result)){ 
//if  ($row["tamu_id"] == $id1){$error = "$error <b>TIDAK BOLEH ADA DUPLIKASI ID SIMPAN : $id1<b><br><br>SOLUSI : ULANGI DARI HALAMAN <a href=\"tamu_post.php\">DEPAN</a>\n";}
//}
if ($error == ""){
$query = "UPDATE $mytable Set tamu_nama = '$p_nama1' where tamu_id = '$id1'";  
$result = mysql_query($query); 
$query = "UPDATE $mytable Set tamu_alamat  = '$p_alamat1' where tamu_id = '$id1'";  
$result = mysql_query($query); 
$query = "UPDATE $mytable Set tamu_tujuan = '$p_bertemu1' where tamu_id = '$id1'";  
$result = mysql_query($query); 
$query = "UPDATE $mytable Set tamu_ket = '$p_keterangan1' where tamu_id = '$id1'";  
$result = mysql_query($query); 

$query = "UPDATE $mytable Set tamu_tgl  = '$tgl1' where tamu_id = '$id1'";  
$result = mysql_query($query); 
print ('<div id="printData"><LINK href="images/index.css" rel="stylesheet" type="text/css">

<table width="800"  border="0" align="center" cellpadding="2" cellspacing="2">
  <tr>
    <td><span class="style4">'.$satker.'</span></td>
  </tr>
  <tr>
    <td><div align="center"></div></td>
  </tr>
  <tr>
    <td><p align="center" class="style3">KARTU - TAMU</p>    </td>
  </tr>
  <tr>
    <td><div align="center">VISITOR - CARD </div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>      <table width="100%"  border="0" cellspacing="2" cellpadding="2">
      <tr>
        <td width="5%" rowspan="2"><div align="center">1.</div></td>
        <td width="22%">Nama</td>
        <td width="1%">:</td>
        <td width="72%">'.$p_nama1.'</td>
      </tr>
      <tr>
        <td><em>Name</em></td>
        <td>&nbsp;</td>
        <td><hr size="1"></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td rowspan="2"><div align="center">2.</div></td>
        <td>Alamat</td>
        <td>:</td>
        <td>'.$p_alamat1.'</td>
      </tr>
      <tr>
        <td><em>Address</em></td>
        <td>&nbsp;</td>
        <td><hr size="1"></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td rowspan="2"><div align="center">3.</div></td>
        <td>Bertemu dengan </td>
        <td>:</td>
        <td>'.$p_bertemu1.'</td>
      </tr>
      <tr>
        <td><em>Wants to see </em></td>
        <td>&nbsp;</td>
        <td><hr size="1"></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td rowspan="2"><div align="center">4.</div></td>
        <td>Keperluan</td>
        <td>:</td>
        <td>'.$p_keterangan1.'</td>
      </tr>
      <tr>
        <td><em>Subject</em></td>
        <td>&nbsp;</td>
        <td><hr size="1"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="36%" bgcolor="#000000"><table width="100%"  border="0" cellspacing="1" cellpadding="1">
          <tr>
            <td bgcolor="#FFFFFF"><table width="100%"  border="0" cellspacing="2" cellpadding="2">
              <tr>
                <td>Catatan Bagian PTSP/Resepsi:</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><div align="center">...........................................................</div></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><div align="center">............................................................</div></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>Catatan Yang Ditemui: </td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><div align="center">............................................................</div></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><div align="center">............................................................</div></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><div align="center">............................................................</div></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table></td>
          </tr>
        </table></td>
        <td width="64%"><table width="100%"  border="0" cellspacing="1" cellpadding="1">
          <tr>
            <td width="15%">&nbsp;</td>
            <td width="27%">'.$kota.'</td>

            <td width="58%">'.$tgl1.'</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td colspan="2">Tandatangan Tamu / Visitors Signature </td>
            </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td colspan="2">( ....................................................) </td>
            </tr>
        </table>
          <blockquote>&nbsp;</blockquote></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td>Harap dikembalikan kartu ini kebagian PTSP / Penerimaaan Tamu </td>
  </tr>
  <tr>
    <td><em>Please return this card to reception Desk </em></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Nomor Kartu Tamu : '.$id1.'</td>
  </tr>
</table>
');

}
else
{
echo "$error.";
} 
?>
<div align="center">
  
  <p><a href="#"  onClick="printF('printData')"><img src="images/print.png" width="200" height="200" border="0"></a>
</p>
  <p><a href="index.php"><strong>BACK </strong></a></p>
  <p>Sesuaikan ukuran kertas dengan output surat  </p>
</div>
