<?PHP
include("../index.globalconfig.php");
?>
<?PHP
include("../index.cma.db.php");
date_default_timezone_set('ASIA/JAKARTA');
$tablename3 = "bukutamu";
$next_increment     = 0;
$qShowStatus        = "SHOW TABLE STATUS LIKE '$tablename3'";
$qShowStatusResult  = mysql_query($qShowStatus) or die ( "Query failed: " . mysql_error() . "<br/>" . $qShowStatus );
$row = mysql_fetch_assoc($qShowStatusResult);
$next_increment = $row['Auto_increment'];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><?PHP echo $satker; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK href="../images/index.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	background-image: url();
}
.style2 {
	font-size: 16px;
	font-weight: bold;
}
.style3 {
	font-size: 18px;
	font-weight: bold;
}
.style4 {
	font-size: 14px;
	font-weight: bold;
}
-->
</style></head>

<body>
<table width="80%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><form action="tamu_postadd.php" method="post" name="tamu" id="tamu">
      <table width="548"  border="0" align="center" cellpadding="3" cellspacing="3">
        <tr>
          <td height="50" colspan="3"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="548" height="118">
            <param name="movie" value="../themes/tamu.swf">
            <param name="quality" value="high">
            <embed src="../themes/tamu.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="548" height="118"></embed>
          </object></td>
        </tr>
        <tr>
          <td colspan="3"><div align="center"><span class="style2">WELCOME TO <?php echo $satker; ?>           </span></div></td>
        </tr>
        <tr>
          <td colspan="3"><div align="center">Today<strong>
            <?php date_default_timezone_set('ASIA/JAKARTA'); print date("d F Y"); ?>
          </strong></div></td>
        </tr>
        <tr>
          <td colspan="3"><table width="320" align="center">
                    <tr>
                      <td valign=top>
                        <div align="center">
                          <script type="text/javascript" src="webcam.js"></script>
                          <!-- Configure a few settings -->
                          <script language="JavaScript">
		webcam.set_api_url( 'upfoto.php' );
		webcam.set_quality( 90 ); // JPEG quality (1 - 100)
		webcam.set_shutter_sound( true ); // play shutter click sound
	                    </script>
                          <!-- Next, write the movie to the page at 320x240 -->
                          <script language="JavaScript">
		document.write( webcam.get_html(500, 240) );
	                    </script>
                          <br><br><input name="button" type=button onClick="webcam.configure()" value="Settings">
                          <input name="button" type=button onClick="webcam.freeze()" value="Ambil Foto">
                          <input name="button" type=button onClick="webcam.reset()" value="Foto Ulang">
                          <input name="button" type=button onClick="do_upload()" value="Upload"> 
                            <script language="JavaScript">
		webcam.set_hook( 'onComplete', 'my_completion_handler' );
		
		function do_upload() {
			// upload to server
			document.getElementById('upload_results').innerHTML = 'Uploading...';
			webcam.upload();
			
		}
		
		function my_completion_handler(msg) {
			// extract URL out of PHP output
			if (msg.match(/(http\:\/\/\S+)/)) {
				var image_url = RegExp.$1;
				// show JPEG image in page
				document.getElementById('upload_results').innerHTML = 
					'Foto Sukses Diupload bro<br>' + 
					'<img src="' + image_url + '">';
				'<input name="foto" type="hidden" id="foto" value="' + image_url + '">';
				// reset camera for another shot
				webcam.reset();
			}
			else alert("PHP Error: " + msg);
		}
	                    </script>
                        </div></td>
                    </tr>
                    <tr>
                      <td valign=top><div id="upload_results" style="background-color:#eee;">
                        
                      </div></td>
                    </tr>
                </table></td>
        </tr>
        <tr>
          <td colspan="3"><div align="right">
            <input name="id" type="text" id="id" value="<?PHP echo $next_increment; ?>" size="3" readonly>
          </div></td>
        </tr>
        <tr>
          <td colspan="3">Isikan sesuai data KTP anda Tamu.            </td>
        </tr>
        <tr>
          <td width="28%">Nama Anda </td>
          <td width="2%">:</td>
          <td width="70%"><input name="t_nama" type="text" id="p_judul2" size="50" onkeyup="javascript:this.value=this.value.toUpperCase();"></td>
        </tr>
        <tr>
          <td width="28%">Alamat</td>
          <td width="2%">:</td>
          <td><input name="t_alamat" type="text" id="t_nama" size="60" onkeyup="javascript:this.value=this.value.toUpperCase();"></td>
        </tr>
        <tr>
          <td width="28%">Bertemu Dengan </td>
          <td width="2%">:</td>
          <td><input name="t_bertemu" type="text" id="t_bertemu" size="40"></td>
        </tr>
        <tr>
          <td> Keperluan </td>
          <td>:</td>
          <td><input name="t_keterangan" type="text" id="t_keterangan" value="" size="50">
        </td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>              <input type="submit" name="Submit" value="CEK IN NOW">
          </td>
        </tr>
        <tr>
          <td colspan="3">Tata Tertib: </td>
          </tr>
        <tr>
          <td colspan="3"><table width="100%"  border="0" cellspacing="2" cellpadding="2">
            <tr>
              <td width="5%">1.</td>
              <td width="95%">Tamu wajib menyerahkan identitas yang masih berlaku kepada petugas. Sebagai dasar isian diatas. </td>
            </tr>
            <tr>
              <td>2.</td>
              <td>Menggunakan Kartu Identitas Tamu di saku baju / mudah terlihat.</td>
            </tr>
            <tr>
              <td>3.</td>
              <td>Tamu Menyerahkan Kartu Print Out Kepada yang ditemui dan meminta otentikasi/tanda terima dan mengembalikan kepada petugas </td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td colspan="3">&nbsp;</td>
        </tr>
      </table>
    </form></td>
  </tr>
</table>

</body>
</html>


