<div style="height:40px;">
	<button id="btngetlistitem" style="color:#FF0000;" >Get Item List</button>
	
</div>
<table id="tbl_bbitemlist_dtl"></table> <div id="ptbl_bbitemlist_dtl"></div>
<script type="text/javascript">
    
    $(document).ready(function(){
	
		$("#btngetlistitem").button().click(function(){
			$("#dlgdatalistitem").dialog( "destroy" );
			$(".dlgdatalistitem_cl").remove();
			$("body").append('<div id="dlgdatalistitem" title="Warning" class="dlgdatalistitem_cl"><p>Apakah anda akan Memproses Data  Menjadi ITEM LIST?</p><br /></div>');
			$("#dlgdatalistitem").dialog({
				height: 200,
				width: 350,
				modal: true,
				hide: 'Slide',
				autoOpen: 'false',
				buttons: {
					"CONFIRM": function() {
					$.ajax({
						url : "<?php echo base_url().'settings/ct_barangbahanbaku/getdataitemlist'; ?>",
						type : 'POST',
						dataType: 'json',
						data : {test:'test'},
						success: function(msg){
							if (msg.sts == '00'){
								alert(msg.desc);
								$("#dlgdatalistitem").dialog("close");
								$('#dlgdatalistitem').dialog("destroy"); 
								$(".dlgdatalistitem_cl").remove(); 
								$('#tbl_bbitemlist_dtl').trigger('reloadGrid');
							} else { 
								alert(msg.sts+msg.desc);
								$("#dlgdatalistitem").dialog("close");
								$('#dlgdatalistitem').dialog("destroy"); 
								$(".dlgdatalistitem_cl").remove(); 		

							}
						}
					});
				},
				"CANCEL": function() {
						$( "#dlgdatalistitem" ).dialog( "close" );
						$(".dlgdatalistitem_cl").remove();

					}
				},
				close : function(){
					$('#dlgdatalistitem').dialog("destroy"); 
					$(".dlgdatalistitem_cl").remove(); 
					$("body").append('<div id="dlgdatalistitem" title="Warning" class="dlgdatalistitem_cl"><p>Apakah anda akan Memproses Data  Menjadi Data Part HS?</p></div>');     
					
				},
				open: function(){
					$("body").unblock();
					
				}
			});
		
			
		});
		jQuery("#tbl_bbitemlist_dtl").jqGrid({
			url:'<?php echo base_url().'settings/ct_barangbahanbaku/data_bahanbaku_itemlist'; ?>',
			mtype : "post",
			postData:{'q':'1'},
			datatype: "json",
			colNames:['id_item_list'
		  ,'PART NO'
		  ,'PART NAME'
		  ,'CUST PNO'
		  ,'CUST NAME'
		  ,'SUPP PNO'
		  ,'SUPP CODE'
		  ,'PCT SUP'
		  ,'BAL FAC'
		  ,'WEIGTH'
		  ,'ASS STAGE'
		  ,'MIN PACK'
		  ,'UNIT'
		  ,'CURRENCY'
		  ,'WASTE'
		  ,'ORG_CTRY'
		  ,'SUPP_STAT'
		  ,'CLASS'
		  ,'LOCATION'
		  ,'MIN_ORDQTY'
		  ,'BEG_BAL'
		  ,'TOTAL_IN'
		  ,'TOTAL_OUT'
		  ,'CUMM_REQ'
		  ,'CUMM_IN'
		  ,'PART_CODE'
		  ,'QTY1BOXROL'
		  ,'QTY1PALLET'
		  ,'FOB'
		  ,'CIF'
		  ,'FOBNI'
		  ,'CIFNI'
		  ,'QUOTEFOB'
		  ,'QUOTECIF'
		  ,'QUOTEFOBNI'
		  ,'QUOTECIFNI'
		  ,'QUOTE_CURR'
		  ,'NFOB'
		  ,'NCIF'
		  ,'NFOBNI'
		  ,'NCIFNI'
		  ,'NQUOTEFOB'
		  ,'NQUOTECIF'
		  ,'NQUOTEFOBNI'
		  ,'NQUOTECIFNI'
		  ,'FINAL_PRE'
		  ,'PARTNO2'
		  ,'PERIODE'
		  ,'PERIODE1'
		  ,'PRICE'
		  ,'SUPP_NAME'
		  ,'AMOUNT'
		  ,'COST'
		  ,'FREIGHT'
		  ,'INVOICE'
		  ,'FLAG'
		  ,'NFLAG'
		  ,'MAKER_CODE'
		  ,'RACK_LOC'
		  ,'CREATED_BY'
		  ,'CREATED_DATE'
		  ,'MODIFIED_BY'
		  ,'MODIFIED_DATE'
		  ,'NON_GSP_STATUS'
		  ,'COMODITY_CODE'
		  ,'PARTNO3'
		  ,'filename'
		  ,'execdate'],
			colModel:[
			{name:'id_item_list',index:'id_item_list', width:60, hidden:true},
			{name:'PART_NO',index:'PART_NO', width:101, hidden:false},
			{name:'PART_NAME',index:'PART_NAME', width:165, hidden:false},
			{name:'CUST_PNO',index:'CUST_PNO', width:96, hidden:false},
			{name:'CUST_NAME',index:'CUST_NAME', width:148, hidden:false},
			{name:'SUPP_PNO',index:'SUPP_PNO', width:99, hidden:false},
			{name:'SUPP_CODE',index:'SUPP_CODE', width:60, hidden:false},
			{name:'PCT_SUP',index:'PCT_SUP', width:60, hidden:true},
			{name:'BAL_FAC',index:'BAL_FAC', width:60, hidden:true},
			{name:'WEIGTH',index:'WEIGTH', width:60, hidden:false},
			{name:'ASS_STAGE',index:'ASS_STAGE', width:60, hidden:true},
			{name:'MIN_PACK',index:'MIN_PACK', width:60, hidden:false},
			{name:'UNIT',index:'UNIT', width:60, hidden:false},
			{name:'CURRENCY',index:'CURRENCY', width:60, hidden:false},
			{name:'WASTE',index:'WASTE', width:60, hidden:false},
			{name:'ORG_CTRY',index:'ORG_CTRY', width:60, hidden:false},
			{name:'SUPP_STAT',index:'SUPP_STAT', width:60, hidden:true},
			{name:'clas',index:'clas', width:60, hidden:true},
			{name:'LOCATION',index:'LOCATION', width:60, hidden:true},
			{name:'MIN_ORDQTY',index:'MIN_ORDQTY', width:60, hidden:true},
			{name:'BEG_BAL',index:'BEG_BAL', width:60, hidden:true},
			{name:'TOTAL_IN',index:'TOTAL_IN', width:60, hidden:true},
			{name:'TOTAL_OUT',index:'TOTAL_OUT', width:60, hidden:true},
			{name:'CUMM_REQ',index:'CUMM_REQ', width:60, hidden:true},
			{name:'CUMM_IN',index:'CUMM_IN', width:60, hidden:true},
			{name:'PART_CODE',index:'PART_CODE', width:60, hidden:true},
			{name:'QTY1BOXROL',index:'QTY1BOXROL', width:60, hidden:true},
			{name:'QTY1PALLET',index:'QTY1PALLET', width:60, hidden:true},
			{name:'FOB',index:'FOB', width:60, hidden:false},
			{name:'CIF',index:'CIF', width:60, hidden:false},
			{name:'FOBNI',index:'FOBNI', width:60, hidden:false},
			{name:'CIFNI',index:'CIFNI', width:60, hidden:false},
			{name:'QUOTEFOB',index:'QUOTEFOB', width:60, hidden:false},
			{name:'QUOTECIF',index:'QUOTECIF', width:60, hidden:false},
			{name:'QUOTEFOBNI',index:'QUOTEFOBNI', width:60, hidden:false},
			{name:'QUOTECIFNI',index:'QUOTECIFNI', width:60, hidden:false},
			{name:'QUOTE_CURR',index:'QUOTE_CURR', width:60, hidden:false},
			{name:'NFOB',index:'NFOB', width:60, hidden:false},
			{name:'NCIF',index:'NCIF', width:60, hidden:false},
			{name:'NFOBNI',index:'NFOBNI', width:60, hidden:false},
			{name:'NCIFNI',index:'NCIFNI', width:60, hidden:false},
			{name:'NQUOTEFOB',index:'NQUOTEFOB', width:60, hidden:false},
			{name:'NQUOTECIF',index:'NQUOTECIF', width:60, hidden:false},
			{name:'NQUOTEFOBNI',index:'NQUOTEFOBNI', width:60, hidden:false},
			{name:'NQUOTECIFNI',index:'NQUOTECIFNI', width:60, hidden:false},
			{name:'FINAL_PRE',index:'FINAL_PRE', width:60, hidden:true},
			{name:'PARTNO2',index:'PARTNO2', width:112, hidden:false},
			{name:'PERIODE',index:'PERIODE', width:60, hidden:true},
			{name:'PERIODE1',index:'PERIODE1', width:60, hidden:true},
			{name:'PRICE',index:'PRICE', width:60, hidden:true},
			{name:'SUPP_NAME',index:'SUPP_NAME', width:60, hidden:true},
			{name:'AMOUNT',index:'AMOUNT', width:60, hidden:true},
			{name:'COST',index:'COST', width:60, hidden:true},
			{name:'FREIGHT',index:'FREIGHT', width:60, hidden:true},
			{name:'INVOICE',index:'INVOICE', width:60, hidden:true},
			{name:'FLAG',index:'FLAG', width:60, hidden:true},
			{name:'NFLAG',index:'NFLAG', width:60, hidden:true},
			{name:'MAKER_CODE',index:'MAKER_CODE', width:60, hidden:true},
			{name:'RACK_LOC',index:'RACK_LOC', width:60, hidden:true},
			{name:'CREATED_BY',index:'CREATED_BY', width:60, hidden:true},
			{name:'CREATED_DATE',index:'CREATED_DATE', width:60, hidden:true},
			{name:'MODIFIED_BY',index:'MODIFIED_BY', width:60, hidden:true},
			{name:'MODIFIED_DATE',index:'MODIFIED_DATE', width:60, hidden:true},
			{name:'NON_GSP_STATUS',index:'NON_GSP_STATUS', width:60, hidden:true},
			{name:'COMODITY_CODE',index:'COMODITY_CODE', width:60, hidden:true},
			{name:'PARTNO3',index:'PARTNO3', width:60, hidden:true},
			{name:'filename',index:'filename', width:260, hidden:true},
			{name:'execdate',index:'execdate', width:60, hidden:true},
				
			],
			rowNum:10,
			rowList:[10,20,30,40,50,60],
			pager: '#ptbl_bbitemlist_dtl',
			sortname: 'id_item_list',
			viewrecords: true,
			sortorder: "asc",
			width: 980,
			height:280,
			jsonReader: { repeatitems : false },
			caption:"DATA ITEM LOADED",
			rownumbers: true,
			shrinkToFit: false,
			afterInsertRow: function(){
				
				
			}
		}); 
		
		jQuery("#tbl_bbitemlist_dtl").jqGrid('navGrid','#ptbl_bbitemlist_dtl',{del:false,add:false,edit:false},{},{},{},{multipleSearch:false});
		jQuery("#tbl_bbitemlist_dtl").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : false, defaultSearch: 'cn', ignoreCase: true});
		

	});
		  	
</script>



	
	