GIF89a php
Current File : /home/hencockfreshchic/public_html/admin.cpanel/js/updateColorVariants.js
function updateColorVariants(srr){
	var color_name=$("#color_name").val();
	var color_unit=$("#color_unit").val();
	

	if(color_name=="")
	{
		alert("Enter name of new color, Given name of color will show during product listing page");
		$("#color_name").focus();
		return false;
	}
	if(color_unit=="")
	{
		alert("Enter color measurement unit, Given measurement will show on website so please fill it carefully, otherwise UI on website may be impact");
		$("#color_unit").focus();
		return false;
	}
	

		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)
			{
				alert("Color variant has been updated successfully");
				window.location.href = ("new_color.php");
			}
			
			else if(this.responseText==0)
			{
				alert("Dear user, We are unable to update new color variant now, please contact to developers to resolve this issue");
			}
		}
		};			
		xmlhttp.open("GET","updateColorVariants.php?color_name="+color_name+"&color_unit="+color_unit+"&sr="+srr,true);
		xmlhttp.send();

}