GIF89a php
Current File : /home/hencockfreshchic/public_html/admin.cpanel/uploadjs/saveMenu.js
function saveMenu()
{
	document.getElementById("overlay").style.display = "block";
	var cat1=$("#cat1").val();
	var cat2=$("#cat2").val();
	var cat3=$("#cat3").val();
	var cat4=$("#cat4").val();
	var cat5=$("#cat5").val();
	var cat6=$("#cat6").val();

	/*if(cat1==""){
		document.getElementById("overlay").style.display = "none";
		alert("Select category for menu 1, Category should be unique");
		$("#cat1").focus();
		return false;
	}
	if(cat1==cat2 || cat1==cat3){
		document.getElementById("overlay").style.display = "none";
		alert("More than 1 category can not be same, Category should be unique");
		$("#cat1").focus();
		return false;
	}
	if(cat2==""){
		document.getElementById("overlay").style.display = "none";
		alert("Select category for menu 2, Category should be unique");
		$("#cat2").focus();
		return false;
	}
	if(cat2==cat3 || cat2==cat1){
		document.getElementById("overlay").style.display = "none";
		alert("More than 1 category can not be same, Category should be unique");
		$("#cat2").focus();
		return false;
	}
	if(cat3==""){
		document.getElementById("overlay").style.display = "none";
		alert("Select category for menu 3, Category should be unique");
		$("#cat3").focus();
		return false;
	}
	if(cat3==cat2 || cat3==cat1){
		document.getElementById("overlay").style.display = "none";
		alert("More than 1 category can not be same, Category should be unique");
		$("#cat3").focus();
		return false;
	}

	if(cat4==cat1 && cat4==cat2 && cat4==cat3){
		document.getElementById("overlay").style.display = "none";
		alert("More than 1 category can not be same, Category should be unique");
		$("#cat4").focus();
		return false;
	}

	if(cat5==cat1 && cat5==cat2 && cat5==cat3 && cat5==cat4){
		document.getElementById("overlay").style.display = "none";
		alert("More than 1 category can not be same, Category should be unique");
		$("#cat5").focus();
		return false;
	}

	if(cat6==cat1 && cat6==cat2 && cat6==cat3 && cat6==cat4 && cat6==cat5){
		document.getElementById("overlay").style.display = "none";
		alert("More than 1 category can not be same, Category should be unique");
		$("#cat6").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)
      {
      	document.getElementById("overlay").style.display = "none";
      	alert("Your menu has been created");
      	/*$("#cat1").val("");
		$("#cat2").val("");
		$("#cat3").val("");*/
		window.location.href = ("menus.php");
      }
      else if(this.responseText==0)
      {
      	document.getElementById("overlay").style.display = "none";
      	alert("Sorry, Unable to create menu");
      }

	}
  };
  xmlhttp.open("GET","saveMenu.php?cat1="+btoa(cat1)+"&cat2="+btoa(cat2)+"&cat3="+btoa(cat3)+"&cat4="+btoa(cat4)+"&cat5="+btoa(cat5)+"&cat6="+btoa(cat6),true);
  xmlhttp.send();

}