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


Current Path : /proc/thread-self/root/var/www/oasis/js/
Upload File :
Current File : //proc/thread-self/root/var/www/oasis/js/qnwiseMarksStats.js

function callEnableMarksStatistics() {
  $("#page_main_div").load(
    "../html_modules/qnwiseMarksStats.html?v=1122",
    function () {
      document.getElementById("display_module_name").innerHTML =
        "Marks Entry Statistics";
      document.getElementById("module_name_for_save").value =
        "Marks Entry Statistics";
      getDefaultHeadFooterLinks("Marks Entry Statistics");
      getMarksStatsSubElements();
    }
  );
}

function getMarksStatsSubElements() {
  $.blockUI({
    message:
      "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>",
  });
  $.ajax({
    type: "GET",
    url: $host_url + "getSubDetSubElements",
    success: function (res) {
      let response = JSON.parse(res);
      if (response.error_code === 0) {
        let opt = `<option value=''>---select---</option>`;
        for (var i = 0; i < response.data.length; i++) {
          opt += `<option value='${response.data[i].fsubname}'>${response.data[i].fsubname}</option>`;
        }
        $("#subelement").html(opt);
        $.unblockUI();
      } else {
        alert(response.data.msg);
        $.unblockUI();
        return;
      }
    },
  });
}

function getMarksStatsTest() {
  let subElement = $("#subelement").val();
  $.blockUI({
    message:
      "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>",
  });
  $.ajax({
    type: "GET",
    url: $host_url + "getSubDetMaxTest",
    data: "subElement=" + subElement,
    success: function (res) {
      let response = JSON.parse(res);
      if (response.error_code === 0) {
        let opt = `<option value=''>---select---</option>`;
        for (var i = 1; i <= response.data.notest.fnotest; i++) {
          opt += `<option value='${"Test " + [i]}'>${"Test " + [i]}</option>`;
        }

        let semOpt = `<option value=''>---select---</option>`;
        for (var i = 0; i < response.data.sem.length; i++) {
          semOpt += `<option value='${response.data.sem[i].fexamno}'>${response.data.sem[i].fexamname}</option>`;
        }
        $("#sem").html(semOpt);
        $("#test").html(opt);
        $.unblockUI();
      } else {
        alert(response.data.msg);
        $.unblockUI();
        return;
      }
    },
  });
}

function getMarksStatsDegree() {
  let subElement = $("#subelement").val();
  let test = $("#test").val();
  let sem = $("#sem").val();

  $.blockUI({
    message:
      "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>",
  });
  $.ajax({
    type: "GET",
    url: $host_url + "getSubDetDegree",
    data: "subElement=" + subElement + "&test=" + test + "&sem=" + sem,
    success: function (res) {
      let response = JSON.parse(res);
      if (response.error_code === 0) {
        let opt = `<option value='all'>All</option>`;
        for (var i = 0; i < response.data.length; i++) {
          opt += `<option value='${response.data[i].fdegree}'>${
            response.data[i].fdegree + " - " + response.data[i].fdescpn
          }</option>`;
        }
        $("#degree").html(opt);
        $.unblockUI();
      } else {
        alert(response.data.msg);
        $.unblockUI();
        return;
      }
    },
  });
}

