GIF89a php
Current File : /home/hencockfreshchic/public_html/admin.cpanel/js/saveVideoID.js
function saveVideoID(){
	var cat=$("#cat").val();
	var subcat=$("#subcat").val();
	var prod=$("#prod").val();
	var videoid=$("#videoid").val();


	if(cat==""){
		alert("Select Category");
      $("#cat").focus();
      return false;
	}
	if(subcat=="")
	{
	alert("Select Sub Category");
      $("#subcat").focus();
      return false;
	}
	if(prod=="")
	{
			alert("Select Product");
      $("#prod").focus();
      return false;
	}
	if(videoid=="")
	{
			alert("Enter video ID");
      $("#videoid").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("Video has been applied on the given product");
	window.location.href = ("product_video.php");
}
else if(this.responseText==2){
	alert("There is already a video exist on this product");
window.location.href = ("product_video.php");	
}
else
{
	alert("Unable to save videos");
window.location.href = ("product_video.php");	
}
	}
  };

  xmlhttp.open("GET","saveProdVideo.php?catt="+cat+"&subcat="+subcat+"&prod="+prod+"&videoid="+videoid,true);
  xmlhttp.send();


}