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


Current Path : /var/www/html/orms-gug/admin_22/js/
Upload File :
Current File : /var/www/html/orms-gug/admin_22/js/index.js

var urlarr = window.location.pathname.split('/');
var $url="http://"+window.location.host+"/";
var $hoststr = '';
for(var j=1;j<urlarr.length-1;j++)
{
	$hoststr += window.location.pathname.split('/')[j]+"/"; 
}	
$host_url = $url+$hoststr+"app.php?a=";
$image_path = $url+$hoststr+"jqGrid3.5/cmes/tarka/images/";

$(document).ready(function(){
	getheaderdetail();
});	
			
function getheaderdetail()
{
	$.ajax({
	url: $host_url+"getheaderdetails",
	success:function(responce)
	{
		responce = eval('('+responce+')');
		if(responce.error_code == 0)
		{
			setCookie("title",responce.data.FUNIVNAME);
			setCookie("logo",responce.data.FLOGOPATH);
			setCookie("datestr",responce.data.datestr);
			//document.getElementById("title").innerHTML = responce.data.FUNIVNAME;
			//document.getElementById("logo").innerHTML = responce.data.FLOGOPATH;
			document.getElementById("datestr").innerHTML = responce.data.datestr;
		}	
	}
	});
}

function newregistration()
{
	
	var myobject;
	fldorder = 'T1,T2,T3';
	mandfields = 'T1,T2,T3';
	
	myobject = onsavevalidate.call(myobject, 999);
	if (myobject != 999)
	{
		document.getElementById(myobject).focus();
		return false;
	}
	/* var e = document.createEvent('Event');
	emailid = document.getElementById('T2').value;
	if(!validateemail(e,emailid))
	{
		alert('Invalid email id');
		document.getElementById('T2').focus();
		return false;
	} */	
	var username = document.getElementById("T1").value;
	var emailid = document.getElementById("T2").value;
	var mobileno = document.getElementById("T3").value;
	var parameters = "username="+username+"&emailid="+emailid+"&mobileno="+mobileno;
	$.ajax({
	url: $host_url+"newregistrationadmin",
	data:parameters,
	success: newregistrationResponse
	});
}

function newregistrationResponse(responce)
{
	responce = eval('('+responce+')');
	if(responce.error_code == 0)
	{
		alert(responce.data);
		document.getElementById("T1").value = '';
		document.getElementById("T2").value = '';
		document.getElementById("T3").value = '';
	}
	else
	{
		alert(responce.data);
		document.getElementById("T1").focus();
		return false;
	}
}

function sendpassword()
{
	var emailid = document.getElementById("T7").value;	
	if(emailid == '')
	{
		alert('Enter Email Id');
		document.getElementById('T7').focus();
		return;
	}	
	
	var parameters = "emailid="+emailid;
	$.ajax({
	url: $host_url+"sendpassword",
	data:parameters,
	success: sendpasswordresponse
	});
	
}

function sendpasswordresponse(responce)
{
	responce = eval('('+responce+')');
	if(responce.error_code == 0)
	{
		alert(responce.data);
		document.getElementById("T1").value = '';
	}else
	{
		alert(responce.data);
		document.getElementById("T1").focus();
		return;
	}	
}

function loginvalidate()
{
	var myobject;	
	fldorder = 'T4,T5';
	mandfields = 'T4,T5';
	
	myobject = onsavevalidate.call(myobject, 999);
	if (myobject != 999)
	{
		document.getElementById(myobject).focus();
		return false;
	}
	/* var e = document.createEvent('Event');
	var emailid = document.getElementById('T4').value;
	if(!validateemail(e,emailid))
	{
		alert('Invalid email id');
		document.getElementById('T4').focus();
		return false;
	} */	
	var emailid = document.getElementById("T4").value;
	var paswrd = document.getElementById("T5").value;
	var parameters = "emailid="+emailid+"&paswrd="+paswrd;
	$.ajax({
		url: $host_url+"loginvalidate",
		data:parameters,
		success:loginvalidateResponse
	});
}

