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


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

function callCourseRep() 
{
  $("#page_main_div").load(
    "../html_modules/courserep.html",
    function () 
    {
      document.getElementById("display_module_name").innerHTML =
        "Course Registration (Supply)";
      document.getElementById("module_name_for_save").value =
        "Course Registration (Supply)";
      getDefaultHeadFooterLinks("Course Registration (Supply)");
      $("#semTitle").html("Semester");
      // console.log(db);
      loadDegreeCourseRep();
    }
  );
}

function loadDegreeCourseRep() {
  $.ajax({
    type: "GET",
    url: $host_url + "loadDegreeCourseRep",
    success: function (res) {
      let response = JSON.parse(res);
      console.log(response);
      let options = "";
      if (response.error_code === 0) {
        options += `<option>---select---</option>`;
        for (let i in response.data) {
          options += `<option value='${response.data[i].id}'>${response.data[i].value}</option>`;
          i++;
        }
        $("#degcode").html(options);
      } else {
        alert(response.data.msg);
        return;
      }
    },
  });
}

function getDegCourseRepSem() {
  
  let degcode = $('#degcode').val();

  $.ajax({
    type: "GET",
    url: $host_url + "getDegCourseRepSem",
    data:"degcode="+degcode,
    success: function (res) {
      let response = JSON.parse(res);
      console.log(response);
      let options = "";
      if (response.error_code === 0) {
        options += `<option>All</option>`;
        for (let i in response.data) {
          options += `<option value='${response.data[i].id}'>${response.data[i].value}</option>`;
          i++;
        }
        $("#sem").html(options);
      } else {
        alert(response.data.msg);
        return;
      }
    },
  });
}


function generateCorseRep()
{
  let degcode = $('#degcode').val();
  let sem = $('#sem').val();

  window.open(
    $host_url +
      `generateCorseRep&degcode=${degcode}&sem=${sem}`
  );

}