<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>    
  <style>
 	
 </style>
 
</head>
 <body> 
	<div style="height:60px; width: 900px;">
		<div id="hdrlaporanpengeluaranbarangwip" style="height:60px; width: 800px;">
		<p>C. LAPORAN POSISI BARANG DALAM PROSES (WIP)<span style="padding-left:20px;"></p> 
		<p>KAWASAN BERIKAT <span style="padding-left:10px;"><input type="text" id="namaperush" size=30 value="PT. EDS MANUFACTURING INDONESIA" style="width:200px"/> </p>
		<p>PERIODE : <input type="text" id="tglawallapposisibrgdlmproses" size=15 value="<?php echo $datestock; ?>" readonly="readonly"/>  S.D <input type="text" id="tglakhirlapposisibrgdlmproses" size=15 value="<?php echo  date('d/m/Y'); ?>" readonly="readonly"/> (2) 
		<span style="padding-left:20px;">
		<button id="printlapposisibrgdlmprosessearch">Search</button>
		<button id="printlapposisibrgdlmprosepdf">PDF</button>
		<button id="printlapposisibrgdlmprosesrtf">EXCEL</button></span></p>
		</div> 
		<div id="add_progress" align="center" style="display:none"><?php echo $loading_indicator; ?></div>
		<div id="divlapposisibrgdlmproses">
			<table id="grdlaporanbarangdalamproses"></table> <div id="pgrdlaporanbarangdalamproses"> </div>
		</div>
			
		<div id="divprintlapposisibrgdlmprosespdf">
		
			<iframe id="framelapposisibrgdlmproses" src="" frameborder="0" width="100%" height="370">
			</iframe>
		</div>
	</div>
	
<script type="text/javascript">	
	$(document).ready(function(){
	 	
		
        var currentDate = new Date(); 
		var datesetopt = {
			showOn: "button",
			buttonImageOnly: true,
			buttonImage: "<?php echo base_url()."assets/images/icons/16x16/timespan.png"  ?>",
			buttonText: "Tanggalan",
			dateFormat: 'dd/mm/yy'
		};
		$("#tglawallapposisibrgdlmproses").datepicker(datesetopt);
		$("#tglakhirlapposisibrgdlmproses").datepicker(datesetopt); 
		$("#divprintlapposisibrgdlmprosespdf").hide();
		$("#printlapposisibrgdlmprosessearch").button().click(function(){
			$("#divprintlapposisibrgdlmprosespdf").fadeOut();
			$("#divlapposisibrgdlmproses").fadeIn();
			var form_data = {
				'q':'1',
				'caritanggal':'ya',
				'tglawallapposisibrgdlmproses':$("#tglawallapposisibrgdlmproses").val(),
				'tglakhirlapposisibrgdlmproses':$("#tglakhirlapposisibrgdlmproses").val()
			};
			jQuery("#grdlaporanbarangdalamproses").jqGrid('setGridParam', { postData:form_data });
			$("#grdlaporanbarangdalamproses").trigger("reloadGrid");
		});
		$("#printlapposisibrgdlmprosepdf").button().click(function(){
			$("#add_progress").show();
			$("#divprintlapposisibrgdlmprosespdf").fadeIn();
			$("#divlapposisibrgdlmproses").fadeOut();
			$("#framelapposisibrgdlmproses").attr("src", "<?php echo base_url().'reports/ct_reportcustoms/data_data_wip'; ?>"+'?tglawallapposisibrgdlmproses='+$("#tglawallapposisibrgdlmproses").val()+'&tglakhirlapposisibrgdlmproses='+$("#tglakhirlapposisibrgdlmproses").val()+'&format=pdf').load(function(){
			
				$("#add_progress").hide();
			
			});
			
		});
		/* $("#printlapposisibrgdlmprosesrtf").button().click(function(){
			$("#framelapposisibrgdlmproses").attr("src", "<?php echo base_url().'reports/ct_reportcustoms/data_data_wip'; ?>"+'?tglawallapposisibrgdlmproses='+$("#tglawallapposisibrgdlmproses").val()+'&tglakhirlapposisibrgdlmproses='+$("#tglakhirlapposisibrgdlmproses").val()+'&format=rtf');
		}); */
		
		$("#printlapposisibrgdlmprosesrtf").button().click(function(){
			var form_data = {
				'q':'1',
				'caritanggal':'ya',
				'tglawallapposisibrgdlmproses':$("#tglawallapposisibrgdlmproses").val(),
				'tglakhirlapposisibrgdlmproses':$("#tglakhirlapposisibrgdlmproses").val()
			};
			document.location.href = '<?php echo base_url().'reports/ct_reportcustoms/printlaporanwipexcel'; ?>'+'?caritanggal=ya' + '&tglawallapposisibrgdlmproses='+form_data.tglawallapposisibrgdlmproses+'&tglakhirlapposisibrgdlmproses='+form_data.tglakhirlapposisibrgdlmproses
			
		});
		
		jQuery("#grdlaporanbarangdalamproses").jqGrid({
				url:'<?php echo base_url().'reports/ct_reportcustoms/loaddataposisibarangdalamproses'; ?>',
				datatype: "json",
				mtype: 'POST',
				postData:{'q':'1','caritanggal':'ya', 'tglawallapposisibrgdlmproses':$("#tglawallapposisibrgdlmproses").val(),'tglakhirlapposisibrgdlmproses':$("#tglakhirlapposisibrgdlmproses").val()},
				colNames:['No','Kode Barang', 'Nama Barang','Satuan','Jumlah','Keterangan'  ],
				colModel:[
					{name:'nomorurut',index:'nomorurut', width:43,  align:"center"},
					{name:'kodebrg',index:'kodebrg', width:146,  align:"left"},
					{name:'part_name_customs',index:'part_name_customs', width:204, align:"left"},
					{name:'satuan',index:'satuan', width:118},
					{name:'qty',index:'qty', width:82, align:"right"},
					{name:'keterangan',index:'keterangan', width:140}
				],  
				rowNum:10,
				rowList:[10,20,30],
				pager: '#pgrdlaporanbarangdalamproses',
				sortname: 'part_no',
				viewrecords: true,
				sortorder: "asc",
				width: 890,
				height:300,
				shrinkToFit: false,
				jsonReader: { repeatitems : false },
			    caption:"LAPORAN POSISI BARANG DALAM PROSES (WIP)",
			//	rownumbers: true,
			
			}); 
			
		jQuery("#grdlaporanbarangdalamproses").jqGrid('navGrid','#pgrdlaporanbarangdalamproses',{edit:false,add:false,del:false,view:true});
			
		
			
					    
		
	});
	</script>
	
	
</body>

</html> 
		

