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


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

/*
 *
 * PROGRAMED BY Prashanth
 * FOR THE Enable or block Exam application, Concession Fee and Hall Ticket
 * DATE: 10/08/1018
 * TIME: 2:11 PM
 *
 */
$g_fmacs_total_row_count = 0;
$g_fmacas_org_rem_sub = "";
$g_fmacas_rem_sub = "";
function callenablehtblk() {
  $g_fmacs_total_row_count = 0;
  $g_fmacas_rem_sub = "";
  $g_fmacas_org_rem_sub = "";
  $("#page_main_div").load("../html_modules/htblk.html", function () {
    document.getElementById("display_module_name").innerHTML =
      "Hall Ticket block";
    document.getElementById("module_name_for_save").value = "ECHblk";
    document.getElementById("is_add_edit").value = "Add";
    getDefaultHeadFooterLinks("Hall Ticket block");
  });
}

function gethtblkStudents() {
  if (trim(document.getElementById("ech_degree_code").value) == "") {
    alert("Please enter the Degree Code");
    $("#ech_degree_code").focus();
    return;
  }
  if (trim(document.getElementById("reg_from").value) == "") {
    alert("Please enter register No. from");
    $("#reg_from").focus();
    return;
  }
  if (trim(document.getElementById("reg_to").value) == "") {
    alert("Please enter register No. to");
    $("#reg_to").focus();
    return;
  }
  $("#ech_module_student_data").html("");
  $.blockUI({
    message:
      "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>",
  });
  $.ajax({
    type: "POST",
    data:
      "&degree=" +
      $("#ech_degree_code").val() +
      "&reg_from=" +
      $("#reg_from").val() +
      "&reg_to=" +
      $("#reg_to").val(),
    url: $host_url + "gethtblkStudents.demo",
    success: gethtblkStudentsResponce,
  });
}

var total;
function gethtblkStudentsResponce($responce) {
  $.unblockUI();
  $responce = eval("(" + $responce + ")");
  if ($responce.error_code == 0) {
    document.getElementById("ech_degree_code").disabled = true;
    document.getElementById("reg_from").disabled = true;
    document.getElementById("reg_to").disabled = true;

    $("#ech_module_student_data").show();
    $("#ech_module_student_data").html("");
    $("#ech_module_student_data").html($responce.data.html_data);
    total = $responce.data.total_count;

    $g_fmacas_org_rem_sub = $responce.data.rem_sub;
    $g_fmacas_rem_sub = $responce.data.rem_sub;
  } else {
    $("#ech_module_student_data").show();
    $("#ech_module_student_data").html("");
    // $g_fmacas_total_row_count=0;
    alert($responce.data.msg);
  }
}

function savehtblkStudents() {
  if (trim(document.getElementById("ech_degree_code").value) == "") {
    alert("Please enter the Degree. Code");
    document.getElementById("ech_degree_code").focus();
    return;
  }

  var rgECH = [];
  if ($("#ech_module_student_data [name='hidden']:checked").length == 0) {
    alert("No changes Made!");
    $("#ech_module_student_data").html("");
    document.getElementById("ech_degree_code").disabled = false;
    return;
  }
  $("#ech_module_student_data [name='hidden']:checked").each(function () {
    var obj = {};
    let regno = $(this).attr("id");
    obj.regno = regno.substr(2);
    if ($(this).parents("tr").find("input[name='hallticket']").is(":checked")) {
      obj.hallticket = "Yes";
    } else {
      obj.hallticket = "No";
    }
    rgECH.push(obj);
  });
  var strECH = JSON.stringify(rgECH);
  console.log(strECH);

  $.ajax({
    type: "POST",
    data: "degree=" + $("#ech_degree_code").val() + "&strECH=" + strECH,
    url: $host_url + "savehtblkStudents.demo",
    success: savehtblkStudentsResponce,
  });
}

function savehtblkStudentsResponce($responce) {
  $responce = eval("(" + $responce + ")");
  alert($responce.data);
  $g_fmacas_rem_sub = $g_fmacas_org_rem_sub;
  $("#ech_module_student_data").html("");
  document.getElementById("ech_degree_code").disabled = false;
  document.getElementById("reg_from").disabled = false;
  document.getElementById("reg_to").disabled = false;
}

function statusChanged(obj) {
  $(obj).parents("tr").find("input[name='hidden']").attr("checked", "checked");
}

function selectall() {
  var k;
  if (document.getElementById("elig").checked == true) {
    for (k = 1; k < parseInt(total); k++) {
      var regno = document.getElementById("hregno_" + k).value;
      // document.getElementById("eligibility_" + k).checked = true;
      $("#eligibility_" + k + ":enabled").attr("checked", "checked");
      document.getElementById("h_" + regno).checked = true;
    }
  } else {
    for (k = 1; k < total; k++) {
      var regno = document.getElementById("hregno_" + k).value;
      // document.getElementById("eligibility_" + k).checked = false;
      $("#eligibility_" + k + ":enabled").attr("checked", false);
      document.getElementById("h_" + regno).checked = true;
    }
  }
}

function selecthtall() {
  var k;
  if (document.getElementById("ht").checked == true) {
    //alert(total);
    for (k = 1; k < parseInt(total); k++) {
      var regno = document.getElementById("hregno_" + k).value;
      document.getElementById("ht_" + k).checked = true;
      document.getElementById("h_" + regno).checked = true;
    }
  } else {
    for (k = 1; k < total; k++) {
      var regno = document.getElementById("hregno_" + k).value;
      document.getElementById("ht_" + k).checked = false;
      document.getElementById("h_" + regno).checked = true;
    }
  }
}