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


Current Path : /proc/thread-self/root/var/www/html/mcu/js/
Upload File :
Current File : //proc/thread-self/root/var/www/html/mcu/js/room_allotment_old_03082018.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");
		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 DisplayRoomAllotmentDetatils()
{
	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;
	}
	
	
	
	$.ajax({
	type: "POST",
	async:false,
	data: "frm_date="+trim($("#frm_date").val())+"&session="+trim($("#session").val())+"&ra_from="+trim($("#ra_from").val())+"&ra_to="+trim($("#ra_to").val()),
	url: $host_url+"DisplayRoomAllotmentDetatils",
	success:DisplayRoomAllotmentDetatilsResponse
	});   
}

function  DisplayRoomAllotmentDetatilsResponse(responce)
{
	responce = eval('(' + responce + ')'); 
	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 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(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;
		} */
	$.blockUI({ message: "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>" });	
	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; 
				
				
		}
	}
	
	$.ajax({
	type: "POST",
	async:false,
	data: "&hall_arr="+encodeURIComponent(JSON.stringify(hall_arr)),
	url: $host_url+"SaveRoomAllotment",
	success:SaveRoomAllotmentResponse
	}); 
}
	
		  

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