<script type="text/javascript" src="js/autoNumeric.js"></script>
<script type="text/javascript" src="js/numeral.js"></script>
<script type="text/javascript">
	jQuery(function($) {
	    $('.auto').autoNumeric('init');
	});
	
	
</script>
<style>
	.auto {
		text-align:right;
	}
</style>
<?php
$PID = "card_op";
$SC = $_SERVER["SCRIPT_NAME"];

require_once("lib/dbconn.php");
require_once("lib/form.php");
require_once("lib/functions.php");



if($_GET[act] == "add_guest"):
include"add_guest_card.php";
elseif($_GET[act] == "add_staff"):
include"add_staff_card.php";
else:
title("<img src='images/sales-report-icon.png' width='65' align='absmiddle' >  Key Card Operations");
	
?>
<div class="ui three column stackable grid">
  <div class="column">
		
		<table width="100%" class="gridtable_form" border="1px">						
			<tr>
				<td>Add Card (Guest)</td>
				<td><input type="button" value="Check" onclick="javascript:addCardGuest();" class="blue ui mini button" ></td>
			</tr>
			<tr>
				<td>Add Card (Staff)</td>
				<td><input type="button" value="Check" onclick="javascript:addCardStaff();" class="blue ui mini button" ></td>
			</tr>
			<tr>
				<td>Read Card </td>
				<td><input type="button" value="Check" onclick="javascript:readCard();" class="blue ui mini button" ></td>
			</tr>
			<tr>
				<td>Erase Card </td>
				<td><input type="button" value="Check" onclick="javascript:eraseCard();" class="blue ui mini button" ></td>
			</tr>
			<tr>
				<td>Card Log</td>
				<td><input type="button" value="Check" onclick="javascript:cardLog();" class="blue ui mini button" ></td>
			</tr>
		</table>
	</div>	
</div>	
	
	
<script language='JavaScript'>
	function cari_kamar(tag) {
	    sWin = window.open('includes/cari_kamar.php?jns='+tag, 'xWin',
	 	'top=0,left=0,width=1200,height=550,menubar=no,scrollbars=yes');
	    sWin.focus();
	}
	
	function cetakDP(tag, tag1) {
	    sWin = window.open('includes/cetak_dp.php?idx='+tag+'&kw='+tag1, 'xWin',
	 	'top=0,left=0,width=1200,height=550,menubar=no,scrollbars=yes');
	    sWin.focus();
	}
	function cetakKunci(nomor_room, tanggal_checkin,tanggal_checkout,nama,idguest) {
	    sWin = window.open('includes/cetak_card.php?nomor_room='+nomor_room+'&tanggal_ci='+tanggal_checkin+'&tanggal_co='+tanggal_checkout+'&nama='+nama+'&idguest='+idguest, 'xWin',
	 	'top=0,left=0,width=550,height=550,menubar=no,scrollbars=yes');
	    sWin.focus();
	}
	function addCardGuest() {
	    window.location= "<?=$SC;?>?p=card_op&act=add_guest";	
	}
	function cardLog() {
	    window.location= "<?=$SC;?>?p=card_log";	
	}
	function addCardStaff() {
	    window.location= "<?=$SC;?>?p=card_op&act=add_staff";	
	}
	function readCard() {
	    sWin = window.open('includes/read_card.php', 'xWin',
	 	'top=0,left=0,width=550,height=550,menubar=no,scrollbars=yes');
	    sWin.focus();
	}
	function eraseCard() {
	    sWin = window.open('includes/erase_card.php', 'xWin',
	 	'top=0,left=0,width=550,height=550,menubar=no,scrollbars=yes');
	    sWin.focus();
	}
</script>
<?php endif;?>