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


Current Path : /var/www/oasis/js/
Upload File :
Current File : /var/www/oasis/js/iatimetable.js

function calliatimetable() {
  $("#page_main_div").load("../html_modules/iatimetable.html", function () {
    document.getElementById("display_module_name").innerHTML =
      "IA Time Table";
    document.getElementById("module_name_for_save").value =
      "IA Time Table";
    getDefaultHeadFooterLinks("IA Time Table");
    getIADegreeName();
  });
}

function getIADegreeName() {
  $.ajax({
    type: "POST",
    url: $host_url + "getIaDegName",
    success: getIaDegNameSuccess,
  });
}

function getIaDegNameSuccess($responce) {
  $responce = eval("(" + $responce + ")");

  document.getElementById("degree").options.length = 0;
  var deg = $responce.data["degree"];

  //console.log(deg);
  $op = new Option("--Select--", "");
  document.getElementById("degree").options.add($op);
  for ($i = 0; $i < deg.length; $i++) {
    $op = new Option(deg[$i]["VALUE"], deg[$i]["internal_code"]);
    //console.log(deg[$i]['value']);
    $op.id = deg[$i]["internal_code"];
    document.getElementById("degree").options.add($op);
  }
}

function getIADegreeExamName() {
  var degree = $("#degree").val();

  $.ajax({
    type: "POST",
    url: $host_url + "getIADegreeExamName",
    data: "&degree=" + degree,
    success: getIADegreeExamNameSuccess,
  });
}

function getIADegreeExamNameSuccess($responce) {
  $responce = eval("(" + $responce + ")");
  document.getElementById("degexam").options.length = 0;
  var deg = $responce.data["degexam"];
  //console.log(deg);
  $op = new Option("--Select--", "");
  document.getElementById("degexam").options.add($op);
  for ($i = 0; $i < deg.length; $i++) {
    $op = new Option(deg[$i]["VALUE"], deg[$i]["internal_code"]);
    //console.log(deg[$i]['value']);
    $op.id = deg[$i]["internal_code"];
    document.getElementById("degexam").options.add($op);
    //console.log(degree);
  }
}

function displayIATimetable() {
  var degree = document.getElementById("degree").value;
  var degexam = document.getElementById("degexam").value;

  if (degree == "") {
    alert("Please select Degree");
    return;
  }

  if (degexam == "") {
    alert("Please select Semister");
    return;
  }

  $.ajax({
    type: "POST",
    url: $host_url + "displayIATimetable",
    data: "&degree=" + degree + "&degexam=" + degexam,
    success: displayIATimetableSuccess,
  });
}

function displayIATimetableSuccess($responce) {
  $responce = eval("(" + $responce + ")");
  $("#btc_default_reg_div").html("");
  $("#btc_default_reg_div").html($responce.data["tabledata"]);
}

function getValidateMarks(maxmarks, regno, subcode) {
  let marks = $("#mes_marks_" + subcode + "_" + regno).val();
  if (marks == "") {
    marks = 0;
  }
  if (parseInt(marks) > parseInt(maxmarks)) {
    alert("Please Enter Valid Marks");
    $("#mes_marks_" + subcode + "_" + regno).val("");
    document.getElementById("mes_marks_" + subcode + "_" + regno).focus();
    return;
  }
}

function saveIATimetable() {
  var degree = document.getElementById("degree").value;
  var degexam = document.getElementById("degexam").value;

  if (degree == "") {
    alert("Please select Degree");
    return;
  }

  if (degexam == "") {
    alert("Please select Semister");
    return;
  }

  let subarry = [];
  $("#showteachsub input[type=hidden]").each(function () {
    let id = $(this).attr("id");

    if ($(`#${id}`).val() == "U") {
      let sucodeid = $(this).attr("id").split("_");
      let sublen = {};
      sublen["subcode"] = sucodeid[1];
      sublen["doe"] = $(`#doe_${sucodeid[1]}`).val();
      sublen["time"] = $(`#time_${sucodeid[1]}`).val();
      subarry.push(sublen);
    }
  });
 
  $.ajax({
    type: "POST",
    url: $host_url + "saveIATimetable",
    data:
      `&degree=` +
      degree +
      `&degexam=` +
      degexam +
      `&subarry=` +
      JSON.stringify(subarry),
    success: saveIATimetabletSuccess,
  });
}

function saveIATimetabletSuccess($responce) {
  $responce = eval("(" + $responce + ")");
  alert($responce.data);
  callStudSubIdent();
  $("#btc_default_reg_div").html("");
  return;
}

function getiaupdate(id) {
  let idnew = id.split("_");
  console.log(idnew);
  console.log(idnew[1]);
  $(`#h_${idnew[1]}`).val("U");
}