<script type="text/javascript">	
$(document).ready(function() {
	$("#tabs").tabs({selected:0});
	$("#form").load('modul/gaji/form.php');	
		
	$("#cari_data").click(function(){		
		var tahun = $("#t_tahun").val();
		var bulan = $("#t_bulan").val();
		var nik1  = $("#t_nik1").val();
		var nik2  = $("#t_nik2").val();
				
		
		if(tbulan.length == 0){
			var error = true;
			alert("Maaf, Anda belum memilih bulan.");
			$("#t_bulan").focus();
			return (false);
        }
		if(ttahun.length == 0){
			var error = true;
			alert("Maaf, kolom Tahun harus diisi lebih dahulu.");
			$("#t_tahun").focus();
			return (false);
        }
		
		var akses	= 1;
		$.ajax({
			type	: "GET",
			url	: "modul/gaji/tampil_data.php",
			data	: "kode="+kode,
			timeout	: 2000,
			beforeSend	: function(){		
				$("#tampil_data").html("<img src='loading.gif' />");			
			},				  
			success	: function(data){
				$("#tampil_data").html(data);				
			}
		});
	});
	
	$("#tutup_slip").click(function(){
		document.location='?module=home';
	});
});
</script>

<style type="text/css">
#info {
	font-size:12px;
	font-weight:bold;
	color:#F00;
}
</style>
<?php
include "../../inc/inc.koneksi.php";
$tanggal=date('Y-m-d');
$tahun=substr($tanggal,0,4);

echo "<div id='tabs'>";
echo "<ul >
	       <li><a href='#form'>INPUT GAJI BULANAN</a></li>
	       <li><a href='#data'>CETAK SLIP GAJI</a></li>
		</ul>";
	echo "<div id='form'>
		</div>";
		
	echo "<div id='data'>
			<div id='pencarian'>
				<table width='100%'>
				<tr>
					<td>Bulan : <select name='t_bulan' id='t_bulan' >
						<option value='' selected>-Pilih-</option>
						<option value='1'> 1 - JANUARI</option>
						<option value='2'> 2 - FEBRUARI</option>
						<option value='3'> 3 - MARET</option>
						<option value='4'> 4 - APRIL</option>
						<option value='5'> 5 - MEI</option>
						<option value='6'> 6 - JUNI</option>
						<option value='7'> 7 - JULI</option>
						<option value='8'> 8 - AGUSTUS</option>
						<option value='9'> 9 - SEPTEMBER</option>
						<option value='10'>10 - OKTOBER</option>
						<option value='11'>11 - NOVEMBER</option>
						<option value='12'>12 - DESEMBER</option>
					</select>
					</td>
			
					<td>Tahun : <input type='number' name='t_tahun' id='t_tahun' value='$tahun' size='5'></td>
					<td>NIK : <input type='text' name='t_nik1' id='t_nik1' size='4'> S/D <input type='text' name='t_nik2' id='t_nik2' size='4' ></td>
					<td>
						<button name='cari_data' id='cari_data'>Cari</button>
						<button name='cetak_slip' id='cetak_slip'>Cetak</button>
						<button name='tutup_slip' id='tutup_slip'>Tutup</button>
					</td>
				</tr>
				</table>
			</div>
			
			<div id='tampil_data' align='center'></div>
	</div>";
	
	echo "<div id='info' align='center'></div>";
echo "</div>";
?>
