function callroomdeclaration() {
$("#page_main_div").load("html_modules/roomdeclaration.html", function() {
document.getElementById("display_module_name").innerHTML =
"Room Declaration and Capacity ";
document.getElementById("module_name_for_save").value =
"Room Declaration and Capacity";
getDefaultHeadFooterLinks("Room Declaration and Capacity");
});
}
function DisplayRoomDeclarationDetatils() {
var roomcnt = trim(document.getElementById("totalrooms").value);
document.getElementById("roomdeclaration").innerHTML = "";
if (roomcnt == "") {
alert("Enter Total Rooms");
document.getElementById("totalrooms").focus();
return false;
}
$.ajax({
type: "POST",
url: $host_url + "displayroomdeclarationdetails",
success: function(responce) {
responce = eval("(" + responce + ")");
var roomdecl = responce.data;
var rtable =
"
";
document.getElementById("roomdeclaration").innerHTML = rtable;
}
});
}
function saveroomdeclaration() {
var inputFileds = document.getElementsByTagName("input");
var chkCnt = 0;
var rowCnt = 0;
var room_arr = {};
for (var counter = 0; counter < inputFileds.length; counter++) {
if (
inputFileds[counter].type.toUpperCase() == "TEXT" &&
inputFileds[counter].name == "roomdecl"
) {
++chkCnt;
if (trim(document.getElementById("2GT" + chkCnt).value) == "") {
alert(
"Enter Title for the Room No :" +
document.getElementById("1GT" + chkCnt).value
);
document.getElementById("2GT" + chkCnt).focus();
return false;
}
if (trim(document.getElementById("3GT" + chkCnt).value) == "") {
alert(
"Enter Capacity for the Room No :" +
document.getElementById("1GT" + chkCnt).value
);
document.getElementById("3GT" + chkCnt).focus();
return false;
}
room_arr[chkCnt] = new Object();
room_arr[chkCnt]["roomno"] = document.getElementById(
"1GT" + chkCnt
).value;
room_arr[chkCnt]["roomname"] = document.getElementById(
"2GT" + chkCnt
).value;
room_arr[chkCnt]["capacity"] = document.getElementById(
"3GT" + chkCnt
).value;
//room_arr[chkCnt]["order"] = document.getElementById("4GT" + chkCnt).value;
}
}
var parameters = "&room_arr=" + encodeURIComponent(JSON.stringify(room_arr));
$.ajax({
type: "POST",
url: $host_url + "saveroomdeclarationdetails",
data: parameters,
success: function(responce) {
responce = eval("(" + responce + ")");
alert(responce.data);
document.getElementById("roomdeclaration").innerHTML = "";
}
});
}