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


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

function calldegwiseIAreport() {
  $("#page_main_div").load(
    "../html_modules/degwiseIAreport.html?",
    function () {
      document.getElementById("display_module_name").innerHTML =
        "DegreeWise IA Report";
      document.getElementById("module_name_for_save").value =
        "DegreeWise IA Report";
      getDefaultHeadFooterLinks("DegreeWise IA Report");
      loadAttDegwise();
      // loaddegreecreateclass();
      let options = "";
      if (window.db === "jssstu") {
        options += ` <option value = 'Regular'>Regular</option>
            <option value = 'Improvement'>Improvement (Parallel)</option>`;
      } else {
        options += ` <option value = 'Regular'>Regular</option>
            <option value = 'Improvement'>Improvement</option>`;
      }
      $("#mode").html(options);
    }
  );
}

function loadAttDegwise() {
  $.ajax({
    type: "GET",
    url: $host_url + "loadAttDegwise",
    success: function (res) {
      let response = JSON.parse(res);
      let opt = "";
      opt += `<option>---Select---</option>`;
      if (response.error_code === 0) {
        response.data.forEach((element) => {
          opt += `<option value='${element.fdegree}'>${element.fdegree} - ${element.fdescpn}</option>`;
        });
        document.getElementById("markentry_sub_degree_code").innerHTML = opt;
      }
    },
  });
}

function getAttDegSem() {
  var degree = document.getElementById("markentry_sub_degree_code").value;

  $.ajax({
    type: "GET",
    url: $host_url + "getAttDegSem" + "&degree=" + degree,
    success: function (res) {
      let response = JSON.parse(res);
      let option = "";
      option += `<option>---Select---</option>`;
      if (response.error_code === 0) {
        response.data.forEach((elements) => {
          option += `<option value='${elements.fexamno}'>${elements.fexamno} - ${elements.fexamname}</option>`;
        });
        document.getElementById("markentry_sub_Examno").innerHTML = option;
      }
    },
  });
}
function handleSubject() {
  let degree = document.getElementById("markentry_sub_degree_code").value;
  let sem = document.getElementById("markentry_sub_Examno").value;
  $.ajax({
    type: "GET",
    url: $host_url + "getsubforIAreport",
    data: "&degree=" + degree + "&sem=" + sem,
    success: function (res) {
      let response = JSON.parse(res);
      let option = "";
      option += `<option>---Select---</option>`;
      // option += `<option value = 'All'>All</option>`;
      if (response.error_code == 0) {
        response.data.forEach((elements) => {
          option += `<option value='${elements.fsubcode}'>${elements.fsubname}</option>`;
        });
        document.getElementById("subjectforia").innerHTML = option;
      }
    },
  });
}

function handleElement() {
  let degree = document.getElementById("markentry_sub_degree_code").value;
  let sem = document.getElementById("markentry_sub_Examno").value;
  let sub = document.getElementById("subjectforia").value;

  $.ajax({
    type: "GET",
    url: $host_url + "testforIAreport",
    data: "&degree=" + degree + "&sem=" + sem + "&sub=" + sub,
    success: function (res) {
      let response = JSON.parse(res);
      console.log(response);
      option = "";
      option += `<option>---Select---</option>`;
      if (response.error_code == 0) {
        response.data.forEach((elements) => {
          option += `<option value='${elements.fsubname}'>${elements.fsubname}</option>`;
        });
        document.getElementById("elementIamarks").innerHTML = option;
      }
    },
  });
}
function handleTest() {
  let degree = document.getElementById("markentry_sub_degree_code").value;
  let sem = document.getElementById("markentry_sub_Examno").value;
  let sub = document.getElementById("subjectforia").value;
  let subelement = document.getElementById("elementIamarks").value;

  $.ajax({
    type: "GET",
    url: $host_url + "testforIAreporttest",
    data:
      "&degree=" +
      degree +
      "&sem=" +
      sem +
      "&sub=" +
      sub +
      "&subelement=" +
      subelement,
    success: function (res) {
      let response = JSON.parse(res);
      console.log(response);
      option = "";
      option += `<option>---Select---</option>`;
      if (response.error_code == 0) {
        response.data.forEach((elements) => {
          option += `<option value='${elements.ftest}'>${elements.ftest}</option>`;
        });
        document.getElementById("testIAreport").innerHTML = option;
      } else {
        alert(response.data.msg);
      }
    },
  });
}

function generateIAreportDegwise() {
  let degree = document.getElementById("markentry_sub_degree_code").value;
  let sem = document.getElementById("markentry_sub_Examno").value;
  let sub = document.getElementById("subjectforia").value;
  let subelement = document.getElementById("elementIamarks").value;
  let test = document.getElementById("testIAreport").value;

  if (degree == "---Select---") {
    alert("Select Degree");
    document.getElementById("markentry_sub_degree_code").focus();
    return;
  } else if (sem == "---Select---" || sem == "") {
    alert("Select Exam No.");
    document.getElementById("markentry_sub_Examno").focus();
    return;
  } else if (sub == "---Select---" || sub == "") {
    alert("Select Subject");
    document.getElementById("subjectforia").focus();
    return;
  } else if (subelement == "---Select---") {
    alert("Select Test");
    document.getElementById("elementIamarks" || subelement == "").focus();
    return;
  } else if (test == "---Select---") {
    alert("Select Test");
    document.getElementById("testIAreport" || test == "").focus();
    return;
  } else {
    window.open(
      $host_url +
        "iaMarksDegwiseReport&degree=" +
        degree +
        "&sem=" +
        sem +
        "&sub=" +
        sub +
        "&test=" +
        test +
        "&subelement=" +
        subelement
    );
  }
  console.log(sub);
}