0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.135.206.19


Current Path : /var/www/oasis/js/
Upload File :
Current File : /var/www/oasis/js/resetPasseordValidate.js

if (location.protocol != "https:") {
  var protocol = "http://";
} else {
  var protocol = "https://";
}
var urlarr = window.location.pathname.split("/");
var $url = protocol + window.location.host + "/";
var $hoststr = "";
console.log(urlarr.length);
for (var j = 1; j < urlarr.length - 2; j++) {
  $hoststr += window.location.pathname.split("/")[j] + "/";
}
var db = window.location.pathname.split("/")[urlarr.length - 2];

$host_url = $url + $hoststr + "app.php?db=" + db + "&a=";

function sendUserOtp() {
  let collcode = $("#collge_code").val();
  let user = $("#user").val();
  user = user.replace(/["']/g, "");
  user = user.replace(/&/g, "");
  user = user.replace(/ /g, "");

  $.ajax({
    type: "GET",
    url: $host_url + "resetPasswordUser",
    data: "collcode=" + collcode + "&user=" + user,
    success: function (res) {
      var response = JSON.parse(res);
      console.log(response, "anitaa");
      if (response.status == "success") {
        $("#emailidtr").show();
        $("#otpbutton").show();
        $("#validatetr").hide();
        document.getElementById("email").value = response.data.data.email_id;

        document.getElementById("email").disabled = true;
        document.getElementById("collge_code").disabled = true;
        document.getElementById("user").disabled = true;
      }
    },
  });
}

function sendOTP() {
  $("#sendotptd").hide();
  $("#otpbutton").hide();
  $("#sendotpidtr").show();
  $("#newpassidtr").show();
  $("#compassidtr").show();
  $("#submittr").show();
  var otp = document.getElementById("otpsend").value;
  // var newpass = document.getElementById("newpass").value;
  // var comfirmpass = document.getElementById("confirmpass").value;
  // console.log(otp);
  // console.log(newpass);
  // console.log(comfirmpass);
  $.ajax({
    type: "GET",
    url: $host_url + "sendOTPForgotPassword",
    // data: "otpsend=" + otp + "&confirmpass" + comfirmpass,
    success: function (res) {
      console.log(res);
    },
  });
}

function handleSubmit() {
  var otp = document.getElementById("otpsend").value;
  var mailid = document.getElementById("email").value;
  var comfirmpass = document.getElementById("confirmpass").value;
  comfirmpass = comfirmpass.replace(/["']/g, "");
  comfirmpass = comfirmpass.replace(/&/g, "");
  comfirmpass = comfirmpass.replace(/ /g, "");

  $.ajax({
    type: "POST",
    url: $host_url + "newpasswordsubmit",
    data: "otpsend=" + otp + "&confirmpass=" + comfirmpass + "&email=" + mailid,
    success: function (res) {
      console.log(res);
    },
  });
}