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


Current Path : /proc/thread-self/root/var/www/oasis/js_old/
Upload File :
Current File : //proc/thread-self/root/var/www/oasis/js_old/room_allotment_datewise.js

//10561 10655
function CallEnableRoomAllotmentDatewise() {
  $("#page_main_div").load(
    "../html_modules/room_allotment_datewise.html",
    function() {
      document.getElementById("display_module_name").innerHTML =
        "Room Allotment Datewise";
      document.getElementById("module_name_for_save").value =
        "Room Allotment Datewise";
      getDefaultHeadFooterLinks("Room Allotment Datewise");
      getRoomdetails();
    }
  );
}

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

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

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

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

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

function DisplayRoomAllotmentDetatilsDatewise() {
  //$.blockUI({ message: "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>" });

  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;
  }

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

  $.blockUI({
    message:
      "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>"
  });
  $.ajax({
    type: "POST",
    async: true,
    data:
      "frm_date=" +
      trim($("#frm_date").val()) +
      "&session=" +
      trim($("#session").val()) +
      "&ra_from=" +
      trim($("#ra_from").val()) +
      "&ra_to=" +
      trim($("#ra_to").val()) +
      "&faculty=" +
      trim($("#faculty").val()) +
      "&deggrp=" +
      trim($("#deggrp").val()),
    url: $host_url + "DisplayRoomAllotmentDetatilsDatewise",
    success: DisplayRoomAllotmentDetatilsDatewiseResponse
  });
}

function DisplayRoomAllotmentDetatilsDatewiseResponse(responce) {
  responce = eval("(" + responce + ")");
  $.unblockUI();
  if (responce.error_code == 0) {
    $("#room_allotment").html("");
    $("#room_allotment").html(responce.data["html"]);
  } else {
    alert(responce.data);
  }
}

function CaclulateRaGrandTotal() {
  var grand_total = 0;
  var table_obj = $("input[id*='ra_input_']");
  jQuery.each(table_obj, function(k, v) {
    i_total = $(this).val();
    grand_total = eval(grand_total + parseFloat(i_total));
  });
  $("#ra_total").val(grand_total);
}

function SaveRoomAllotmentDatewise() {
  var qp_code = $("#abs_entry_qp_code").val();
  var ra_stu_cnt = $("#ra_stu_cnt").val();
  var total_rooms = $("#total_rooms").val();
  var FSESSION = $("#ra_time").val();
  var FDOE = date_format($("#ra_date").val());
  var ra_total = $("#ra_total").val();
  var faculty = $("#faculty").val();

  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;
  }

  /* if(ra_total != ra_stu_cnt)
		{
			alert("Alloted Student count should be equal to Total Student Count");		 
			return false;
		} */

  var inputFileds = document.getElementsByTagName("input");

  var chkCnt = 0;
  var rowCnt = 0;
  var hall_arr = {};
  for (var counter = 0; counter < inputFileds.length; counter++) {
    if (
      inputFileds[counter].type.toUpperCase() == "TEXT" &&
      inputFileds[counter].name == "HALL"
    ) {
      ++rowCnt;
      ++chkCnt;
      //alert(document.getElementById(rowCnt+'_hallno').value);
      hall_arr[chkCnt] = new Object();
      hall_arr[chkCnt]["hallno"] = document.getElementById(
        rowCnt + "_hallno"
      ).value;
      hall_arr[chkCnt]["roomname"] = document.getElementById(
        rowCnt + "_roomname"
      ).value;
      hall_arr[chkCnt]["capacity"] = document.getElementById(
        rowCnt + "_capacity"
      ).value;
      hall_arr[chkCnt]["qpcode"] = document.getElementById(
        rowCnt + "_qpcode"
      ).value;
      hall_arr[chkCnt]["count"] = document.getElementById(
        rowCnt + "_count"
      ).value;
      hall_arr[chkCnt]["remaing"] = document.getElementById(
        rowCnt + "_remaing"
      ).value;
      hall_arr[chkCnt]["alloted"] = document.getElementById(
        rowCnt + "_alloted"
      ).value;
      hall_arr[chkCnt]["notalloted"] = document.getElementById(
        rowCnt + "_notalloted"
      ).value;
      hall_arr[chkCnt]["fdoe"] = document.getElementById(
        rowCnt + "_fdoe"
      ).value;
      hall_arr[chkCnt]["sestion"] = document.getElementById(
        rowCnt + "_sestion"
      ).value;
      hall_arr[chkCnt]["subcode"] = document.getElementById(
        rowCnt + "_subcode"
      ).value;
    }
  }
  $.blockUI({
    message:
      "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>"
  });
  $.ajax({
    type: "POST",
    async: true,
    data:
      "&hall_arr=" +
      encodeURIComponent(JSON.stringify(hall_arr)) +
      "&faculty=" +
      faculty,
    url: $host_url + "SaveRoomAllotmentDatewise",
    success: SaveRoomAllotmentDatewiseResponse
  });
}

function SaveRoomAllotmentDatewiseResponse(responce) {
  responce = eval("(" + responce + ")");
  $.unblockUI();
  if (responce.error_code == 0) {
    alert(responce.data);
  } else {
    alert(responce.data);
  }
}