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


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

var db = window.location.pathname.split("/")[urlarr.length - 2];
function clearresultsheet() {
  $("#page_main_div").load(
    "../html_modules/resultsheet.html?v=1001",
    function () {
      document.getElementById("display_module_name").innerHTML = "Result Sheet";
      document.getElementById("module_name_for_save").value = "Result Sheet";
      getDefaultHeadFooterLinks("Result Sheet");
      getDegreeName();
      if (db === "jssstu") {
        $("#ressht").hide();
        $("#subwis").hide();
        $("#catwis").hide();
        $("#genwis").hide();
        $("#deggrp_row").hide();
      }
      $("#pie_degree").hide();
    }
  );
}
let degreeArr = [];

function getpopup() {
  $.ajax({
    type: "POST",
    url: $host_url + "getDegreeGroup",
    success: degreeDropDownMenusSuccess,
  });
}

function degreeDropDownMenusSuccess($responce) {
  $responce = eval("(" + $responce + ")");

  document.getElementById("deggrp").options.length = 0;
  var deg = $responce.data["deggrp"];

  $op = new Option("--Select--", "");
  document.getElementById("deggrp").options.add($op);
  for ($i = 0; $i < deg.length; $i++) {
    $op = new Option(deg[$i]["VALUE"], deg[$i]["internal_code"]);
    $op.id = deg[$i]["internal_code"];
    document.getElementById("deggrp").options.add($op);
  }
}

function getDegreeName() {
  $.ajax({
    type: "POST",
    url: $host_url + "getResDegreeName",
    success: getResDegreeNameSuccess,
  });
  $("#typereport").hide();
}

function getResDegreeNameSuccess($responce) {
  $responce = eval("(" + $responce + ")");

  document.getElementById("degree").options.length = 0;
  var deg = $responce.data["degree"];

  $op = new Option("--Select--", "");
  document.getElementById("degree").options.add($op);
  for ($i = 0; $i < deg.length; $i++) {
    $op = new Option(deg[$i]["VALUE"], deg[$i]["internal_code"]);
    $op.id = deg[$i]["internal_code"];
    document.getElementById("degree").options.add($op);
  }
}

function getDegreeExamName() {
  degreeArr = degreeArr = [];
  document.getElementById("piedegree").options.length = 0;
  var reptpy = $("#reporttype").val();
  if (reptpy === "barchart") {
    $("#even_odd").show();
    // $("#deggrp_row").show();
    $("#exam_no").hide();
  } else {
    $("#exam_no").show();
    $("#even_odd").hide();
    // $("#degree_row").show();
    // $("#section_row").show();
  }

  if (
    reptpy === "deggrp" ||
    reptpy === "semwiseresult" ||
    reptpy === "barchart" ||
    reptpy === "SWRA" ||
    reptpy === "CW"
  ) {
    $("#deggrp_row").show();
    $("#degree_row").hide();
    $("#pie_degree").show();
    $("#section_row").hide();

    var degree = $("#deggrp").val();
    var type = "deggrp";
    loaddeggrp();
  } else {
    $("#deggrp_row").hide();
    $("#pie_degree").hide();
    $("#degree_row").show();
    $("#section_row").show();

    var degree = $("#degree").val();
    var type = "degree";
  }

  // if (reptpy === "CW") {
  //   $("#deggrp_row").show();
  //   $.ajax({
  //     type: "POST",
  //     url: $host_url + "loaddeggrp",
  //     success: function (res) {
  //       let response = JSON.parse(res);
  //       if (response.error_code == 0) {
  //         var deggrp = response.data;
  //         var $op = `<option value=''>---select---</option>`;
  //         for ($i = 0; $i < deggrp.length; $i++) {
  //           $op += `<option value='${deggrp[$i]["code"]}'>${deggrp[$i]["value"]}</option>`;
  //         }
  //         $("#deggrp").html($op);
  //       }
  //     },
  //   });
  // }
  if (db === "jssstu") {
    if (reptpy == "SWRAG") {
      $("#typereport").show();
    } else {
      $("#typereport").hide();
    }
  } else {
    $("#typereport").hide();
  }

  // geExamData(degree, type);
  getExamdateExamName(degree, type);
}

function geExamData(degree, type) {
  console.log(degree, type);
  $.ajax({
    type: "POST",
    url: $host_url + "getDegreeResExamName",
    data: "&degree=" + degree + "&type=" + type,
    success: getDegreeResExamNameSuccess,
  });
}

