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


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

function Callrvdates()
{
    $("#page_main_div").load('html_modules/rvdates.html?v=26092020',function()
	{
		document.getElementById('display_module_name').innerHTML = 'Update RV/RT/CV Last Date ';
		document.getElementById('module_name_for_save').value = 'Update RV/RT/CV Last Date';
		getDefaultHeadFooterLinks('Update RV Dates'); 
		$('#date').hide();
		$('#dates').hide();
		
	}); 
		
}

function displayDatesDetails()
{

	if(document.getElementById('fdaterange').value == '')
	{
		alert('please select event date');
		document.getElementById('fdaterange').focus();
		return false;
	}else if(document.getElementById('college_code_from').value == '')
	{
		alert('please select college range');
		document.getElementById('college_code_from').focus();
		return false;
	}else if(document.getElementById('degree_code_from').value == '')
	{
		alert('please select degree range');
		document.getElementById('degree_code_from').focus();
		return false;
	}else if(document.getElementById('Examno_from').value == '')
	{
		alert('please select Exam range');
		document.getElementById('Examno_from').focus();
		return false;
	}
	$('#dates').show();
	$("#dates").load('html_modules/rvdatesheads.html?v=123',function()
	{
		/* document.getElementById('fdaterange').disabled = true;
		document.getElementById('college_code_from').disabled = true;
		document.getElementById('college_code_to').disabled = true;
		document.getElementById('degree_code_from').disabled = true;
		document.getElementById('degree_code_to').disabled = true;
		document.getElementById('Examno_from').disabled = true;
		document.getElementById('Examno_to').disabled = true; */
	});
}
//Savervdaterange
function Savervdaterange()
{
	
	if(document.getElementById('degree_code_from').value == '')
	{
		alert('please select degree range');
		document.getElementById('degree_code_from').focus();
		$("#degree_code_from").focus();
		return;
		
	}else if(document.getElementById('degree_code_to').value == '')
	{
		alert('please select degree range');
		document.getElementById('degree_code_to').focus();
		$("#degree_code_to").focus();
		return;
		
	}else if(document.getElementById('Examno_from').value == '')
	{
		alert('please select exam range');
		document.getElementById('Examno_from').focus();
		$("#Examno_from").focus();
		return;
		
	}else if(fdaterange = document.getElementById('Examno_to').value == '')
	{
		alert('please select exam range');
		document.getElementById('Examno_to').focus();
		$("#Examno_to").focus();
		return;
	}

	var degree_code_from =  document.getElementById('degree_code_from').value;
	var degree_code_to = document.getElementById('degree_code_to').value;
	var Examno_from = document.getElementById('Examno_from').value;
	var Examno_to = document.getElementById('Examno_to').value;
	
	var rvfee = document.getElementById('rvfee').value;
	var rtfee = document.getElementById('rtfee').value;
	var pcfee = document.getElementById('pcfee').value;
	var cvfee = document.getElementById('cvfee').value;
	var rvdays = document.getElementById('rvdays').value;
	var rtdays = document.getElementById('rtdays').value;
	var pcdays = document.getElementById('pcdays').value;
	var cvdays = document.getElementById('cvdays').value;

	var bulkinsert = 'F';
	if(document.getElementById('ckbox').checked == true)
	{
		if(rvfee == '')
		{
			alert('Enter RV Fee');
			doctype.getElementById('rvfee').focus();
			return;
		}
		if(rtfee == '')
		{
			alert('Enter RT Fee');
			doctype.getElementById('rtfee').focus();
			return;
		}
		if(pcfee == '')
		{
			alert('Enter PC Fee');
			doctype.getElementById('pcfee').focus();
			return;
		}
		if(cvfee == '')
		{
			alert('Enter CV Fee');
			doctype.getElementById('cvfee').focus();
			return;
		}
		if(rvdays == '')
		{
			alert('Enter RV Days');
			doctype.getElementById('rvdays').focus();
			return;
		}
		if(rtdays == '')
		{
			alert('Enter RT Days');
			doctype.getElementById('rtdays').focus();
			return;
		}
		if(pcdays == '')
		{
			alert('Enter PC Days');
			doctype.getElementById('pcdays').focus();
			return;
		}
		if(cvdays == '')
		{
			alert('Enter CV Days');
			doctype.getElementById('cvdays').focus();
			return;
		}
		
		if(confirm('Are you sure you want to update the New date range?'))
			bulkinsert = 'T';
		else
		{	
			bulkinsert = '';
			document.getElementById('ckbox').checked = false;
		}
	}
	
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	var rowCnt = 0;
	var date_arr = {};
	for (var counter=0; counter < inputFileds.length; counter++) 
	{      
		if (inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "date"  )
		{   
			++rowCnt;
			
			if(document.getElementById(rowCnt+'frvfeeh').value == 'U' ||
			document.getElementById(rowCnt+'frtfeeh').value == 'U'    ||
			document.getElementById(rowCnt+'fpcfeeh').value == 'U' ||
			document.getElementById(rowCnt+'fcvfeeh').value == 'U'    ||
			document.getElementById(rowCnt+'frvdaysh').value == 'U'   ||
			document.getElementById(rowCnt+'frtdaysh').value == 'U'   ||
			document.getElementById(rowCnt+'fpcdaysh').value == 'U'   ||
			document.getElementById(rowCnt+'fcvdaysh').value == 'U')
			{	++chkCnt;
				date_arr[chkCnt] = new Object();
				date_arr[chkCnt]['degree'] = document.getElementById(rowCnt+'degcode').value;
				date_arr[chkCnt]['examno'] = document.getElementById(rowCnt+'examno').value;
				
				date_arr[chkCnt]['frvfee'] = document.getElementById(rowCnt+'frvfee').value;
				date_arr[chkCnt]['frtfee'] = document.getElementById(rowCnt+'frtfee').value;
				date_arr[chkCnt]['fpcfee'] = document.getElementById(rowCnt+'fpcfee').value;
				date_arr[chkCnt]['fcvfee'] = document.getElementById(rowCnt+'fcvfee').value;
				
				date_arr[chkCnt]['frvdays'] = document.getElementById(rowCnt+'frvdays').value;
				date_arr[chkCnt]['frtdays'] = document.getElementById(rowCnt+'frtdays').value;
				date_arr[chkCnt]['fpcdays'] = document.getElementById(rowCnt+'fpcdays').value;
				date_arr[chkCnt]['fcvdays'] = document.getElementById(rowCnt+'fcvdays').value;
			}
		}
	}
	//alert(date_arr.length);
	
	var datastring = "&degree_code_to="+degree_code_to+"&degree_code_from="+degree_code_from+"&Examno_from="+Examno_from+"&Examno_to="+Examno_to+"&date_arr="+encodeURIComponent(JSON.stringify(date_arr))+"&bulkinsert="+bulkinsert+"&rvfee="+rvfee+"&rtfee="+rtfee+"&pcfee="+pcfee+"&cvfee="+cvfee+"&rvdays="+rvdays+"&rtdays="+rtdays+"&pcdays="+pcdays+"&cvdays="+cvdays;
	//if(document.getElementById('ckbox').checked == true)
	//if(confirm('Are you sure you want to update the New date range?'))
	if(Object.size(date_arr) >0 ||   bulkinsert =='T')
	{
		$.ajax({
			type: "POST",
			url: $host_url+"Savervdaterange",
			data:datastring,
			success:Savervdaterangeresponse
		});  
		
	}else
	{
		alert('No changes made');
		return false;
	}

}

