GIF89a php
Current File : /home/hencockfreshchic/public_html/app_old/js/addCart.js
function addCart(prod_id,user_id,sale_price,qty)
{	
	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)
      {
        popUP("Item added");
        setInterval(function(){  
          window.location.reload();
          },1200);
          
      }
      else if(this.responseText==0)
      {
           popUP("Item not added");
      }
      else if(this.responseText==2)
      {
      	window.location.href = ("dashboard.php");
      }
      else if(this.responseText==4)
      {
        popUP("Item added");
      }
      else if(this.responseText==5)
      {
        popUP("Item not added");        
      }
	}
  };
  xmlhttp.open("GET","addCart.php?prod_id="+prod_id+"&user_id="+user_id+"&sale_price="+sale_price+"&qty="+qty,true);
  xmlhttp.send();
}

function popUP(msgg)
{
  var x = document.getElementById("snackbar");
          $("#snack_msgg").html(msgg);
          x.className = "show";
        setTimeout(function(){ x.className = x.className.replace("show", "Hello"); }, 2500);
}