function getDegreeResExamNameSuccess($responce) {
  degreeArr = [];
  $responce = eval("(" + $responce + ")");

  document.getElementById("degexam").options.length = 0;
  document.getElementById("yearmode").options.length = 0;
  document.getElementById("section").options.length = 0;
  document.getElementById("piedegree").options.length = 0;

  var deg = $responce.data["degexam"];
  var degexamdate = $responce.data["degexamdate"];
  var fsection = $responce.data["fsection"];
  var fdegree = $responce.data["degree"];

  $op = new Option("--Select--", "");
  document.getElementById("degexam").options.add($op);
  for ($i = 0; $i < deg.length; $i++) {
    $op = new Option(deg[$i]["VALUE"], deg[$i]["internal_code"]);
    $op.id = deg[$i]["internal_code"];
    document.getElementById("degexam").options.add($op);
  }

  $op = new Option("--Select--", "");
  document.getElementById("yearmode").options.add($op);
  for ($i = 0; $i < degexamdate.length; $i++) {
    $op = new Option(
      degexamdate[$i]["VALUE"],
      degexamdate[$i]["internal_code"]
    );
    $op.id = degexamdate[$i]["internal_code"];
    document.getElementById("yearmode").options.add($op);
  }

  $op = new Option("All", "All");
  document.getElementById("section").options.add($op);
  for ($i = 0; $i < fsection.length; $i++) {
    $op = new Option(fsection[$i]["fsection"], fsection[$i]["fsection"]);
    $op.id = fsection[$i]["fsection"];
    document.getElementById("section").options.add($op);
  }

  $op = new Option("All", "All");
  document.getElementById("piedegree").options.add($op);
  for ($i = 0; $i < fdegree.length; $i++) {
    $op = new Option(fdegree[$i]["VALUE"], fdegree[$i]["internal_code"]);
    $op.id = fdegree[$i]["internal_code"];
    document.getElementById("piedegree").options.add($op);
  }
}

function changePieDegree() {
  degreeArr = $("#piedegree").val() || [];
}
// function changePieDegree(el) {
//   let ind = degreeArr.indexOf(el);
//   if (ind > -1) degreeArr.splice(ind, 1);
//   degreeArr.push(el);
// }