function Savervdaterangeresponse($responce)
{
	$responce = eval('('+$responce+')');
	alert($responce.data);
	getrvdatedetails();
}

function getrvdatedetails()
{
	var degree_code_from = document.getElementById('degree_code_from').value;
	var degree_code_to = document.getElementById('degree_code_to').value;
	var Examno_from = document.getElementById('Examno_from').value;
	var Examno_to = document.getElementById('Examno_to').value;
	
	
	
	var datastring = "&degree_code_to="+degree_code_to+"&degree_code_from="+degree_code_from+"&Examno_from="+Examno_from+"&Examno_to="+Examno_to;
	$.blockUI({ message: "<h1 class='h1' style='font-size:12px'><img src='images/ajax-loader.gif' border='0'></h1>" });
	$.ajax({
	type: "POST",
	url: $host_url+"getrvdatedetails",
	data:datastring,
	success:getrvdatedetailsResponse
	});
}

function getrvdatedetailsResponse($responce)
{
	$.unblockUI();
	$responce = eval('('+$responce+')');
	$('#dates').show();
	$('#date').show();
		
	$("table").remove("#ftable1");
	if($responce.error_code == 0)
	{
		$("#dates").load('html_modules/rvdatesheads.html?v=215',function()
		{
			$('#ftable').append($responce.data['table']);
		});
	}
	else
	{
		alert('No records found for given details.');
		$('#date').hide();
		$('#dates').hide();
	}

}

function to_upperx(id)
{	
	var x = document.getElementById(id).value;
	document.getElementById(id).value = x.toUpperCase();
}

function getid(id)
{
	document.getElementById(id+'h').value = 'U';
}