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


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

 //10561 10655
function CallEnableRoomAllotmentqpcodewise()
{ 
	$("#page_main_div").load('html_modules/room_allotment_qpcodewise.html',function()
	{	
	document.getElementById('display_module_name').innerHTML = 'Room Allotment QP Codewise';
	document.getElementById('module_name_for_save').value = 'Room Allotment QP Codewise';
	getDefaultHeadFooterLinks("Room Allotment QP Codewise");
	getRoomdetails();
	});
 
}

function getRoomdetails()
{
	$.ajax({
	type: "POST",
	async:false,
	url: $host_url+"getRoomdetails",
	success:function(responce)
	{
		$responce = eval('(' + responce + ')'); 
		document.getElementById("ra_from").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_from").options.add($op);
		}
		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 DisplayRoomAllotmentDetatilsqpcodewise()
{
	var qp_code=$("#abs_entry_qp_code").val();
	var ra_stu_cnt=$("#ra_stu_cnt").val();
	var ra_from=$("#ra_from").val();
	var ra_to=$("#ra_to").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;
	}

	$.ajax({
	type: "POST",
	async:false,
	data: "qp_code="+qp_code+"&ra_stu_cnt="+ra_stu_cnt+"&ra_from="+ra_from+"&ra_to="+ra_to,
	url: $host_url+"DisplayRoomAllotmentDetatilsqpcodewise",
	success:DisplayRoomAllotmentDetatilsqpcodewiseResponse
	});   
}
function  DisplayRoomAllotmentDetatilsqpcodewiseResponse(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 SaveRoomAllotmentqpcodewise()
{
		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;
		}
	
		if(ra_total != ra_stu_cnt)
		{
			alert("Alloted Student count should be equal to 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+"SaveRoomAllotmentqpcodewise",
		success:SaveRoomAllotmentResponse
		});   
}
function  SaveRoomAllotmentResponse(responce)
{
 responce = eval('(' + responce + ')'); 
	 if(responce.error_code==0)
	 {
		alert(responce.data);
	 }
	 else
	 {
			alert(responce.data);
	 }
}