<?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="tabalatkantor_data_27_upload" style="height:500px">
	<ul>
		<li><a id="idtabalatkantor_data_27_upload" href="#divtabalatkantor_data_27_upload">Upload Data BC27 Bahan Penolong</a></li>		
		<li><a id="idtabalatkantor_data_27_in" href="#divtabalatkantor_data_27_in">Data BC27 IN</a></li>

	</ul>
	<div id="divtabalatkantor_data_27_upload" >
		<div style="height:10px;">
		</div>
	  Upload File Excel Bahan Penolong BC 27
	   <form method="post" action="" id="upload_file_ak_bc27_in">
		  <label for="userfile_ak_bc27_in">File</label>
		  <input type="file" name="userfile_ak_bc27_in" id="userfile_ak_bc27_in" size="40" />
		  <input type="submit" name="submit" id="submit" value="Upload" /><button id="btn_ak_bc27_upload_delete">Delete</button><button id="btn_ak_proses_27_in">Proses</button>
	   </form>Files:<span id="files_ak_bc27_upload" style="font-weight:bold;font-size:10px;"></span>
	   <hr>
	   <table id="tbl_view_upload_data_ak_bc27"></table> <div id="ptbl_view_upload_data_ak_bc27"></div>   
		
		
	</div>
	
	<div id="divtabalatkantor_data_27_in" >
		<div style="height:40px">
			Periode : <input type="text" id="txt_tgl_awal_ak_bc_bc27_in" value="<?php echo date("Y-m-d") ?>" style="width:80px"/> sampai  
			<input type="text" id="txt_tgl_akhir_ak_bc_bc27_in" value="<?php echo date("Y-m-d") ?>" style="width:80px"/> 
			<button id="btnsearch_ak_bc_bc27_in" >SEARCH</button>
			<button id="btn_ak_bc_bc27_in_proses" >PROSES BC</button>
			<button id="btn_ak_bc_bc27_in_update" >UPDATE</button>
			<button id="btn_ak_bc_bc27_in_delete" >DELETE</button>
		</div>
		<table id="data_alatkantor_bc27_in"></table> <div id="pdata_alatkantor_bc27_in"></div>   
		
	</div>
	