function loginvalidateResponse(responce)
{
	responce = eval('('+responce+')');
	if(responce.error_code == 0)
	{
		window.location.href="main_page.html";
		setCookie("userid",responce.data.fuserid);
		setCookie("username",responce.data.fusername);
		loadhomepage();
	}
	else
	{
		alert(responce.data);
		document.getElementById("T4").focus();
		return false;
	}
}

function logoutsession()
{
	$.ajax({
	url: $host_url+"logoutsession",
	success:function(responce)
	{
		responce = eval('('+responce+')');
		window.location.href = "index.html?v=11102017";
	}
	});
}

function isloggedinvalidate()
{
	$.ajax({
	type: "POST",
	async: false,
	url: $host_url+"isloggedinvalidate",     
	success:function(responce)
	{
		responce = eval('(' + responce + ')'); 
		if(responce.data['data'] == 0)
		{
			alert("Please Login");
			window.location.href="index.html?v=11102017";
		}
		else
		{
			ResetTimer();
			loadhomepage();
		}	
		
	}
	});
}

function loadhomepage()
{
	loadhomedropdown();
	
	document.getElementById("user_name").innerHTML = getCookie("username");
	document.getElementById("datestr").innerHTML = getCookie("datestr");
}

function getdepartment()
{
	
	var postappiled = document.getElementById('1S1').value;
	var postapp = document.getElementById('1S3').value;
	
	$.ajax({
	type: "POST",
	async:false,
	url:$host_url+'getdepartment',
	data: "&postappiled="+postappiled+"&postapp="+postapp,	
	success: function getcatcoderesponce(responce)
	{
		responce = eval('(' + responce + ')');
		document.getElementById("1S2").options.length = 0;		
		var course =responce.data['course'];
		setCookie('course',course);		
		$op = new Option("-Select-","");
		$op.id=0;//specifying the id  for options
		document.getElementById("1S2").options.add($op)
		for($i=0;$i < course.length;$i++)                                  
		{            
			$op = new Option(course[$i]['value'], course[$i]['internal_code']);
			$op.id=course[$i]['internal_code'];//specifying the id  for options
			document.getElementById("1S2").options.add($op);
		}
		
		//loadapplieddetails();
		
	}
	});
	
}

function getwithvacdepartment()
{
	
	var postapp = document.getElementById('1S3').value;
	$.ajax({
	type: "POST",
	async:false,
	url:$host_url+'getwithvacdepartment',
	data: "&postapp="+postapp,	
	success: function getcatcoderesponce(responce)
	{
		responce = eval('(' + responce + ')');
		document.getElementById("1S2").options.length = 0;		
		var course =responce.data['course'];
		setCookie('course',course);		
		$op = new Option("-Select-","");
		$op.id=0;//specifying the id  for options
		document.getElementById("1S2").options.add($op)
		for($i=0;$i < course.length;$i++)                                  
		{            
			$op = new Option(course[$i]['value'], course[$i]['internal_code']);
			$op.id=course[$i]['internal_code'];//specifying the id  for options
			document.getElementById("1S2").options.add($op);
		}
		
		//loadapplieddetails();
		
	}
	});
	
}

/* function loaddata()
{
		
} */
function home()
{
	window.location.href="home.html";
}

function loaddata()
{
	$.ajax({
	type: "POST",
	async: false,
	url: $host_url+"isloggedinvalidate",     
	success:function(responce)
	{
		responce = eval('(' + responce + ')'); 
		if(responce.data['data'] == 0)
		{
			alert("Please Login");
			window.location.href="index.html?v=11102017";
		}
		else
		{
			post = getCookie("post");
			subject = getCookie("subject");
			vacancies = getCookie("vacancies");
			ResetTimer();
			var str  = 'Vacancy Applied: '+vacancies+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Post Applied: '+post+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Department: '+subject+'';
			document.getElementById("postdata").innerHTML = str;
			document.getElementById("user_name").innerHTML = getCookie("username");
			document.getElementById("datestr").innerHTML = getCookie("datestr");
			document.getElementById("appno").value = getCookie("app");
			document.getElementById("post_id").value = getCookie("post");
			document.getElementById("post_subject").value = getCookie("subject");
		}	
		
	}
	});
}