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/roomallotmantsummary_new.js

function callroomallotmantsummaryNew() {
  $("#page_main_div").load(
    "../html_modules/roomallotmantsummarynew.html",
    function () {
      document.getElementById("display_module_name").innerHTML =
        "Room Allotment Summary";
      document.getElementById("module_name_for_save").value =
        "Room Allotment Summary";
      getDefaultHeadFooterLinks("Room Allotment Summary New");
      if (db == "demo") {
        $("#frm_date").val("10/03/2021");
        $("#session").val("M%");
      } else {
        var today = new Date();
        var dd = today.getDate();
        var mm = today.getMonth() + 1;
        var yyyy = today.getFullYear();
        if (dd < 10) dd = "0" + dd;
        if (mm < 10) mm = "0" + mm;
        var date = dd + "/" + mm + "/" + yyyy;
        $("#frm_date").val(date);
      }
      loadDegreeGroupsNew();
      getRoomdetailsReportsSummaryNew();
    }
  );
  //$('#module_details_div').hide();
}


function getRoomdetailsReportsSummaryNew() {
  $.ajax({
    type: "POST",
    async: false,
    url: $host_url + "getRoomdetails",
    success: function (responce) {
      $responce = eval("(" + responce + ")");

      document.getElementById("session").options.length = 0;
      $op = new Option("-select-", "0");
      $op.id = "0"; //specifying the id  for options
      document.getElementById("session").options.add($op);

      for ($i = 0; $i < $responce.data.session.length; $i++) {
        $op = new Option(
          $responce.data.session[$i]["value"],
          $responce.data.session[$i]["id"]
        );
        $op.id = $responce.data.session[$i]["id"]; //specifying the id  for options
        document.getElementById("session").options.add($op);
      }
    },
  });
}


function loadDegreeGroupsNew() {
  $.ajax({
    type: "GET",
    url: $host_url + "loaddeggrprmsNew",
    success: function (response) {
      var res = JSON.parse(response);
      if (res.error_code === 0) {
        var opt = `<option value=''>---select---</option>
        <option value='All'>All</option>`;
        for (var i = 0; i < res.data.deggp.length; i++) {
          opt += `<option value='${res.data.deggp[i].fdeggrp}'>${
            res.data.deggp[i].fdeggrp + " - " + res.data.deggp[i].fdescpn
          }</option>`;
        }
        document.getElementById("deggrp").innerHTML = opt;

        var opt1 = `<option value=''>---select---</option>`;
        for (var i = 0; i < res.data.exmmonth.length; i++) {
          opt1 += `<option value='${res.data.exmmonth[i].fyear}*${res.data.exmmonth[i].fexamtype}'>${res.data.exmmonth[i].fexamdate}</option>`;
        }
        document.getElementById("exmmonth").innerHTML = opt1;
        
      } else {
        alert(res.data.msg);
        return;
      }
    },
  });
}

function GenerateroomallotmantsummaryNew() {

  if (date_format($("#frm_date").val()) == "") {
    alert("Enter Date");
    $("#frm_date").focus();
    return false;
  }

  if (date_format($("#session").val()) == "") {
    alert("Select Session.");
    $("#session").focus();
    return false;
  }

  console.log($("#reporttype").val());
  // return;
  if ($("#reporttype").val() == "room") {
    var datastring =
      "&deggrp=" +
      trim($("#deggrp").val()) +
      "&frm_date=" +
      trim($("#frm_date").val()) +
      "&session=" + trim($("#session").val())+"&exmmonth="+trim($("#exmmonth").val());
    window.open($host_url + "GenerateroomallotmantsummaryNew" + datastring);
  } else {
    var datastring =
      "&deggrp=" +
      trim($("#deggrp").val()) +
      "&frm_date=" +
      trim($("#frm_date").val()) +
      "&session=" +
      trim($("#session").val())+"&exmmonth="+trim($("#exmmonth").val());
    window.open($host_url + "roomallotmantsummarysubjwiseNew" + datastring);
  }
}