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 : 18.119.122.145


Current Path : /var/www/html/pget/js/pg/
Upload File :
Current File : //var/www/html/pget/js/pg/sign-up.js

var db = window.location.pathname.split("/")[2];
function validateRegno() {
  if (!$("#validateform").valid()) {
    return;
  }
  var parameters = `&mobile=${$("#idmobile").val()}`;

  $.ajax({
    type: "post",
    url: "../pgetadm/validateRegno.php?db=" + db,
    data: parameters,
    success: function(response) {
      var { status } = JSON.parse(response);
      if (status == "invalid") {
        var { msg } = JSON.parse(response);
        swal({
          title: msg,
          type: "warning",
          showCancelButton: false,
          confirmButtonColor: "#5495ff",
          confirmButtonText: "OK",
          closeOnConfirm: false
        });
      } else if (status == "success") {
        swal({
          title: "OTP Sent to your mobile.",
          type: "success",
          showCancelButton: false,
          confirmButtonColor: "#5495ff",
          confirmButtonText: "OK",
          closeOnConfirm: false
        });
        // var { fname, femail } = result;

        $(".card1").css("margin-top", "0%");
        $("#hrule").css("display", "none");
        $("#sign-up-scroll").slimScroll({
          height: "650px"
        });
        $("#perinfo").css("display", "block");
        $("#sendpasswd").css("display", "none");
        $("#sendotp").css("display", "block");
        $("#sendotpform").show(); //sendotp
      }
    }
  });
}

function validateInfo() {
  if (!$("#sendotpform").valid()) {
    return;
  }
  var parameters = `&mobile=${$("#idmobile").val()}&dob=${$("#dob").val()}
        &password=${$("#password").val()}`;
  $.ajax({
    type: "post",
    url: "../pgetadm/sendMobEmailOTP.php?db=" + db,
    data: parameters,
    success: function(response) {
      var { status, sms } = JSON.parse(response);
      if (sms == "Sent.") {
        $("#sendotp").html("Re-Send OTP");
        $("#mobile").attr("disabled", "true");
        $("#state").attr("disabled", "true");
        $("#univ").attr("disabled", "true");
        $("#dob").attr("disabled", "true");
        $("#password").attr("disabled", "true"); //cpassword
        $("#cpassword").attr("disabled", "true");
      }
    }
  });
}

function signup() {
  if (!$("#sendotpform").valid()) {
    return;
  }
  var parameters = `&mobile=${$("#idmobile").val()}&dob=${$("#dob").val()}
        &password=${$("#password").val()}&motp=${$("#motp").val()}&name=${$(
    "#idname"
  ).val()}
        &email=${$("#idemail").val()}`;

  $.ajax({
    type: "post",
    url: "../pgetadm/signup.php?db=" + db,
    data: parameters,
    success: function(response) {
      var { status } = JSON.parse(response);
      if (status == "success") {
        swal(
          {
            title:
              "Your login account created successfully for PG Entrence Test registration.",
            text: "Click OK to continue",
            type: "success",
            showCancelButton: false,
            confirmButtonColor: "#5495ff",
            confirmButtonText: "OK",
            closeOnConfirm: false
          },
          function() {
            window.location.href = "index.html";
            // signInWithSignup($('#idmobile').val(), $('#password').val());
          }
        );
      } else {
        swal({
          title: "Invalid OTP. Try resend OTP.",
          type: "warning",
          showCancelButton: false,
          confirmButtonColor: "#5495ff",
          confirmButtonText: "OK",
          closeOnConfirm: false
        });

        $("#sendotp").css("display", "block");
      }
    }
  });
}

function signInWithSignup(mobile, passwd) {
  var parameters = "&mobile=" + mobile + "&passwd=" + passwd.toUpperCase();
  $.ajax({
    type: "post",
    url: "../pgetadm/signin.php?db=" + db,
    data: parameters,
    success: function(response) {
      if (response === "invalid") {
        alert("Invalid Login");
      } else {
        window.location.href = "pg_instruction.html";
      }
    }
  });
}