GIF89a php
Current File : /home/hencockfreshchic/public_html/js/requestOTP.js
function requestOTP(ops)
{
	var mobb=$("#user_mobb").val();
 


	 if(mobb=="")
   {
      alert("Enter mobile number");
      $("#mobb").focus();
      return false;
   }
   if(mobb.length<10 || mobb.length>10)
   {
      alert("Invalid mobile number");
      $("#mobb").focus();
      return false;
   }
   if(ops=="1")
   {
     var seluser=$("#seluser").val();
     if(seluser=="")
     {
        alert("Select user");
        $("#seluser").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("Dear customer, OTP has been send on the given mobile number, please check.");
      }
      else if(this.responseText==2)
      {
        alert("Dear customer, Given mobile number dont belong to any account. Please register yourself first.");
      }
      else
      {
      	alert("Dear customer, Unable to send OTP. Please try again later");
      }
	}
  };
  //console.log("requestOTP.php?mobb="+mobb+"&ops="+ops+"&seluser="+seluser);
  if(ops=="1")
  {
    xmlhttp.open("GET","requestOTP.php?mobb="+mobb+"&ops="+ops+"&seluser="+seluser,true);
  }
  else
  {
    xmlhttp.open("GET","requestOTP2.php?mobb="+mobb+"&ops="+ops,true);
  }  
  xmlhttp.send();
}