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


Current Path : /proc/thread-self/root/var/www/html/college/js/
Upload File :
Current File : //proc/thread-self/root/var/www/html/college/js/roomallotmantsummary.js

function callroomallotmantsummary() {
  $("#page_main_div").load(
    "../html_modules/roomallotmantsummary.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");
      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);
      }
      loadDegreeGroups();
      getRoomdetailsReportsSummary();
    }
  );
  //$('#module_details_div').hide();
}


function getRoomdetailsReportsSummary() {
  $.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 loadDegreeGroups() {
  $.ajax({
    type: "GET",
    url: $host_url + "loaddeggrprms",
    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.length; i++) {
          opt += `<option value='${res.data[i].fdeggrp}'>${
            res.data[i].fdeggrp + " - " + res.data[i].fdescpn
          }</option>`;
        }
        document.getElementById("deggrp").innerHTML = opt;
      } else {
        alert(res.data.msg);
        return;
      }
    },
  });
}

function Generateroomallotmantsummary() {
  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());
    window.open($host_url + "Generateroomallotmantsummary" + datastring);
  } else {
    var datastring =
      "&deggrp=" +
      trim($("#deggrp").val()) +
      "&frm_date=" +
      trim($("#frm_date").val()) +
      "&session=" +
      trim($("#session").val());
    window.open($host_url + "roomallotmantsummarysubjwise" + datastring);
  }
}