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


Current Path : /proc/thread-self/root/var/www/html/college/js/
Upload File :
Current File : //proc/thread-self/root/var/www/html/college/js/savesemster.js

function callsavesemster() {
  $("#page_main_div").load(
    "../html_modules/savesemster.html?v=1001",
    function () {
      document.getElementById("display_module_name").innerHTML =
        "Update Student Semester";
      document.getElementById("module_name_for_save").value =
        "Update Student Semester";
      getDefaultHeadFooterLinks("Update Student Semester");
      loadDegreeGroups();
    }
  );
}
function loadDegreeGroups() {
  $.ajax({
    type: "GET",
    url: $host_url + "loadciedeggrp",
    success: function (response) {
      let res = JSON.parse(response);
      console.log(res, "degeregrp");
      if (res.error_code === 0) {
        var opt = `<option value=''>---select---</option>`;
        for (var i = 0; i < res.data.length; i++) {
          opt += `<option value='${res.data[i].fdeggrp}'>${
            res.data[i].fdeggrp + " - " + res.data[i].fdescpn
          }</option>`;
        }
        $("#deggrp").html(opt);
      } else {
        alert(res.data.msg);
        return;
      }
    },
  });
}
function getExamdateExamName() {
  var deggrp = document.getElementById("deggrp").value;
  $.ajax({
    type: "GET",
    url: $host_url + "loadciedegree",
    data: "deggrp=" + deggrp,
    success: function (response) {
      let res = JSON.parse(response);
      console.log(res, "degeregrp");
      if (res.error_code === 0) {
        var opt = `<option value='all' id='alll'>All</option>`;
        for (var i = 0; i < res.data.length; i++) {
          opt += `<option value='${res.data[i].FDEGREE}'>${
            res.data[i].FDEGREE + " - " + res.data[i].FDESCPN
          }</option>`;
        }
        $("#degree").html(opt);
        semesterHandler();
      } else {
        alert(res.data.msg);
        return;
      }
    },
  });
}
function semesterHandler() {
  var degree = document.getElementById("degree").value;
  $.ajax({
    type: "GET",
    url: $host_url + "updatestudentsem",
    data: "degree=" + degree,
    success: function (response) {
      let res = JSON.parse(response);
      if (res.error_code === 0) {
        var opt = `<option value=''>---select---</option>`;
        for (var i = 0; i < res.data.data.length; i++) {
          opt += `<option value='${res.data.data[i].fexamno}'>${
            res.data.data[i].fexamno + " - " + res.data.data[i].fexamname
          }</option>`;
        }
        $("#semester").html(opt);
      } else {
        alert(res.data.msg);
        return;
      }
    },
  });
}
function savestudentsemester() {
  var deggrp = document.getElementById("deggrp").value;
  var degree = document.getElementById("degree").value;
  var regfrom = document.getElementById("reg_no_from").value;
  var regto = document.getElementById("reg_no_to").value;
  var semester = document.getElementById("semester").value;

  if (deggrp == "") {
    alert("Select Degree Group");
    document.getElementById("deggrp").focus();
    return;
  }
  if (degree == "") {
    alert("Select Degree");
    document.getElementById("degree").focus();
    return;
  }
  if (regfrom == "0" || regfrom == "") {
    alert("Give Reg.NO Range");
    document.getElementById("reg_no_from").focus();
    return;
  }
  if (regto == "Z" || regto == "") {
    alert("Give Reg.NO Range");
    document.getElementById("reg_no_to").focus();
    return;
  }
  if (semester == "") {
    alert("Select Semester");
    document.getElementById("semester").focus();
    return;
  }
  $.ajax({
    type: "POST",
    url: $host_url + "saveupdatesemester",
    data:
      "degree=" +
      degree +
      "&reg_no_from=" +
      regfrom +
      "&reg_no_to=" +
      regto +
      "&semester=" +
      semester,

    success: function (res) {
      console.log(res);
      alert("Semester Updated Successfully");
      return;
    },
  });
}

function clearstudentupdatesemester() {
  callsavesemster();
}