<div style="height:10px;">

</div>
<h3><strong>Perhatian! Data Ini Akan Dijadikan 1 Nomor Pengajuan. Mohon Diteliti Datanya. KALO NANTI SALAH RIBET LHOOO...</strong></h3>
<h3><strong>PERHATIKAN NAMA PEMBELI NYA !!!</strong></h3>
<br />
<table id="listbc27"></table>
<br />
<span style="padding-left:640px"></span><button id="btnprosesdatabc27" >Proses Data</button>
<script type="text/javascript">
    
    $(document).ready(function(){
		$("#btnprosesdatabc27").button().click(function(){
			var gridData = jQuery("#listbc27").getRowData();
			var postData = JSON.stringify(gridData);
			var form_data={
				
				datadiff:postData
			};
			
		
			$("#dlgprosesbc27").dialog( "destroy" );
			$(".dlgprosesbc27_cl").remove();
			$(".dlgprosesbc27_cl").html('');
			$("body").append('<div id="dlgprosesbc27" title="Warning" class="dlgprosesbc27_cl"><p>Apakah anda akan Memproses Data ini Menjadi Data bc27?</p><br /></div>');
			$("#dlgprosesbc27").dialog({
				height: 200,
				width: 350,
				modal: true,
				hide: 'Slide',
				autoOpen: 'false',
				buttons: {
					"CONFIRM": function() {
					$.ajax({
						url : '<?php echo base_url().'exim/ct_bc27/proses_bc27_new'; ?>',
						type : 'POST',
						dataType: 'json',
						data : form_data,
						success: function(msg){
							if (msg.sts == '00'){
								alert(msg.desc);
								$("#dlgprosesbc27").dialog("close");
								$('#dlgprosesbc27').dialog("destroy"); 
								$(".dlgprosesbc27_cl").remove(); 
								$('#tblbc27loaddatahdr').trigger('reloadGrid');
								jQuery("#tblbc27hdr").trigger('reloadGrid');
							} else { 
								alert(msg.sts+msg.desc);
								$("#dlgprosesbc27").dialog("close");
								$('#dlgprosesbc27').dialog("destroy"); 
								$(".dlgprosesbc27_cl").remove(); 		

							}
						}
					});
				},
				"CANCEL": function() {
						$( "#dlgprosesbc27" ).dialog( "close" );

					}
				},
				close : function(){
					$('#dlgprosesbc27').dialog("destroy"); 
					$(".dlgprosesbc27_cl").remove(); 
					$("body").append('<div id="dlgprosesbc27" title="Warning" class="dlgprosesbc27_cl"><p>Apakah anda akan Memproses Data ini Menjadi Data bc27?</p></div>');     
					
				},
				open: function(){
					$("body").unblock();
					
				}
			});
			
		
		});
		
		jQuery("#listbc27").jqGrid({ 
			datatype: "local", 
			height: 150, 
			width:750,
			colNames:['id', 'Inv Name','NO INV','NilInv','NAMABELI', 'ALMTBELI'], 
			colModel:[ 
				{name:'idbc27hdr',index:'idbc27hdr', width:60, sorttype:"idbc27hdr", hidden:true}, 
				{name:'gabinvoice',index:'gabinvoice', width:260},
				{name:'NOINV',index:'NOINV', width:160},
				{name:'NilInv',index:'NilInv', width:100, align:'right'},
				{name:'NAMABELI',index:'NAMABELI', width:160},
				{name:'ALMTBELI',index:'ALMTBELI', width:460},
			], 
			shrinkToFit: false,
		});
		var mydata = <?php echo $json; ?>;
		for(var i=0;i<=mydata.length;i++) jQuery("#listbc27").jqGrid('addRowData',i+1,mydata[i]);
	});
		  	
</script>





	
	