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


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

function callMarksEntryReport() {
  $("#page_main_div").load("../html_modules/iaMarksReport.html?", function () {
    document.getElementById("display_module_name").innerHTML =
      "Progress Report";
    document.getElementById("module_name_for_save").value = "Progress Report";
    getDefaultHeadFooterLinks("Progress Report");
    $("#all_subject_report").hide();
    $("#subjectwise_report").hide();
  });
  // getDegreeAndSem();
}

function getReportType() {
  // getDegreeAndSem();
  var r_type = $("#r_type").val();
  if (r_type == "all_sub") {
    $("#all_subject_report").show();
    $("#subjectwise_report").hide();
  } else if (r_type == "subjectwise") {
    $("#all_subject_report").hide();
    $("#subjectwise_report").show();
  }
  getDegreeAndSemType();
}

function getDegreeAndSemType() {
  $.ajax({
    type: "GET",
    url: $host_url + "getDegreeAndSemType",
    success: function (response) {
      let res = JSON.parse(response);
      // console.log(res.data.length);
      // return;
      if (res.error_code == 0) {
        var degree = `<option>---Select---</option>`;
        for (var i = 0; i < res.data.length; i++) {
          degree += `<option value='${res.data[i].fdegree} - ${res.data[i].fdescpn}'>${res.data[i].fdegree} - ${res.data[i].fdescpn}</option>`;
        }
        $("#degree").html(degree);
        $("#s_degree").html(degree);
      } else {
        alert(res.data.msg);
        return;
      }
    },
  });
}

// function getDegreeAndSem() {
//   $.ajax({
//     type: "GET",
//     url: $host_url + "getDegreeAndSem",
//     success: function (res) {
//       let response = JSON.parse(res);
//       console.log(response);
//       if (response.error_code == 0) {
//         var degree = `<option>---Select---</option>`;
//         for (var i = 0; i < response.data.length; i++) {
//           degree += `<option value='${response.data[i].fdegree} - ${response.data.degree[i].fdescpn}'>${response.data.degree[i].fdegree} - ${response.data.degree[i].fdescpn}</option>`;
//         }
//         $("#degree").html(degree);
//         $("#s_degree").html(degree);
//       } else {
//         alert(response.data.msg);
//         return;
//       }
//     },
//   });
// }

function getIaMarksReport() {
  let degree = $("#degree").val();
  let sem = $("#semister").val();
  let fromreg = $("#fromreg").val();
  let toreg = $("#toreg").val();

  if (degree == "---Select---" || degree == "") {
    alert("Select Degree");
    return;
  }
  if (sem == "---select---" || sem == "" || sem == null) {
    alert("Select Exam No.");
    return;
  }
  if (fromreg == "") {
    alert("Enter from RegNo.");
    return;
  }
  if (toreg == "") {
    alert("Enter To RegNo.");
    return;
  }

  var parameter =
    "&degree=" +
    degree +
    "&sem=" +
    sem +
    "&fromreg=" +
    fromreg +
    "&toreg=" +
    toreg;

  // window.location.href =
  //   $host_url +
  //   "printIaMarks" +
  //   "&degree=" +
  //   degree +
  //   "&sem=" +
  //   sem +
  //   "&fromreg=" +
  //   fromreg +
  //   "&toreg=" +
  //   toreg;

  window.open($host_url + "printIaMarksDet" + parameter);
}

function semisterDet() {
  let degree = $("#degree").val();
  // console.log(degree);
  // return;
  $.ajax({
    type: "GET",
    data: "&degree=" + degree,
    url: $host_url + "getSemisterDetails",
    data: "&degree=" + degree,
    success: function (response) {
      let res = JSON.parse(response);
      // console.log(res);
      // return;
      if (res.error_code == 0) {
        var sem = `<option>---select---</option>`;
        for (var i = 0; i < res.data.length; i++) {
          sem += `<option value='${res.data[i].fexamno} - ${res.data[i].fexamname}'>${res.data[i].fexamno} - ${res.data[i].fexamname}</option>`;
        }
        $("#semister").html(sem);
        // $("#s_semister").html(sem);
      } else {
        alert(res.data.msg);
        return;
      }
    },
  });
}

function getSemister() {
  let degree = $("#s_degree").val();
  // console.log(degree);
  // return;
  $.ajax({
    type: "GET",
    data: "&degree=" + degree,
    url: $host_url + "getSemisterDetails",
    data: "&degree=" + degree,
    success: function (response) {
      let res = JSON.parse(response);
      // console.log(res);
      // return;
      if (res.error_code == 0) {
        var sem = `<option>---select---</option>`;
        for (var i = 0; i < res.data.length; i++) {
          sem += `<option value='${res.data[i].fexamno} - ${res.data[i].fexamname}'>${res.data[i].fexamno} - ${res.data[i].fexamname}</option>`;
        }
        // $("#semister").html(sem);
        $("#s_semister").html(sem);
      } else {
        alert(res.data.msg);
        return;
      }
    },
  });
}

function getSubject() {
  let degree = $("#s_degree").val();
  let semester = $("#s_semister").val();
  // console.log($degree);
  // return;
  $.ajax({
    type: "GET",
    data: "&degree=" + degree + "&sem=" + semester,
    url: $host_url + "getSubjectDetails",
    success: function (response) {
      let res = JSON.parse(response);
      // console.log(res);
      // return;
      var sub = `<option value="All">All</option>`;
      if (res.error_code == 0) {
        for (var i = 0; i < res.data.length; i++) {
          sub += `<option value='${res.data[i].fcsubcode}'>${res.data[i].fcsubcode} - ${res.data[i].fsubname}</option>`;
        }
        $("#subject").html(sub);
      } else {
        alert(res.data.msg);
        return;
      }
    },
  });
}

function getSection() {
  let degree = $("#s_degree").val();
  let sem = $("#s_semister").val();
  $.ajax({
    type: "GET",
    data: "&degree=" + degree + "&sem=" + sem,
    url: $host_url + "getSectionDetails",
    success: function (response) {
      let res = JSON.parse(response);
      // console.log(res);
      // return;
      var sec = `<option value="All">All</option>`;

      if (res.error_code == 0) {
        for (var i = 0; i < res.data.length; i++) {
          sec += `<option value='${res.data[i].fsection}'>${res.data[i].fsection}</option>`;
        }
        $("#section").html(sec);
      } else {
        alert(response.data.msg);
        return;
      }
    },
  });
}

function printMarkListSubWise() {
  let degree = $("#s_degree").val();
  let sem = $("#s_semister").val();
  let subject = $("#subject").val();
  let section = $("#section").val();
  let fregno = $("#fregno").val();
  let tregno = $("#tregno").val();
  let marks = $("#marks").val();

  if (degree == "" || degree == "---Select---") {
    alert("please Select Degree");
    return;
  }
  if (sem == "" || sem == "---select---") {
    alert("please Select examno");
    return;
  }
  if (marks == "") {
    alert("please enter marks");
    return;
  }
  let parameter =
    "&degree=" +
    degree +
    "&sem=" +
    sem +
    "&subject=" +
    subject +
    "&section=" +
    section +
    "&fregno=" +
    fregno +
    "&tregno=" +
    tregno +
    "&marks=" +
    marks +
    "_blank";
  // console.log(parameter);
  // return;
  window.open($host_url + "printMarkListSubWise" + parameter);
}