function viewSummaryMarksStats() {
  let subElement = $("#subelement").val();
  let test = $("#test").val();
  let sem = $("#sem").val();
  let degree = $("#degree").val();

  $.blockUI({
    message:
      "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>",
  });
  $("#subdata").hide();

  $.ajax({
    type: "GET",
    url: $host_url + "getMarksEntryStats",
    data:
      "subElement=" +
      subElement +
      "&test=" +
      test +
      "&sem=" +
      sem +
      "&degree=" +
      degree,
    success: function (res) {
      let response = JSON.parse(res);

      let table = `<table style='width: 100%;' cellspacing='0'>`;
      table += `<thead>
                    <tr><th style='padding:5px;' align='left' colspan='5' class='ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper'>
                    <div style='display: flex; justify-content: space-between'>
                    <div>
                      Degreewise Marks Entry Details 
                    </div>
                    <div>
                      <span class='btn' 
                      onclick="getDegreeWiseStatsReport()">Report</span>
                    </div>
                    </div>
                    </th></tr>
                    <tr align='center' class='ui-state-default ui-jqgrid-hdiv'>
                        <th class='column'>Sl. No.</th>
                        <th class='column'>Degree</th>
                        <th class='column'>Description</th>
                        <th class='column'>Entered / Total</th>
                        <th class='column'>Action</th>
                    </tr>
                </thead><tbody>`;

      if (response.data.length > 0) {
        for (var i = 0; i < response.data.length; i++) {
          table += `<tr align='center'>
                            <td class='column'>${i + 1}</td>
                            <td class='column'>${response.data[i].fdegree}</td>
                            <td class='column' align='left'>${
                              response.data[i].fdescpn
                            }</td>
                            <td class='column'>${
                              response.data[i].entered +
                              " / " +
                              response.data[i].count
                            } </td>
                            <td class='column'>
                            <span class='btn' 
                            onclick="viewSubjectWiseMarksStats('${
                              response.data[i].fdegree
                            }')">View</span>
                            </td>
                        </tr>`;
        }
      } else {
        table += `<tr>
                        <td colspan='5'>No data found</td>
                    </tr>`;
      }
      table += `</tbody></table>`;
      $("#tabledata").html(table);
      $("#tabledata").show();
      $.unblockUI();
    },
  });
}

function viewSubjectWiseMarksStats(degree) {
  let subElement = $("#subelement").val();
  let test = $("#test").val();
  let sem = $("#sem").val();
  $.blockUI({
    message:
      "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>",
  });
  $("#tabledata").hide();

  $.ajax({
    type: "GET",
    url: $host_url + "viewSubjectWiseMarksStats",
    data:
      "subelement=" +
      subElement +
      "&test=" +
      test +
      "&sem=" +
      sem +
      "&degree=" +
      degree,
    success: function (response) {
      let res = JSON.parse(response);
      let table = `<table style='width: 100%;' cellspacing='0'>`;
      table += `<thead>
                    <tr>
                        <th style='padding:5px;' align='left' colspan='5' class='ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper'>
                            Subjectwise Marks Entry Details 
                            <span style='float:right;' class='btn' 
                            onclick="goback()">Back</span></th>
                            
                        </tr>
                    <tr align='center' class='ui-state-default ui-jqgrid-hdiv'>
                        <th class='column'>Sl. No.</th>
                        <th class='column'>Degree</th>
                        <th class='column'>Subject Name</th>
                        <th class='column'>Subshort</th>
                        <th class='column'>Entered / Total</th>
                    </tr>
                </thead><tbody>`;

      if (res.data.length > 0) {
        for (var i = 0; i < res.data.length; i++) {
          table += `<tr align='center'>
                            <td class='column'>${i + 1}</td>
                            <td class='column'>${res.data[i].fdegree}</td>
                            <td class='column' align='left'>${
                              res.data[i].fsubname
                            }</td>
                            <td class='column'> ${res.data[i].fsubshort}</td>
                            <td class='column'>
                           ${res.data[i].entered + " / " + res.data[i].count}
                            </td>
                        </tr>`;
        }
      } else {
        table += `<tr>
                        <td colspan='5'>No data found</td>
                    </tr>`;
      }
      table += `</tbody></table>`;
      $("#subdata").html(table);
      $("#subdata").show();
      $.unblockUI();
    },
  });
}

function goback() {
  $("#tabledata").show();
  $("#subdata").hide();
}

function getDegreeWiseStatsReport() {
  let subElement = $("#subelement").val();
  let test = $("#test").val();
  let sem = $("#sem").val();
  let degree = $("#degree").val();

  let parameters =
    "&subelement=" +
    subElement +
    "&test=" +
    test +
    "&sem=" +
    sem +
    "&degree=" +
    degree;

  window.open($host_url + "getDegreeWiseStatsReport" + parameters);
}