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


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

function callEditStddet() {
  $("#page_main_div").load("../html_modules/editstddet.html", function () {
    document.getElementById("display_module_name").innerHTML =
      "Edit Student Details";
    document.getElementById("module_name_for_save").value =
      "Edit Student Details";
    getDefaultHeadFooterLinks("Edit Student Details");
  });
}

function Getstddet() {
  var regno = document.getElementById("regno").value;
  let params = "regno=" + regno;
  if (regno == "") {
    alert("Please Enter your RegNo");
    return;
  }

  $.ajax({
    type: "GET",
    url: $host_url + "getstudentdet",
    data: params,
    success: function (res) {
      var response = JSON.parse(res);
      console.log(response);
      // if(response.data.fmotmo==undefined){

      // }
      if (response.error_code == 0) {
        $("#stddet").show();
        document.getElementById("fregno").value = response.data.fregno;
        document.getElementById("name").value = response.data.fname;
        document.getElementById("fatname").value = response.data.FFATNAME;
        document.getElementById("motname").value = response.data.FMOTNAME;
        document.getElementById("dob").value = response.data.FDOB;

        document.getElementById("fatmob").value = response.data.FFATMOB;
        document.getElementById("motmob").value = response.data.fmotmob;
        document.getElementById("guamob").value = response.data.fguamob;
        document.getElementById("stdmob").value = response.data.FSTUDMOB;

        document.getElementById("add1").value = response.data.FCURRADD1;
        document.getElementById("add2").value = response.data.FCURRADD2;
        document.getElementById("add3").value = response.data.FCURRADD3;
        document.getElementById("add4").value = response.data.FCURRADD4;
        document.getElementById("post").value = response.data.fcommpost;
        document.getElementById("taluk").value = response.data.fcommtaluk;
        document.getElementById("district").value = response.data.fcommdist;
        document.getElementById("state").value = response.data.fcommstate;
        document.getElementById("pin").value = response.data.fcommpin;

        document.getElementById("add01").value = response.data.fpermadd1;
        document.getElementById("add02").value = response.data.fpermadd2;
        document.getElementById("add03").value = response.data.FPERMADD3;
        document.getElementById("add04").value = response.data.FPERMADD4;
        document.getElementById("post01").value = response.data.fperpost;
        document.getElementById("taluk01").value = response.data.fpertaluk;
        document.getElementById("district01").value = response.data.FPERDIST;
        document.getElementById("state01").value = response.data.fperstate;
        document.getElementById("pin01").value = response.data.fperpin;
      } else {
        alert(response.data.msg);
        return;
      }
    },
  });
}

function savestddet() {
  var regno = document.getElementById("regno").value;
  var fregno = document.getElementById("fregno").value;
  var dob = document.getElementById("dob").value;
  var fatmob = document.getElementById("fatmob").value;
  var motmob = document.getElementById("motmob").value;
  var guamob = document.getElementById("guamob").value;
  var stdmob = document.getElementById("stdmob").value;

  var add1 = document.getElementById("add1").value;
  var add2 = document.getElementById("add2").value;
  var add3 = document.getElementById("add3").value;
  var add4 = document.getElementById("add4").value;
  var post = document.getElementById("post").value;
  var taluk = document.getElementById("taluk").value;
  var district = document.getElementById("district").value;
  var state = document.getElementById("state").value;
  var pin = document.getElementById("pin").value;

  var add01 = document.getElementById("add01").value;
  var add02 = document.getElementById("add02").value;
  var add03 = document.getElementById("add03").value;
  var add04 = document.getElementById("add04").value;
  var post01 = document.getElementById("post01").value;
  var taluk01 = document.getElementById("taluk01").value;
  var district01 = document.getElementById("district01").value;
  var state01 = document.getElementById("state01").value;
  var pin01 = document.getElementById("pin01").value;
  var fatherCheck = document.getElementById("father").checked;
  var motherCheck = document.getElementById("mother").checked;

  if (fatherCheck == true && fatmob == "") {
    alert("Enter Father Mobile No");
  } else if (motherCheck == true && motmob == "") {
    alert("Enter Mother Mobile No");
  }

  let params =
    "regno=" +
    regno +
    "&dob=" +
    dob +
    "&fatmob=" +
    fatmob +
    "&motmob=" +
    motmob +
    "&guamob=" +
    guamob +
    "&stdmob=" +
    stdmob +
    "&add1=" +
    add1 +
    "&add2=" +
    add2 +
    "&add3=" +
    add3 +
    "&add4=" +
    add4 +
    "&post=" +
    post +
    "&taluk=" +
    taluk +
    "&district=" +
    district +
    "&state=" +
    state +
    "&pin=" +
    pin +
    "&add01=" +
    add01 +
    "&add02=" +
    add02 +
    "&add03=" +
    add03 +
    "&add04=" +
    add04 +
    "&post01=" +
    post01 +
    "&taluk01=" +
    taluk01 +
    "&district01=" +
    district01 +
    "&state01=" +
    state01 +
    "&pin01=" +
    pin01 +
    "&father=" +
    fatherCheck +
    "&mother=" +
    motherCheck;
  $.ajax({
    type: "POST",
    url: $host_url + "updatestudentdetail",
    data: params,
    success: function (res) {
      let response = JSON.parse(res);
      console.log(response, "hii");
      // if (response.error_code == 0) {
      //   alert("Updated Successfully");
      //   callEditStddet();
      // } else {
      //   alert(response.msg);
      //   return;
      // }
    },
  });
}