function generesultsheet() {
  var degree = document.getElementById("degree").value;
  var degexam = document.getElementById("degexam").value;
  var reporttype = document.getElementById("reporttype").value;
  var yearmode = document.getElementById("yearmode").value;
  var section = document.getElementById("section").value;
  var type = document.getElementById("typepie").value;
  var degreegrp = document.getElementById("deggrp").value;
  var semwiseresult = document.getElementById("semwiseresult").value;

  var dammy = document.getElementById("barchart").value;
  var evenodd = document.getElementById("evennoddsem").value;

  if (
    reporttype !== "deggrp" &&
    reporttype !== "semwiseresult" &&
    reporttype !== "barchart" &&
    reporttype !== "SWRA" &&
    reporttype !== "CW" &&
    degree == ""
  ) {
    alert("Please Select Degree");
    $("#degree").focus();
    return;
  }

  if (reporttype !== "barchart" && degexam == "") {
    alert("Please Select Exam");
    $("#degexam").focus();
    return;
  }
  if (reporttype == "") {
    alert("Please select Report Type..!");
    $("#reporttype").focus();
    return;
  }

  if (yearmode == "") {
    alert("Please select Exam Date");
    $("#yearmode").focus();
    return;
  }
  if (db == "jssstu") {
    if (reporttype === "SWRAG") {
      if (type == "") {
        alert("Please select Type");
        $("#yearmode").focus();
        return;
      }
    }
  }
  if (reporttype === "CW") {
    window.open(
      $host_url +
        "categorywiseresultsheet.demo&degree=" +
        degree +
        "&deggrp=" +
        degreegrp +
        "&degexam=" +
        degexam +
        "&yearmode=" +
        yearmode +
        "&section=" +
        section
    );
    console.log(degree, degreegrp, degexam, yearmode, section, "bzjchvjhx");
  } else if (reporttype === "GW") {
    window.open(
      $host_url +
        "genwiseressheet.demo&degree=" +
        degree +
        "&degexam=" +
        degexam +
        "&yearmode=" +
        yearmode +
        "&section=" +
        section
    );
  } else if (reporttype === "RS") {
    window.open(
      $host_url +
        "generesultsheet.demo&degree=" +
        degree +
        "&degexam=" +
        degexam +
        "&yearmode=" +
        yearmode +
        "&section=" +
        section
    );
  } else if (reporttype === "RSSTDW") {
    window.open(
      $host_url +
        "studentwiseresult.demo&degree=" +
        degree +
        "&degexam=" +
        degexam +
        "&yearmode=" +
        yearmode +
        "&section=" +
        section
    );
  } else if (reporttype === "SW") {
    window.open(
      $host_url +
        "subjwiseressheet.demo&degree=" +
        degree +
        "&degexam=" +
        degexam +
        "&yearmode=" +
        yearmode +
        "&section=" +
        section
    );
  } else if (reporttype === "SWPP") {
    window.open(
      $host_url +
        "subjwisepasspercentage.demo&degree=" +
        degree +
        "&degexam=" +
        degexam +
        "&yearmode=" +
        yearmode +
        "&section=" +
        section
    );
  } else if (reporttype === "SWRAG") {
    if (db == "jssstu") {
      if (type == "pie") {
        // var api = "subwiseGrafAnalysis";
        window.open(
          "https://college.universitysolutions.in/html_modules/subjectwisePiechart.html?degree=" +
            degree +
            "&degexam=" +
            degexam +
            "&yearmode=" +
            yearmode +
            "&section=" +
            section +
            "&db=" +
            db
        );
      } else if (type == "marksreport") {
        var api = "gradewisesubjectanalysis";
      }
    } else {
      var api = "gradewisesubjectanalysis";
    }
    window.open(
      $host_url +
        api +
        "&degree=" +
        degree +
        "&degexam=" +
        degexam +
        "&yearmode=" +
        yearmode +
        "&section=" +
        section
    );
  } else if (reporttype === "deggrp") {
    window.open(
      "https://college.universitysolutions.in/html_modules/deggrpwisepiechart.html?deggrp=" +
        degreegrp +
        "&degexam=" +
        degexam +
        "&yearmode=" +
        yearmode +
        "&db=" +
        db +
        "&degree=" +
        degreeArr
    );
  } else if (reporttype === "semwiseresult") {
    window.open(
      "https://college.universitysolutions.in/html_modules/semwiseresultanalysis.html?deggrp=" +
        degreegrp +
        "&degexam=" +
        degexam +
        "&yearmode=" +
        yearmode +
        "&db=" +
        db +
        "&degree=" +
        degreeArr
    );
  } else if (reporttype === "barchart") {
    window.open(
      "https://college.universitysolutions.in/html_modules/Barchart.html?deggrp=" +
        degreegrp +
        "&evennoddsem=" +
        evenodd +
        "&yearmode=" +
        yearmode +
        "&db=" +
        db +
        "&degree=" +
        degreeArr
    );
  } else if (reporttype === "RSOA") {
    window.open(
      $host_url +
        "getresultsheetoverall&degree=" +
        degree +
        "&degexam=" +
        degexam +
        "&yearmode=" +
        yearmode +
        "&section=" +
        section
    );
  } else if (reporttype === "SWRA") {
    window.open(
      $host_url +
        "semesterwiseresultanalysis&deggrp=" +
        degreegrp +
        "&degexam=" +
        degexam +
        "&yearmode=" +
        yearmode +
        "&degree=" +
        degreeArr
    );
  } else {
    window.open(
      $host_url +
        "generesultsheet.demo&degree=" +
        degree +
        "&degexam=" +
        degexam +
        "&yearmode=" +
        yearmode +
        "&section=" +
        section
    );
  }

  //   window.location.href =
  //     $host_url + "generesultsheet.demo&degree=" + degree + "&degexam=" + degexam;
}

function loaddeggrp() {
  degreeArr = [];
  document.getElementById("piedegree").options.length = 0;
  $.ajax({
    type: "POST",
    url: $host_url + "loaddeggrp",
    success: loaddeggrpResponse,
  });
}

function loaddeggrpResponse($responce) {
  $responce = eval("(" + $responce + ")");
  if ($responce.error_code == -1) {
    alert($responce.data);
    return;
  } else {
    var deggrp = $responce.data;
    var $op = `<option value=''>---select---</option>`;
    for ($i = 0; $i < deggrp.length; $i++) {
      $op += `<option value='${deggrp[$i]["code"]}'>${deggrp[$i]["value"]}</option>`;
    }
    $("#deggrp").html($op);
  }
}

function getExamdateExamName(degree, type) {
  if (degree === undefined) {
    var degree = $("#deggrp").val();
    var type = "deggrp";
  }
  geExamData(degree, type);
}