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


Current Path : /var/www/html/stph/js/
Upload File :
Current File : /var/www/html/stph/js/subshort.js

function subjectwiseblock() {
  $g_mes_valid_reg_no = 0;
  $geditinternalcode = 0;
  $g_mes_save_after_error_flag = 0;
  $g_mes_edit_valid_marks_flag = 0;
  $limit_start = 0;
  $limit = 0;

  $("#page_main_div").load(
    "html_modules/subshort.html?v=31072017",
    function () {
      document.getElementById("display_module_name").innerHTML =
        "Subject Wise Block";
      document.getElementById("module_name_for_save").value =
        "Subject Wise Block";
      getDefaultHeadFooterLinks("Subject Wise Block");

      $("#main_mark_entry_div").hide();
      $("#markentry_sub_degree_code").focus();
      document.getElementById("markentry_sub_degree_code").disabled = false;
      document.getElementById("markentry_sub_final_subcode").disabled = false;
      document.getElementById("markentry_sub_Examno").disabled = false;
      loadExamAppDegree();
    }
  );
  $("#module_details_div").hide();
}

// Svae All Date  From Mark Entry Subjectwise Module
function saveSubjectwiseBlock() {
  var att_data = new Object();
  var validstatus = false;
  html_objects = $("input[id*='h_']");
  jQuery.each(html_objects, function (k, v) {
    var internal_code = v["id"].split("_")[1];
    if ($("#h_" + internal_code).val() == "U") {
      att_data[internal_code] = new Object();
      var status = "F";
      if (document.getElementById(`${internal_code}`).checked == true) {
        status = "T";
      } else {
        status = "F";
      }
      att_data[internal_code]["status"] = status;
      att_data[internal_code]["fregno"] = internal_code;
      att_data[internal_code]["remarks"] = $("#remarks_" + internal_code).val();
    }
  });
  console.log(att_data);

  var myJSONText = encodeURIComponent(JSON.stringify(att_data));
  $list_data +=
    "&output_details=" +
    myJSONText +
    "&fdegree=" +
    $("#markentry_sub_degree_code").val() +
    "&fexamno=" +
    $("#markentry_sub_Examno").val() +
    "&fsubcode=" +
    $("#markentry_sub_final_subcode").val();
  $.ajax({
    type: "POST",
    async: false,
    url: $host_url + "saveSubjectwiseBlock",
    data: $list_data,
    success: saveSubjectwiseBlockResponce,
  });
} // END SAVE

function saveSubjectwiseBlockResponce($responce) {
  $responce = eval("(" + $responce + ")");
  if ($responce.error_code == 0) {
    alert($responce.data);
    $("#markentry_sub_degree_code").focus;
  } else {
    alert($responce.data);
  }
}

function GetSubShortRegisterNumbers() {
  //alert('calling');
  $("#mes_default_reg_div").hide();

  let degree = $("#markentry_sub_degree_code").val();
  let examno = $("#markentry_sub_Examno").val();
  let subject = $("#markentry_sub_final_subcode").val();

  if (degree == "" || degree == "---Select---" || degree == null) {
    alert("Enter Degree");
    return;
  }
  if (examno == "" || examno == "---Select---" || examno == null) {
    alert("Select Exam");
    return;
  }
  if (subject == "" || subject == "---Select---" || subject == null) {
    alert("Select Subject ");
    return;
  }

  $list_data = "fdegree=" + $("#markentry_sub_degree_code").val();
  $list_data += "&fsubcode=" + $("#markentry_sub_final_subcode").val();
  $list_data += "&fexamno=" + $("#markentry_sub_Examno").val();

  $.blockUI({
    message:
      "<h1 class='h1' style='font-size:12px'><img src='images/ajax-loader.gif' border='0'></h1>",
  });
  $.ajax({
    type: "POST",
    //async:false,
    url: $host_url + "GetSubShortRegisterNumbers",
    data: $list_data,
    success: GetSubShortRegisterNumbersNosResponse,
  });
}

function GetSubShortRegisterNumbersNosResponse($responce) {
  $responce = eval("(" + $responce + ")");
  $.unblockUI();
  if ($responce.error_code == 0) {
    $("#main_mark_entry_div").hide();
    $("#mes_default_reg_div").show();
    mes_default_reg_div;
    document.getElementById("markentry_sub_degree_code").disabled = true;
    document.getElementById("markentry_sub_final_subcode").disabled = true;
    document.getElementById("markentry_sub_Examno").disabled = true;
    $("#mes_default_reg_div").html($responce.data.table);
  }
}

function updatehiddenfiled(reg) {
  document.getElementById("h_" + reg).value = "U";
}

function shortageReport() {
  parameters =
    "&fdegree=" +
    trim($("#markentry_sub_degree_code").val()) +
    "&fexamno=" +
    trim($("#markentry_sub_Examno").val()) +
    "&fsubcode=" +
    trim($("#markentry_sub_final_subcode").val());
  window.open($host_url + "shortageReport.demo" + parameters);
}

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

function loadExamAppExamno() {
  let degree = $("#markentry_sub_degree_code").val();
  $.ajax({
    type: "GET",
    url: $host_url + "loadExamAppExamno",
    data: "&degree=" + degree,
    success: function (res) {
      let response = JSON.parse(res);
      if (response.error_code == 0) {
        var examno = "<option>---Select---</option>";
        for (let i in response.data) {
          examno += `<option value=${response.data[i].fexamno}>${response.data[i].fexamno} - ${response.data[i].fexamname}</option>`;
          i++;
        }
        $("#markentry_sub_Examno").html(examno);
      } else {
        alert(response.data);
        return;
      }
    },
  });
}

function loadExamAppSubject() {
  let degree = $("#markentry_sub_degree_code").val();
  let examno = $("#markentry_sub_Examno").val();
  $.ajax({
    type: "GET",
    url: $host_url + "loadExamAppSubject",
    data: "&degree=" + degree + "&examno=" + examno,
    success: function (res) {
      let response = JSON.parse(res);
      if (response.error_code == 0) {
        var subject = "<option>---Select---</option>";
        for (let i in response.data) {
          subject += `<option value=${response.data[i].fsubcode}>${response.data[i].fsubcode} - ${response.data[i].fsubname}</option>`;
          i++;
        }
        $("#markentry_sub_final_subcode").html(subject);
      } else {
        alert(response.data);
        return;
      }
    },
  });
}