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


Current Path : /var/www/html/nitte/js21042016/
Upload File :
Current File : /var/www/html/nitte/js21042016/room_allotment.js

 //10561 10655
function CallEnableRoomAllotment()
{ 
	$("#page_main_div").load('html_modules/room_allotment.html',function()
	{	
	 	document.getElementById('display_module_name').innerHTML = 'Room Allotment';
	document.getElementById('module_name_for_save').value = 'Room Allotment';
		getDefaultHeadFooterLinks("Room Allotment");
	});
 
}
function DisplayRoomAllotmentDetatils()
{
	var qp_code=$("#abs_entry_qp_code").val();
	var ra_stu_cnt=$("#ra_stu_cnt").val();
	var total_rooms=$("#total_rooms").val();
	if(empty(qp_code))
	{
		alert("Please enter the QP Code");
		return false;
	}
	else if(empty(ra_stu_cnt))
	{
		alert("Student Count is zero in CandDetails");
		return false;
	}
	else if(empty(total_rooms))
	{
		alert("Total Rooms Cannot be empty");
		$("#total_rooms").focus();
		return false;
	}
		$.ajax({
	       type: "POST",
			async:false,
	       data: "qp_code="+qp_code+"&ra_stu_cnt="+ra_stu_cnt+"&total_rooms="+total_rooms,
	       url: $host_url+"DisplayRoomAllotmentDetatils",
 	       success:DisplayRoomAllotmentDetatilsResponse
		 });   
}
function  DisplayRoomAllotmentDetatilsResponse(responce)
{
 responce = eval('(' + responce + ')'); 
		$("#room_allotment").html("");
		$("#room_allotment").html(responce.data['html']);
}
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 SaveRoomAllotment()
{
	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();
		if(empty(qp_code))
		{
			alert("Please enter the QP Code");
			return false;
		}
		else if(empty(ra_stu_cnt))
		{
			alert("Student Count is zero in CandDetails");
			return false;
		}
		else if(empty(total_rooms))
		{
			alert("Total Rooms Cannot be empty");
			$("#total_rooms").focus();
			return false;
		}
		if(ra_total>ra_stu_cnt)
		{
			alert("Room Capacity cannot be greater than Total Student Count");
		 
			return false;
		}
			var hall_obj=new Object();
			var table_obj=$("input[id*='ra_input_']") ;
				jQuery.each(table_obj, function(k, v) {
				hall_no= $(this).attr("id").split("_").pop();
				i_total= $(this).val();
				 hall_obj[hall_no]=i_total;
				});
		$.ajax({
	       type: "POST",
			async:false,
	       data: "FSESSION="+FSESSION+"&FDOE="+FDOE+"&qp_code="+qp_code+"&ra_stu_cnt="+ra_stu_cnt+"&total_rooms="+total_rooms+"&hall_obj="+encodeURIComponent(JSON.stringify(hall_obj)),
	       url: $host_url+"SaveRoomAllotment",
 	       success:SaveRoomAllotmentResponse
		 });   
}
function  SaveRoomAllotmentResponse(responce)
{
 responce = eval('(' + responce + ')'); 
	 if(responce.error_code==0)
	 {
		alert(responce.data);
		CallEnableRoomAllotment();
	 }
	 else
	 {
			alert(responce.data);
	 }
}