<?php
//error_reporting(E_ALL ^ E_NOTICE);
/* require_once 'excel_reader2.php';
$data = new Spreadsheet_Excel_Reader("stock_awal.xls"); */
?>

<style>
table.excel {
	border-style:ridge;
	border-width:1;
	border-collapse:collapse;
	font-family:sans-serif;
	font-size:12px;
}
table.excel thead th, table.excel tbody th {
	background:#CCCCCC;
	border-style:ridge;
	border-width:1;
	text-align: center;
	vertical-align:bottom;
}
table.excel tbody th {
	text-align:center;
	width:20px;
}
table.excel tbody td {
	vertical-align:bottom;
}
table.excel tbody td {
    padding: 0 3px;
	border: 1px solid #EEEEEE;
}
</style>


	
	<div id="divtabbahanpenolong_data_bc_in" >
		<div style="height:40px">
			Periode : <input type="text" id="txt_tgl_awal_bp_bc_in" value="<?php echo date("Y-m-d") ?>" style="width:80px"/> sampai  
			<input type="text" id="txt_tgl_akhir_bp_bc_in" value="<?php echo date("Y-m-d") ?>" style="width:80px"/> 
			<button id="btnsearch_bp_bc_in" >SEARCH</button>
			<button id="btndownload_bp_bc_in" >DL Data</button>
		</div>
		<table id="tbl_data_bp_bc_in"></table> <div id="ptbl_data_bp_bc_in"></div>
	</div>
	
<script type="text/javascript">
    
    $(document).ready(function(){
	//	$("#tabbahanpenolong_stockawal").tabs();
		var currentDate = new Date(); 
		var datesetopt = {
			showOn: "button",
			buttonImageOnly: true,
			buttonImage: "<?php echo base_url()."assets/images/icons/16x16/timespan.png"  ?>",
			buttonText: "Tanggalan",
			dateFormat: 'yy-mm-dd'
		};
		
		$("#txt_tgl_awal_bp_bc_in").datepicker(datesetopt);
		$("#txt_tgl_akhir_bp_bc_in").datepicker(datesetopt); 	
		
		$("#btnsearch_bp_bc_in").button().click(function(){
			var form_data={
				tglawal:$("#txt_tgl_awal_bp_bc_in").val(), tglakhir:$("#txt_tgl_akhir_bp_bc_in").val()
			};
			jQuery("#tbl_data_bp_bc_in").jqGrid('setGridParam', { postData:form_data });
			$("#tbl_data_bp_bc_in").trigger("reloadGrid");
			
		
		});
		
		jQuery("#tbl_data_bp_bc_in").jqGrid({
			url:'<?php echo base_url().'settings/ct_barangbahanpenolong/v_data_bp_in_All'; ?>',
			mtype : "post",
			postData:{'q':'1',tglawal:$("#txt_tgl_awal_bp_bc_in").val(), tglakhir:$("#txt_tgl_akhir_bp_bc_in").val()},
			datatype: "json",
			colNames:['id_data_in_dtl','id_data_in_hdr','id_bc_in_hdr','kode_barang', 'part_name_customs', 'part_no', 'qty_in'
					,'doc_in_no','doc_in_date','CAR','BC23No','BC23Tg'
					,'typedok','PasokNama','PasokAlmt'],
			colModel:[
				{name:'id_data_in_dtl',index:'id_data_in_dtl', width:139, hidden:true},
				{name:'id_data_in_hdr',index:'id_data_in_hdr', width:139, hidden:true},
				{name:'id_bc_in_hdr',index:'id_bc_in_hdr', width:139, hidden:true},
				{name:'kode_barang',index:'kode_barang', width:139, hidden:false},
				{name:'part_name_customs',index:'part_name_customs', width:139, hidden:false},
				{name:'part_no',index:'part_no', width:139, hidden:false},
				{name:'qty_in',index:'qty_in', width:77, hidden:false, align:'right'},
				{name:'doc_in_no',index:'doc_in_no', width:139, hidden:false},
				{name:'doc_in_date',index:'doc_in_date', width:139, hidden:false},
				{name:'CAR',index:'CAR', width:139, hidden:false},
				{name:'BC23No',index:'BC23No', width:139, hidden:false},
				{name:'BC23Tg',index:'BC23Tg', width:139, hidden:false},
				{name:'typedok',index:'typedok', width:139, hidden:false},
				{name:'PasokNama',index:'PasokNama', width:139, hidden:false},
				{name:'PasokAlmt',index:'PasokAlmt', width:139, hidden:false}
				
			],
			rowNum:10,
			rowList:[10,20,30],
			pager: '#ptbl_data_bp_bc_in',
			sortname: 'id_data_in_dtl',
			viewrecords: true,
			sortorder: "desc",
			width: '',
			height:300,
			jsonReader: { repeatitems : false },
			caption:"DATA ITEM INCOMING",
			rownumbers: true,
			shrinkToFit: false,
			afterInsertRow: function(){
				
				
			},
			onSelectRow: function(id){
				var stret = jQuery("#tbl_data_bp_bc_in").jqGrid('getRowData',id);
				
				
			} 
		}); 
		
		jQuery("#tbl_data_bp_bc_in").jqGrid('navGrid','#ptbl_data_bp_bc_in',{del:false,add:false,edit:false},{},{},{},{multipleSearch:false});
		jQuery("#tbl_data_bp_bc_in").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : true, defaultSearch: 'cn', ignoreCase: true});
		
		
		$("#btndownload_bp_bc_in").button().click(function(){
		
		});

	});
		  	
</script>



	
	