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


Current Path : /var/www/html/rcub/js/Report/
Upload File :
Current File : /var/www/html/rcub/js/Report/teacher_report.js

function CallEnableTeacherReport() {
  $("#page_main_div").load("html_modules/teacher_report.html", function () {
    document.getElementById("display_module_name").innerHTML =
      "Teachers Report";
    document.getElementById("module_name_for_save").value = "Teachers Report";
    getDefaultHeadFooterLinks("Teachers Report");
    //AssignTeachReportDropDownMenus();
  });
  getDesignation();
  getBaord();
  getScale();
}
function AssignTeachReportDropDownMenus() {
  $.ajax({
    type: "POST",
    url: $host_url + "AssignTeachDropDownMenus",
    data: "id=",
    success: AssignTeachReportDropDownMenusRepsonce,
  });
}
function AssignTeachReportDropDownMenusRepsonce($responce) {
  $responce = eval("(" + $responce + ")");

  document.getElementById("from_dept").options.length = 0;
  document.getElementById("to_dept").options.length = 0;
  document.getElementById("from_des").options.length = 0;
  document.getElementById("to_des").options.length = 0;

  var dept = $responce.data["dept"];
  var des = $responce.data["des"];

  $op = new Option("Select", "0");
  $op.id = "0";
  document.getElementById("from_dept").options.add($op);
  $op = new Option("Select", "0");
  $op.id = "0";
  document.getElementById("to_dept").options.add($op);
  $op = new Option("Select", "0");
  $op.id = "0";
  document.getElementById("from_des").options.add($op);
  $op = new Option("Select", "0");
  $op.id = "0";
  document.getElementById("to_des").options.add($op);
  for ($i = 0; $i < dept.length; $i++) {
    $op = new Option(dept[$i]["value"], dept[$i]["code"]);
    $op.id = dept[$i]["code"];
    document.getElementById("from_dept").options.add($op);
  }
  for ($i = 0; $i < dept.length; $i++) {
    $op = new Option(dept[$i]["value"], dept[$i]["code"]);
    $op.id = dept[$i]["code"];
    document.getElementById("to_dept").options.add($op);
  }
  for ($i = 0; $i < des.length; $i++) {
    $op = new Option(des[$i]["value"], des[$i]["code"]);
    $op.id = des[$i]["code"];
    document.getElementById("from_des").options.add($op);
  }
  for ($i = 0; $i < des.length; $i++) {
    $op = new Option(des[$i]["value"], des[$i]["code"]);
    $op.id = des[$i]["code"];
    document.getElementById("to_des").options.add($op);
  }
}

function GenerateTeacherReport() {
  var from_teach = $("#from_teach").val();
  var to_teach = $("#to_teach").val();
  var design = $("#designation").val();
  var rtype = $("#rtype").val();
  var board = $("#board").val();
  var scale = $("#scale").val();
  var work = $("#work").val();

  var str =
    "&from_teach=" +
    from_teach +
    "&to_teach=" +
    to_teach +
    "&design=" +
    design +
    "&board=" +
    board +
    "&scale=" +
    scale +
    "&work=" +
    work;
  if (rtype == "detailed") {
    window.location.href = $host_url + "GenerateTeacherReport" + str;
  } else if (rtype == "summary") {
    window.location.href = $host_url + "GenerateTeacherReportSummary" + str;
  }
}

function getDesignation() {
  $.ajax({
    type: "GET",
    url: $host_url + "getDesignation",
    success: function (res) {
      var des = JSON.parse(res);
      if (des.error_code == 0) {
        var design = `<option value='all'>All</option>`;
        for (var i = 0; i < des.data.length > 0; i++) {
          design += `<option value='${des.data[i].fdegndesc}'>${des.data[i].fdegndesc}</option>`;
        }
        $("#designation").html(design);
      } else {
        alert(des.data.msg);
        return;
      }
    },
  });
}

function getBaord() {
  $.ajax({
    type: "GET",
    url: $host_url + "getBoard",
    success: function (res) {
      var board = JSON.parse(res);

      if (board.error_code == 0) {
        var bor = `<option value='all'>All</option>`;
        for (var i = 0; i < board.data.length > 0; i++) {
          bor += `<option value='${board.data[i].fboardcode}'> ${board.data[i].fboardname}</option>`;
        }
        $("#board").html(bor);
      } else {
        alert(board.data.msg);
        return;
      }
    },
  });
}

function getScale() {
  $.ajax({
    type: "GET",
    url: $host_url + "getScale",
    success: function (res) {
      var scale = JSON.parse(res);

      if (scale.error_code == 0) {
        var sc = `<option value='all'>All</option>`;
        for (var i = 0; i < scale.data.length > 0; i++) {
          sc += `<option value='${scale.data[i].fscale}'> ${scale.data[i].fscale}</option>`;
        }
        $("#scale").html(sc);
      } else {
        alert(scale.data.msg);
        return;
      }
    },
  });
}