GIF89a php
Current File : /home/hencockfreshchic/public_html/js/sendTocart.js
function sendTocart(prod_id,user_id,sale_price)
{
	var qty=$("#qty").val();
  
//var cartCount=parseInt($("#cartCount").text());
document.getElementById("overlay").style.display = "block";
	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.reload();
         //var newCount=cartCount-1;
         //$("#cartCount").text(newCount);
      		//alert("Material added to cart");


      }
      else if(this.responseText==0)
      {
      	 document.getElementById("overlay").style.display = "none";
      	alert("Error : Unable to add product into cart");
      }
      else if(this.responseText==2)
      {
      	 document.getElementById("overlay").style.display = "none";
      	window.location.href = ("login.php");
      }
	}
  };
  //alert("addCart.php?prod_id="+prod_id+"&user_id="+user_id+"&sale_price="+sale_price+"&qty="+qty);
  xmlhttp.open("GET","addCart.php?prod_id="+prod_id+"&user_id="+user_id+"&sale_price="+sale_price+"&qty="+qty,true);
  xmlhttp.send();
}