</div>
<script type="text/javascript">
    
    $(document).ready(function(){
		$("#tabalatkantor_data_27_upload").tabs();
				
		
		
		function refresh_files()
		{
		   $.get('<?php echo base_url().'loaderfiles/exim/bc27_ak'; ?>') 
		   .success(function (data){
		   	  $('#files_ak_bc27_upload').html(data);
		   });
		};
		$('#userfile_ak_bc27_in').live('change', function(){
			$('#files_ak_bc27_upload').html('<p>'+ $('#userfile_ak_bc27_in').val() +'</p>'); 
		});
		jQuery.extend({
			handleError: function( s, xhr, status, e ) {
			// If a local callback was specified, fire it
				if ( s.error )
					s.error( xhr, status, e );
				// If we have some XML response text (e.g. from an AJAX call) then log it in the console
				else if(xhr.responseText)
					console.log(xhr.responseText);
			}
		});
		$(function() {
			$('#upload_file_ak_bc27_in').submit(function(e) {
				e.preventDefault();
				$.ajaxFileUpload({
				 url         :'./exim/ct_bc271/upload_file_bc27_ak/',
				 secureuri      :false,
				 fileElementId  :'userfile_ak_bc27_in',
				 dataType    : 'json',
				 data        : {
					'userfile_ak_bc27_in'  : $('#userfile_ak_bc27_in').val()
				 },
				 success  : function (data, status)
				 {
					if(data.status != 'error')
					{
					   $('#files_ak_bc27_upload').html('<p style=""color:red">Upload File Sukses...'+ $('#userfile_ak_bc27_in').val() +'</p>'); 
					   
					 
					}
					jQuery("#tbl_view_upload_data_ak_bc27").trigger('reloadGrid');
					jQuery("#tbl_data_ak_bc_out_ct").trigger('reloadGrid');
					alert(data.msg);
					return false;
				 }
		  });
		  return false;
		   });
		});
		
		var datePick = function (el) {
			$(el).datepicker({
				changeYear: true,
				changeMonth: true,
				showButtonPanel: true,
				onSelect: function () {
					
					if (this.id.substr(0, 3) === "gs_") {
                // in case of searching toolbar
					setTimeout(function(){
					jQuery("#tbl_view_upload_data_ak_bc27").jqGrid()[0].triggerToolbar();
						}, 50);
					} else {
						// refresh the filter in case of
						// searching dialog
						$(this).trigger('change');
					}
				}    
			});
		};
		
		
		$("#btn_ak_bc27_upload_delete").click(function(){
			var id = jQuery("#tbl_view_upload_data_ak_bc27").jqGrid('getGridParam','selrow');
			if (id) { 
				var ret = jQuery("#tbl_view_upload_data_ak_bc27").jqGrid('getRowData',id);
				
			} else {
				alert("Please Select Row");
				return false;
			};	
			var form_data = {
				id_upload_ak_bc27_upload:ret.id_upload_ak_bc27_upload,
				filename:ret.filename,
				filepath:ret.filepath,
				tipe:ret.tipe
			
			};
			
			if(ret.status_upload != 'SUKSES' ){
				alert("DATA SUDAH DI PROSES");
				return false;
			} 
			
			$("#dlgdeletefile_ak_in_bc27").dialog( "destroy" );
			$(".dlgdeletefile_ak_in_bc27cl").remove();
			$("body").append('<div id="dlgdeletefile_ak_in_bc27" title="Warning" class="dlgdeletefile_ak_in_bc27cl"><p>Apakah anda akan mendelete file ini?!?</p><br /> file = '+ ret.filename +'</div>');
			$("#dlgdeletefile_ak_in_bc27").dialog({
				height: 200,
				width: 250,
				modal: true,
				hide: 'Slide',
				autoOpen: 'false',
				buttons: {
					"CONFIRM": function() {
					$.ajax({
						url : "<?php echo base_url().'exim/ct_bc271/delete_uploadalatkantor'; ?>",
						type : 'POST',
						dataType: 'json',
						data : form_data,
						success: function(msg){
							if (msg.sts == '00'){
								alert(msg.desc);
								$("#dlgdeletefile_ak_in_bc27").dialog("close");
								$('#dlgdeletefile_ak_in_bc27').dialog("destroy"); 
								$(".dlgdeletefile_ak_in_bc27cl").remove(); 
								$('#tbl_view_upload_data_ak_bc27').trigger('reloadGrid');
								$('#tbl_data_ak_bc_out_ct').trigger('reloadGrid');
							} else { 
								alert(msg.sts+' '+msg.desc); 
								$("#dlgdeletefile_ak_in_bc27").dialog("close");
								$('#dlgdeletefile_ak_in_bc27').dialog("destroy"); 
								$(".dlgdeletefile_ak_in_bc27cl").remove(); 

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

					}
				},
				close : function(){
					$('#dlgdeletefile_ak_in_bc27').dialog("destroy"); 
					$(".dlgdeletefile_ak_in_bc27cl").remove(); 
					$("body").append('<div id="dlgdeletefile_ak_in_bc27" title="Warning" class="dlgdeletefile_ak_in_bc27cl"><p>Apakah anda akan mendelete file ini?!?</p></div>');     
					
				},
				open: function(){
					$("body").unblock();
					
				}
			});
		
		});
		
		
			
		
		
		jQuery("#tbl_view_upload_data_ak_bc27").jqGrid({
			url:'<?php echo base_url().'exim/ct_bc271/data_uploadalatkantor_bc27'; ?>',
			mtype : "post",
			postData:{'q':'1',tipe_ak:function(){ return 'AK27'; }},
			datatype: "json",
			colNames:['ID','filename', 'date upload','status upload', 'tipe', 'create date', 'create by', 'filepath'],
			colModel:[
				{name:'id_upload_ak_bc27_upload',index:'id_upload_ak_bc27_upload', width:60, hidden:true},
				{name:'filename',index:'filename', width:160},
				{name:'date_upload',index:'date_upload', width:166,stype:"text",searchoptions:{dataInit:datePick, att:{title:'Select Date'}}},
				{name:'status_upload',index:'status_upload', width:106},
				{name:'tipe',index:'tipe', width:106},
				{name:'create_date',index:'create_date', width:166, hidden:false,stype:"text",searchoptions:{dataInit:datePick, att:{title:'Select Date'}}},
				{name:'create_by',index:'create_by', width:106, hidden:false},
				{name:'filepath',index:'filepath', width:160, hidden:true}
				
			
				],
			rowNum:10,
			rowList:[10,20,30],
			pager: '#ptbl_view_upload_data_ak_bc27',
			sortname: 'id_upload_ak_bc27_upload',
			viewrecords: true,
			sortorder: "desc",
			width: '',
			height:290,
			jsonReader: { repeatitems : false },
			caption:"DATA UPLOAD BP BC27",
			rownumbers: true,
			shrinkToFit: false,
			afterInsertRow: function(){
				
				
			},			
			gridComplete: function(){
				var rowIDs = jQuery("#tbl_view_upload_data_ak_bc27").getDataIDs(); 
				var rowData = $("#tbl_view_upload_data_ak_bc27").getRowData();
			
				for (var i = 0; i < rowData.length; i++) 
				{
				   var trElement = jQuery("#"+ rowIDs[i],jQuery('#tbl_view_upload_data_ak_bc27'));
				   
					switch (rowData[i].status_upload) {
						
						case 'cancel':
						   trElement.css({"color":"green"});
						break;
						case 'Deleted':
						   trElement.css({"color":"red", "text-decoration": "line-through"});
						break;
						case 'DATA PROCESSED':
						   trElement.css({"color":"blue"});
						break;
						
						
					}
				}
			},
		}); 
		
		jQuery("#tbl_view_upload_data_ak_bc27").jqGrid('navGrid','#ptbl_view_upload_data_ak_bc27',{del:false,add:false,edit:false},{},{},{},{multipleSearch:false});
		jQuery("#tbl_view_upload_data_ak_bc27").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : false, defaultSearch: 'cn', ignoreCase: true});
		
		$("#btn_ak_proses_27_in").click(function(){
			var id = jQuery("#tbl_view_upload_data_ak_bc27").jqGrid('getGridParam','selrow');
			if (id) { 
				var ret = jQuery("#tbl_view_upload_data_ak_bc27").jqGrid('getRowData',id);
				
			} else {
				alert("Please Select Row");
				return false;
			};	
			var form_data = {
				id_upload_ak_bc27_upload:ret.id_upload_ak_bc27_upload,
				filename:ret.filename,
				filepath:ret.filepath,
				tipe:ret.tipe
			
			};
			
			if(ret.status_upload != 'SUKSES' ){
				alert("DATA SUDAH DI PROSES");
				return false;
			} 
			
			$("#dlgprosesfile_ak_in_bc27_").dialog( "destroy" );
			$(".dlgprosesfile_ak_in_bc27_cl").remove();
			$("body").append('<div id="dlgprosesfile_ak_in_bc27_" title="Warning" class="dlgprosesfile_ak_in_bc27_cl"><p>Apakah anda akan meproses file ini?!?</p><br /> file = '+ ret.filename +'</div>');
			$("#dlgprosesfile_ak_in_bc27_").dialog({
				height: 200,
				width: 250,
				modal: true,
				hide: 'Slide',
				autoOpen: 'false',
				buttons: {
					"CONFIRM": function() {
					$.ajax({
						url : "<?php echo base_url().'exim/ct_bc271/prosesfile_ak_bc27_in'; ?>",
						type : 'POST',
						dataType: 'json',
						data : form_data,
						success: function(msg){
							if (msg.sts == '00'){
								alert(msg.desc);
								$("#dlgprosesfile_ak_in_bc27_").dialog("close");
								$('#dlgprosesfile_ak_in_bc27_').dialog("destroy"); 
								$(".dlgprosesfile_ak_in_bc27_cl").remove(); 
								$('#tbl_view_upload_data_ak_bc27').trigger('reloadGrid');
							} else { 
								alert(msg.sts+' '+msg.desc); 
								$("#dlgprosesfile_ak_in_bc27_").dialog("close");
								$('#dlgprosesfile_ak_in_bc27_').dialog("destroy"); 
								$(".dlgprosesfile_ak_in_bc27_cl").remove(); 

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

					}
				},
				close : function(){
					$('#dlgprosesfile_ak_in_bc27_').dialog("destroy"); 
					$(".dlgprosesfile_ak_in_bc27_cl").remove(); 
					$("body").append('<div id="dlgprosesfile_ak_in_bc27_" title="Warning" class="dlgprosesfile_ak_in_bc27_cl"><p>Apakah anda akan mendelete file ini?!?</p></div>');     
					
				},
				open: function(){
					$("body").unblock();
					
				}
			});
			
		});
		
		jQuery("#data_alatkantor_bc27_in").jqGrid({
			url:'<?php echo base_url().'exim/ct_bc271/data_alatkantor_bc27_in'; ?>',
			mtype : "post",
			postData:{'q':'1',tglawal:$("#txt_tgl_awal_ak_bc_bc27_in").val(), tglakhir:$("#txt_tgl_akhir_ak_bc_bc27_in").val(), doc_out_to:function(){ return '2';} },
			datatype: "json",
			colNames:['id_ak_27_in','no_bc','tgl_bc', 'no_doc_in', 'doc_in_date', 'kode_pengirim'
					,'nama_pengirim','kode_barang','nama_barang','jumlah','satuan','kdval'
					,'nilai_barang','bruto','jm_kemas','jn_kemas','no_invoice','tgl_inv','status_data','create_by','create_date'],
			colModel:[
				{name:'id_ak_27_in',index:'id_ak_27_in', width:139, hidden:true},
				{name:'no_bc',index:'no_bc', width:100, hidden:false},
				{name:'tgl_bc',index:'tgl_bc', width:90, hidden:false},
				{name:'no_doc_in',index:'no_doc_in', width:100, hidden:false},
				{name:'doc_in_date',index:'doc_in_date', width:90, hidden:false},
				{name:'kode_pengirim',index:'kode_pengirim', width:77, hidden:false},
				{name:'nama_pengirim',index:'nama_pengirim', width:137, hidden:false},
				{name:'kode_barang',index:'kode_barang', width:90, hidden:false},
				{name:'nama_barang',index:'nama_barang', width:139, hidden:false},
				{name:'jumlah',index:'jumlah', width:90, hidden:false, align:'right'},
				{name:'satuan',index:'satuan', width:90, hidden:false},
				{name:'kdval',index:'kdval', width:80, hidden:false},
				{name:'nilai_barang',index:'nilai_barang', width:100, hidden:false, align:'right'},
				{name:'bruto',index:'bruto', width:90, hidden:false, align:'right'},
				{name:'jm_kemas',index:'jm_kemas', width:80, hidden:false, align:'right'},
				{name:'jn_kemas',index:'jn_kemas', width:90, hidden:false},
				{name:'no_invoice',index:'no_invoice', width:90, hidden:false},
				{name:'tgl_inv',index:'tgl_inv', width:90, hidden:false},
				{name:'status_data',index:'status_data', width:90, hidden:false},
				{name:'create_by',index:'create_by', width:90, hidden:false},
				{name:'create_date',index:'create_date', width:90, hidden:false}
			],
			rowNum:100,
			rowList:[100,200,300],
			pager: '#pdata_alatkantor_bc27_in',
			sortname: 'id_ak_27_in',
			viewrecords: true,
			sortorder: "desc",
			width: 950,
			height:300,
			jsonReader: { repeatitems : false },
			caption:"DATA ITEM OUT",
			rownumbers: true,
			shrinkToFit: false,
			afterInsertRow: function(){
				
				
			},
			onSelectRow: function(id){
				var stret = jQuery("#data_alatkantor_bc27_in").jqGrid('getRowData',id);
				
				
			},			
			gridComplete: function(){
				var rowIDs = jQuery("#data_alatkantor_bc27_in").getDataIDs(); 
				var rowData = $("#data_alatkantor_bc27_in").getRowData();
			
				for (var i = 0; i < rowData.length; i++) 
				{
				   var trElement = jQuery("#"+ rowIDs[i],jQuery('#data_alatkantor_bc27_in'));
				   
					switch (rowData[i].status_data) {
						
						case 'DATA PROCESSED':
						   trElement.css({"color":"green"});
						break;
						case 'CANCEL':
						   trElement.css({ "text-decoration": "line-through"});
						break;
						
						
					}
				}
			}, 
		}); 
		
		jQuery("#data_alatkantor_bc27_in").jqGrid('navGrid','#pdata_alatkantor_bc27_in',{del:false,add:false,edit:false},{},{},{},{multipleSearch:false});
		jQuery("#data_alatkantor_bc27_in").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : true, defaultSearch: 'cn', ignoreCase: true});
		
		$("#btnsearch_ak_bc_bc27_in").button().click(function(){
			
			
		});
		
		$("#btn_ak_bc_bc27_in_proses").button().click(function(){
			var id = jQuery("#data_alatkantor_bc27_in").jqGrid('getGridParam','selrow');
			if (id) { 
				var ret = jQuery("#data_alatkantor_bc27_in").jqGrid('getRowData',id);
				
			} else {
				alert("Please Select Row");
				return false;
			};	
			var form_data = {
				id_ak_27_in:ret.id_ak_27_in,
				no_bc:ret.no_bc,
				tgl_bc:ret.tgl_bc,
				kode_pengirim:ret.kode_pengirim,
				command:'PROSES'
			
			};
			
			if(ret.status_data != 'DATA BARU' ){
				alert("DATA SUDAH DI PROSES");
				return false;
			} 
			
			$("#dlg_proses_bc_data_ak_bc27").dialog( "destroy" );
			$(".dlg_proses_bc_data_ak_bc27cl").remove();
			$("body").append('<div id="dlg_proses_bc_data_ak_bc27" title="Warning" class="dlg_proses_bc_data_ak_bc27cl"><p>Apakah anda akan mendelete data ini?!?</p><br /> <b>NO BC</b> = '+ ret.no_bc + ' TGL: ' + ret.tgl_bc +'</div>');
			$("#dlg_proses_bc_data_ak_bc27").dialog({
				height: 200,
				width: 250,
				modal: true,
				hide: 'Slide',
				autoOpen: 'false',
				buttons: {
					"CONFIRM": function() {
					$.ajax({
						url : "<?php echo base_url().'exim/ct_bc271/proses_bc_ak_27'; ?>",
						type : 'POST',
						dataType: 'json',
						data : form_data,
						success: function(msg){
							if (msg.sts == '00'){
								alert(msg.desc);
								$("#dlg_proses_bc_data_ak_bc27").dialog("close");
								$('#dlg_proses_bc_data_ak_bc27').dialog("destroy"); 
								$(".dlg_proses_bc_data_ak_bc27cl").remove(); 
								$('#data_alatkantor_bc27_in').trigger('reloadGrid');
								$('#tblbc271hdr').trigger('reloadGrid');
								
							} else { 
								alert(msg.sts+' '+msg.desc); 
								$("#dlg_proses_bc_data_ak_bc27").dialog("close");
								$('#dlg_proses_bc_data_ak_bc27').dialog("destroy"); 
								$(".dlg_proses_bc_data_ak_bc27cl").remove(); 

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

					}
				},
				close : function(){
					$('#dlg_proses_bc_data_ak_bc27').dialog("destroy"); 
					$(".dlg_proses_bc_data_ak_bc27cl").remove(); 
					$("body").append('<div id="dlg_proses_bc_data_ak_bc27" title="Warning" class="dlg_proses_bc_data_ak_bc27cl"><p>Apakah anda akan mendelete file ini?!?</p></div>');     
					
				},
				open: function(){
					$("body").unblock();
					
				}
			});
			
		});
		
		$("#btn_ak_bc_bc27_in_update").button().click(function(){
			
			
		});
		
		$("#btn_ak_bc_bc27_in_delete").button().click(function(){
			var id = jQuery("#data_alatkantor_bc27_in").jqGrid('getGridParam','selrow');
			if (id) { 
				var ret = jQuery("#data_alatkantor_bc27_in").jqGrid('getRowData',id);
				
			} else {
				alert("Please Select Row");
				return false;
			};	
			var form_data = {
				id_ak_27_in:ret.id_ak_27_in,
				command:'DELETE'
			
			};
			
			if(ret.status_data != 'DATA BARU' ){
				alert("DATA SUDAH DI PROSES");
				return false;
			} 
			
			$("#dlgdelete_data_ak_bc27").dialog( "destroy" );
			$(".dlgdelete_data_ak_bc27cl").remove();
			$("body").append('<div id="dlgdelete_data_ak_bc27" title="Warning" class="dlgdelete_data_ak_bc27cl"><p>Apakah anda akan mendelete data ini?!?</p><br /> data = '+ ret.no_bc + ' TGL: ' + ret.tgl_bc +'</div>');
			$("#dlgdelete_data_ak_bc27").dialog({
				height: 200,
				width: 250,
				modal: true,
				hide: 'Slide',
				autoOpen: 'false',
				buttons: {
					"CONFIRM": function() {
					$.ajax({
						url : "<?php echo base_url().'exim/ct_bc271/delete_data_ak_bc27'; ?>",
						type : 'POST',
						dataType: 'json',
						data : form_data,
						success: function(msg){
							if (msg.sts == '00'){
								alert(msg.desc);
								$("#dlgdelete_data_ak_bc27").dialog("close");
								$('#dlgdelete_data_ak_bc27').dialog("destroy"); 
								$(".dlgdelete_data_ak_bc27cl").remove(); 
								$('#data_alatkantor_bc27_in').trigger('reloadGrid');
							} else { 
								alert(msg.sts+' '+msg.desc); 
								$("#dlgdelete_data_ak_bc27").dialog("close");
								$('#dlgdelete_data_ak_bc27').dialog("destroy"); 
								$(".dlgdelete_data_ak_bc27cl").remove(); 

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

					}
				},
				close : function(){
					$('#dlgdelete_data_ak_bc27').dialog("destroy"); 
					$(".dlgdelete_data_ak_bc27cl").remove(); 
					$("body").append('<div id="dlgdelete_data_ak_bc27" title="Warning" class="dlgdelete_data_ak_bc27cl"><p>Apakah anda akan mendelete file ini?!?</p></div>');     
					
				},
				open: function(){
					$("body").unblock();
					
				}
			});
			
		});
		
			
		
	});
	
	/* 
	
	new Date($("#ms_prod_car_line_edit_doc_date").datepicker('getDate')
	jQuery("#tbl_view_upload_data_ak_out_ct").jqGrid({
			url:'<?php echo base_url().'settings/ct_barangalatkantor/loaddatax'; ?>',
			mtype : "post",
			postData:{'q':'1'},
			datatype: "json",
			colNames:[
			'tbl_alatkantor_out_id_ak_out_dtl','tbl_alatkantor_out_container_number','tbl_alatkantor_out_no_invoice','tbl_alatkantor_out_tgl_invoice','tbl_alatkantor_out_part_no','tbl_alatkantor_out_part_name'
			,'tbl_alatkantor_out_qty','tbl_alatkantor_out_qty_out','tbl_alatkantor_out_uom','tbl_alatkantor_out_doc_no','tbl_alatkantor_out_doc_date'
			,'tbl_alatkantor_out_doc_out_to','tbl_alatkantor_out_filename','tbl_alatkantor_out_car','tbl_alatkantor_out_create_date','tbl_alatkantor_out_create_by'
			,'tbl_alatkantor_out_update_date','tbl_alatkantor_out_update_by'
			]
			,colModel:[
			{name:'rID',index:'rID', width:80, hidden:false, align :'right'}
			,{name:'r1',index:'r1', width:80, hidden:false, align :'right'}
			,{name:'r2',index:'r2', width:80, hidden:false, align :'right'}
			,{name:'r3',index:'r3', width:80, hidden:false, align :'left', searchoptions:{searchhidden: true,dataInit:function(el){$(el).datepicker({onSelect: function(date){jQuery("#table_name")[0].triggerToolbar();},changeMonth: true,changeYear: true,dateFormat:'dd/mm/yy', showButtonPanel: true, beforeShow: function(input) {  setTimeout(function() { var buttonPane = $(input).datepicker("widget").find( ".ui-datepicker-buttonpane" );   var btn = $('<button class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" type="button">Clear</button>');   btn.unbind("click").bind("click", function () {   $.datepicker._clearDate( input );   });   btn.appendTo( buttonPane );  }, 1 );  }  });}}}
			,{name:'r4',index:'r4', width:80, hidden:false, align :'right'}
			,{name:'r5',index:'r5', width:80, hidden:false, align :'right'}

			,{name:'r6',index:'r6', width:80, hidden:false, align :'right'}
			,{name:'r7',index:'r7', width:80, hidden:false, align :'right'}
			,{name:'r8',index:'r8', width:80, hidden:false, align :'right'}
			,{name:'r9',index:'r9', width:80, hidden:false, align :'right'}
			,{name:'r10',index:'r10', width:80, hidden:false, align :'left', searchoptions:{searchhidden: true,dataInit:function(el){$(el).datepicker({onSelect: function(date){jQuery("#table_name")[0].triggerToolbar();},changeMonth: true,changeYear: true,dateFormat:'dd/mm/yy', showButtonPanel: true, beforeShow: function(input) {  setTimeout(function() { var buttonPane = $(input).datepicker("widget").find( ".ui-datepicker-buttonpane" );   var btn = $('<button class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" type="button">Clear</button>');   btn.unbind("click").bind("click", function () {   $.datepicker._clearDate( input );   });   btn.appendTo( buttonPane );  }, 1 );  }  });}}}

			,{name:'r11',index:'r11', width:80, hidden:false, align :'right'}
			,{name:'r12',index:'r12', width:80, hidden:false, align :'right'}
			,{name:'r13',index:'r13', width:80, hidden:false, align :'right'}
			,{name:'r14',index:'r14', width:80, hidden:false, align :'left', searchoptions:{searchhidden: true,dataInit:function(el){$(el).datepicker({onSelect: function(date){jQuery("#table_name")[0].triggerToolbar();},changeMonth: true,changeYear: true,dateFormat:'dd/mm/yy', showButtonPanel: true, beforeShow: function(input) {  setTimeout(function() { var buttonPane = $(input).datepicker("widget").find( ".ui-datepicker-buttonpane" );   var btn = $('<button class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" type="button">Clear</button>');   btn.unbind("click").bind("click", function () {   $.datepicker._clearDate( input );   });   btn.appendTo( buttonPane );  }, 1 );  }  });}}}
			,{name:'r15',index:'r15', width:80, hidden:false, align :'right'}

			,{name:'r16',index:'r16', width:80, hidden:false, align :'left', searchoptions:{searchhidden: true,dataInit:function(el){$(el).datepicker({onSelect: function(date){jQuery("#table_name")[0].triggerToolbar();},changeMonth: true,changeYear: true,dateFormat:'dd/mm/yy', showButtonPanel: true, beforeShow: function(input) {  setTimeout(function() { var buttonPane = $(input).datepicker("widget").find( ".ui-datepicker-buttonpane" );   var btn = $('<button class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" type="button">Clear</button>');   btn.unbind("click").bind("click", function () {   $.datepicker._clearDate( input );   });   btn.appendTo( buttonPane );  }, 1 );  }  });}}}
			,{name:'r17',index:'r17', width:80, hidden:false, align :'right'}

			],
			rowNum:10,
			rowList:[10,20,30],
			pager: '#ptbl_view_upload_data_ak_out_ct',
			sortname: 'rID',
			viewrecords: true,
			sortorder: "desc",
			width: '',
			height:290,
			jsonReader: { repeatitems : false },
			caption:"DATA UPLOAD BP OUT",
			rownumbers: true,
			shrinkToFit: false,
			afterInsertRow: function(){
				
				
			},			
			gridComplete: function(){
				var rowIDs = jQuery("#tbl_view_upload_data_ak_out_ct").getDataIDs(); 
				var rowData = $("#tbl_view_upload_data_ak_out_ct").getRowData();
			
				for (var i = 0; i < rowData.length; i++) 
				{
				   var trElement = jQuery("#"+ rowIDs[i],jQuery('#tbl_view_upload_data_ak_out_ct'));
				   
					switch (rowData[i].status_upload) {
						
						case 'cancel':
						   trElement.css({"color":"green"});
						break;
						case 'Deleted':
						   trElement.css({"color":"red", "text-decoration": "line-through"});
						break;
						case 'DATA PROCESSED':
						   trElement.css({"color":"blue"});
						break;
						
						
					}
				}
			},
		}); 
		
		jQuery("#tbl_view_upload_data_ak_out_ct").jqGrid('navGrid','#ptbl_view_upload_data_ak_out_ct',{del:false,add:false,edit:false},{},{},{},{multipleSearch:false});
		jQuery("#tbl_view_upload_data_ak_out_ct").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : false, defaultSearch: 'cn', ignoreCase: true});
		 */
		  	
</script>




	
	