GIF89a php
Current File : /home/hencockfreshchic/public_html/app_old/js/sendReport2.js
function sendReport2(user_id)
{
	var msgg=$("#exampleFormControlTextarea1").val();

	if(msgg=="")
	{
		alert("Enter message");
		$("#exampleFormControlTextarea1").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)
      {
      	$("#exampleFormControlTextarea1").val("");
      	var x = document.getElementById("snackbar");
	      	$("#snack_msgg").html("Reported Successfully");
 			 x.className = "show";
  			setTimeout(function(){ x.className = x.className.replace("show", "Hello"); }, 3000);
      	
      }
      else if(this.responseText==3)
      {
      		$("#exampleFormControlTextarea1").val("");
      		var x = document.getElementById("snackbar");
	      	$("#snack_msgg").html("Already Reported");
 			 x.className = "show";
  			setTimeout(function(){ x.className = x.className.replace("show", "Hello"); }, 3000);
      }
      else
      {
      	$("#exampleFormControlTextarea1").val("");
      	var x = document.getElementById("snackbar");
	      	$("#snack_msgg").html("Failed to report.");
 			 x.className = "show";
  			setTimeout(function(){ x.className = x.className.replace("show", "Hello"); }, 3000);
      }	
	}
  };
  xmlhttp.open("GET","sendReport2.php?msgg="+msgg+"&user_id="+user_id,true);
  xmlhttp.send();

}