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.145.40.120


Current Path : /var/www/html/univadmin/rrit/js/
Upload File :
Current File : /var/www/html/univadmin/rrit/js/main.js

function getStudentDetails() {
  $.ajax({
    type: "GET",
    url: "../php/appication.php",

    success: function (res) {
      let response = JSON.parse(res);
      let data = response.data;
      $("#payment_type").hide();
      $("#fname").text(data.fname);
      $("#appno").text("App. no:" + " " + data.fappno);
      $("#email").text("E-mail:" + " " + data.femail);
      $("#fphone").text("Mobile:" + " " + data.fmob);
      $("#fspic").text("Specialization:" + " " + data.fspecial);
    },
  });
}

async function getPersonal() {
  $.ajax({
    type: "GET",
    url: "../php/appication.php",
    async: false,
    success: function (res) {
      let response = JSON.parse(res);
      let data = response.data;
      let sname = data.fname;
      let table = ``;
      if (data.fpaymentstatus == "T") {
        $("#app-personal").load("../html_modules/personal.html", function () {
          $("#sname").val(sname);
          $("#fmob").val(data.fmob);
          $("#femail").val(data.femail);
          var states = data.fstate;
          var fsplit = states.split("-");
          let fstate = fsplit[0];
          let fpin = fsplit[1];
          if (data.fgender == "M") {
            console.log("HII");
            $("#male").prop("checked", true);
          } else if (data.fgender == "F") {
            $("#female").prop("checked", true);
          } else {
            $("#other").prop("checked", true);
          }
          $("#birthdayDate").val(data.fdob);
          $("#category").val(data.fcate);
          $("#nation").val(data.fcountry);
          $("#fatname").val(data.ffatname);
          $("#fatno").val(data.ffatmob);
          $("#motname").val(data.fmotname);
          $("#refer").val(data.freferstatus);
          $("#aadhaarNo").val(data.faadhaarno);
          $("#relig").val(data.freligion);
          $("#add1").val(data.fadd1);
          $("#add2").val(data.fadd2);
          $("#add3").val(data.fadd3);
          $("#country").val(data.fcountry);
          $("#state").val(fstate);
          $("#district").val(data.fdistrict);
          $("#pincode").val(fpin);
        });
      } else {
        // table += `<div class="col-lg-8" style="position: absolute; left: 310px; top: 50px">
        // <div id="per-det">
        // <div class="card mb-4">
        // <div class="card-header">Please Make Payment</div>
        //   <div class="card-body">
        //     <button type="button" class="btn btn-primary">
        //       Pay Registration Fee
        //     </button>
        //   </div>
        // </div>
        // </div>
        // </div>`;
        $("#app-personal").load("../html_modules/feeDetails.html");
        alert("Please make Payment first");
      }
      // $("#sname").val(data.fname);
    },
  });
}

function feeDetail() {
  $("#app-personal").load("../html_modules/feeDetails.html");
}
function paymentDet() {
  $("#app-personal").load("../html_modules/paymentDetails.html");
}

function saveStdDet() {
  var fname = $("#sname").val();
  var mob = $("#fmob").val();
  var femail = $("#femail").val();
  var dob = $("#birthdayDate").val();
  var cate = $("#category").val();
  var nation = $("#nation").val();
  var fatname = $("#fatname").val();
  var fatno = $("#fatno").val();
  var motname = $("#motname").val();
  var refer = $("#refer").val();
  var relig = $("#relig").val();
  var aadhaarNo = $("#aadhaarNo").val();
  var add1 = $("#add1").val();
  var add2 = $("#add2").val();
  var add3 = $("#add3").val();
  var country = $("#country").val();
  var state = $("#state").val();
  var district = $("#district").val();
  var pincode = $("#pincode").val();
  var male = document.getElementById("male").checked;
  var female = document.getElementById("female").checked;
  var other = document.getElementById("other").checked;
  var cond = document.getElementById("condNo").checked;
  let gender;

  if (male == true) {
    gender = "M";
  } else if (female == true) {
    gender = "F";
  } else if (other == true) {
    gender = "other";
  } else {
    alert("Please select Gender");
    return;
  }

  if (fname == "") {
    alert("Enter Your Name");
    return;
  }
  if (mob == "") {
    alert("Enter Your Mobile No");
    return;
  }
  if (femail == "") {
    alert("Enter Your Email Id");
    return;
  }
  if (dob == "") {
    alert("Enter Your Date Of Birth");
    return;
  }
  if (gender == "") {
    alert("Enter Your Date Of Birth");
    return;
  }
  if (cate == "") {
    alert("Enter Your Category");
    return;
  }
  if (nation == "") {
    alert("Enter Your Nationality");
    return;
  }
  if (fatname == "") {
    alert("Enter Your Father Name");
    return;
  }
  if (fatno == "") {
    alert("Enter Your Father Phone No.");
    return;
  }
  if (motname == "") {
    alert("Enter Your Mother Name");
    return;
  }
  if (refer == "") {
    alert("Select How did you come to know about us");
    return;
  }
  if (relig == "") {
    alert("Select Your Religion");
    return;
  }
  if (aadhaarNo == "") {
    alert("Enter Your Aadhaar No.");
    return;
  }
  if (add1 == "") {
    alert("Enter Your Address 1");
    return;
  }
  if (add2 == "") {
    alert("Enter Your Address 2");
    return;
  }
  if (add3 == "") {
    alert("Enter Your Address 3");
    return;
  }
  if (country == "") {
    alert("Enter Your Country");
    return;
  }
  if (state == "") {
    alert("Enter Your State");
    return;
  }

  if (district == "") {
    alert("Enter Your District");
    return;
  }
  if (pincode == "") {
    alert("Enter Your Pin Code");
    return;
  }
  if (cond == true) {
    alert("Please Accept the Declaration");
    return;
  }
  var params =
    "fname=" +
    fname +
    "&mob=" +
    mob +
    "&gender=" +
    gender +
    "&femail=" +
    femail +
    "&dob=" +
    dob +
    "&cate=" +
    cate +
    "&nation=" +
    nation +
    "&fatname=" +
    fatname +
    "&fatno=" +
    fatno +
    "&motname=" +
    motname +
    "&refer=" +
    refer +
    "&relig=" +
    relig +
    "&aadhaarNo=" +
    aadhaarNo +
    "&add1=" +
    add1 +
    "&add2=" +
    add2 +
    "&add3=" +
    add3 +
    "&country=" +
    country +
    "&state=" +
    state +
    "&district=" +
    district +
    "&pincode=" +
    pincode;

  $.ajax({
    type: "POST",
    url: "../php/personal.php",
    data: params,
    success: function (res) {
      let response = JSON.parse(res);
      console.log(response);
      if (response.fstatus == "invalid") {
        var { msg } = JSON.parse(res);
        Swal.fire({
          title: msg,
          type: "warning",
          showCancelButton: false,
          confirmButtonColor: "#5495ff",
          confirmButtonText: "OK",
          closeOnConfirm: false,
        });
      } else {
        var { msg } = JSON.parse(res);
        Swal.fire({
          title: msg,
          type: "Success",
          showCancelButton: false,
          confirmButtonColor: "#5495ff",
          confirmButtonText: "OK",
          closeOnConfirm: false,
        });
      }
    },
  });
}