GIF89a php
Current File : /home/hencockfreshchic/public_html/js/saveShipAddress.js
function saveShipAddress(user_id){
	document.getElementById("overlay").style.display = "block";
	var name=$("#name2").val();
	var email=$("#email2").val();
	var company=$("#company2").val();
	var mobile=$("#mobb2").val();
	var address=$("#add2").val();
	var landmark=$("#landmark2").val();
	var country=$("#billingcountryId2").val();
	var state=$("#billingstateid").val();
	var city=$("#city2").val();
	var pincode=$("#pincode2").val();

	if(name=="")
	{
		document.getElementById("overlay").style.display = "none";
		alert("Invalid name");
		$("#name2").focus();
		return true;
	}
	if(email=="")
	{
		document.getElementById("overlay").style.display = "none";
		alert("Invalid email");
		$("#email2").focus();
		return true;
	}
	if(company=="")
	{
		document.getElementById("overlay").style.display = "none";
		alert("Invalid company");
		$("#company2").focus();
		return true;
	}
	if(mobile=="")
	{
		document.getElementById("overlay").style.display = "none";
		alert("Invalid mobile number");
		$("#mobb2").focus();
		return true;
	}
	if(address=="")
	{
		document.getElementById("overlay").style.display = "none";
		alert("Invalid address");
		$("#add2").focus();
		return true;
	}
	if(landmark=="")
	{
		document.getElementById("overlay").style.display = "none";
		alert("Invalid landmark");
		$("#landmark2").focus();
		return true;
	}
	if(country=="")
	{
		document.getElementById("overlay").style.display = "none";
		alert("Invalid country");
		$("#billingcountryId2").focus();
		return true;
	}
	if(state=="")
	{
		document.getElementById("overlay").style.display = "none";
		alert("Invalid state");
		$("#billingstateid").focus();
		return true;
	}
	if(city=="")
	{
		document.getElementById("overlay").style.display = "none";
		alert("Invalid city");
		$("#city2").focus();
		return true;
	}
	if(pincode=="")
	{
		document.getElementById("overlay").style.display = "none";
		alert("Invalid pincode");
		$("#pincode2").focus();
		return true;
	}

if (window.XMLHttpRequest) {
            xmlhttp = new XMLHttpRequest();
        } else {          
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        } 
  xmlhttp.onreadystatechange=function() 
   {
    if (this.readyState==4 && this.status==200) 
	{
		if(this.responseText==1)
		{
			document.getElementById("overlay").style.display = "none";
			window.location.href = ("order-overview.php");
		}
		else if(this.responseText==0)
		{
			document.getElementById("overlay").style.display = "none";
			alert("Error : Dear customer, we are sorry. we cant proceed your right now, Please try again later");
		}    
	}
  };
  console.log("saveShipAddress.php?user_id="+user_id+"&name="+name+"&email="+email+"&company="+company+"&mobile="+mobile+"&address="+address+"&landmark="+landmark+"&country="+country+"&state="+state+"&city="+city+"&pincode="+pincode);
  xmlhttp.open("GET","saveShipAddress.php?user_id="+user_id+"&name="+name+"&email="+email+"&company="+company+"&mobile="+mobile+"&address="+address+"&landmark="+landmark+"&country="+country+"&state="+state+"&city="+city+"&pincode="+pincode,true);
  xmlhttp.send();

}