<script type="text/javascript">	
$(document).ready(function() {

	$("#cari").click(function(){
		var tgl_awal = $("#t_tgl_awal").val();
		var tgl_akhir = $("#t_tgl_akhir").val();
		
		if(tgl_awal.length==''){
			alert('Maaf, Tanggal awal periode masih kosong.');
			$("#t_tgl_awal").focus();
			return false;
		}
		if(tgl_akhir.length==''){
			alert('Maaf, Tanggal akhir periode belum terisi.');
			$("#t_tgl_akhir").focus();
			return false;
		}
		$("#data").show();
		$("#data").load('modul/report/tampil_data_iv.php?tgl_awal='+tgl_awal+'&tgl_akhir='+tgl_akhir);
	});
	
	$("#refresh").click(function() {
		window.location.reload();		
	});
	
	$("#cetak").click(function() {
		var tgl_awal = $("#t_tgl_awal").val();
		var tgl_akhir = $("#t_tgl_akhir").val();
		
		if(tgl_awal.length==''){
			alert('Maaf, Tanggal awal periode belum terisi.');
			$("#t_tgl_awal").focus();
			return false;
		}
		if(tgl_akhir.length==''){
			alert('Maaf, Tanggal akhir periode masih kosong.');
			$("#t_tgl_akhir").focus();
			return false;
		}		
		window.location.href='modul/laporan/daftar_inv.php?tgl_awal='+tgl_awal+'&tgl_akhir='+tgl_akhir;
	});
	
	$("#tutup").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';
	
echo "<div span='12' style='background-color:white'>";
echo "<div id='form' align='center'><h2>DAFTAR INVOICE UNIT PRODUKSI<h2></div>";
echo "<div id='filter' align='left'>
	<fieldset>
		<legend>Filter Data </legend>
		<table width='100%'>
			<tr>
				<td width='7%'>Tanggal</td>
				<td width='1%'>:</td>
				<td><input type='date' name='t_tgl_awal' id='t_tgl_awal' size='10'></td>				
				<td width='12%'>Sampai dengan</td>
				<td><input type='date' name='t_tgl_akhir' id='t_tgl_akhir' size='10'></td>

				<td align='right'>
					<button name='cari' id='cari'>CARI</button>
					<button name='refresh' id='refresh'>REFRESH</button>
					<button name='cetak' id='cetak'>CETAK</button>
					<button name='tutup' id='tutup'>TUTUP</button>
				</td>
			</tr>
		</table>
	</fieldset>
	</div><br>";
	
echo "<div id='data' align='center'></div>";
echo "</div>";
?>