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


Current Path : /proc/thread-self/root/var/www/html/orms-gug/js/
Upload File :
Current File : //proc/thread-self/root/var/www/html/orms-gug/js/dytable_old.js

function addexpdet()
{
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	for(var counter=0; counter < inputFileds.length; counter++) 
	{       
		if( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "pastworkexp"  )
		{   
			++chkCnt;
		}
	}	
	var curindex = chkCnt+1;
	var dyrow =	'<tbody id="pastworkr'+curindex+'"><tr><td><input type="text" id = "'+curindex+'AT1" class="form-control1" name="pastworkexp"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'AT2" class="form-control1"/></td>';
	dyrow += '<td><input type="text" id = "'+curindex+'AT3" class="form-control1"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'AT4" class="form-control1"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'AT5" class="form-control1"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'AT6" class="form-control1"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'AT7" class="form-control1"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'AT8" class="form-control1"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'AT9" class="form-control1"/></td>'; 
	dyrow += '<td><input type="hidden" id = "'+curindex+'AT10"/><span onclick ="delexpdet('+curindex+')"><img src="images/Remove-icon.png" /></span></td>';
	dyrow += '</tr></tbody>';
	$("#pastexptable").append(dyrow);
}

function delexpdet(rowid)
{
	if(confirm("Are you sure do you want to remove this details"))
	{
		$("#pastworkr"+rowid).hide();
		document.getElementById(rowid+"AT10").value = 'T';	
	}		
}	

//Reasearch experience details
function addresearchexp(respdata)
{
	//alert(respdata);
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "researchexp"  )
		{   
			++chkCnt;
		}
	}	
	var dellink ='';
	if(chkCnt!=0)
	{
		dellink = "<img src='images/Remove-icon.png' />";
	}	
	var curindex = chkCnt+1;
	var dyrow =	'<tbody id="resproj'+curindex+'"><tr><td><input type="text" id = "'+curindex+'BT1" class="form-control1" name="researchexp"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'BT2" class="form-control1"/></td>';
	dyrow += '<td><input type="text" id = "'+curindex+'BT3" class="form-control1"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'BT4" class="form-control1"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'BT5" class="form-control1"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'BT6" class="form-control1"/></td>'; 
	dyrow += '<td><input type="hidden" id = "'+curindex+'BT7"/><span onclick ="delresearchexp('+curindex+')">'+dellink+'</span></td>';
	dyrow += '</tr></tbody>';
	$("#researchexptable").append(dyrow);
	if(respdata)	
	{	
		if(respdata.data.length > 0)
		{
			document.getElementById(curindex+"BT1").value = respdata.data[curindex-1].fposition;
			document.getElementById(curindex+"BT2").value = respdata.data[curindex-1].femoluments;
			document.getElementById(curindex+"BT3").value = respdata.data[curindex-1].finstname;
			document.getElementById(curindex+"BT4").value = respdata.data[curindex-1].ffromdate;
			document.getElementById(curindex+"BT5").value = respdata.data[curindex-1].ftodate;
			document.getElementById(curindex+"BT6").value = respdata.data[curindex-1].fnoyears;
		}	
	}	
}


function delresearchexp(rowid)
{
	if(confirm("Are you sure do you want to remove this details"))
	{
		$("#resproj"+rowid).hide();
		document.getElementById(rowid+"BT7").value = 'T';	
	}	
	
}	


//full time experiance
function addfullexperiance(respdata)
{
	//alert(respdata);
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "fulltimeexp"  )
		{   
			++chkCnt;
		}
	}	
	var dellink ='';
	if(chkCnt!=0)
	{
		dellink = "<img src='images/Remove-icon.png' />";
	}	
	var curindex = chkCnt+1;
	var dyrow =	'<tbody id="fullproj'+curindex+'"><tr><td><input type = "text" style="display:none; " name="fulltimeexp"/><textarea type="text" id = "'+curindex+'BT1"  style="width:120px;" name="fulltimeexp"> </textarea></td>'; 
	dyrow += '<td><textarea type="text" id = "'+curindex+'BT2" style="width:120px;" > </textarea></td>';
	//dyrow += '<td><textarea type="text" id = "'+curindex+'BT3" ></textarea></td>'; 
	
	dyrow += '<td><select style="width:120px;" id = "'+curindex+'BT3"><option value = "Permanent">Permanent</option><option value = "Ad-hoc">Ad-hoc</option><option value = "Temporay">Temporay</option><option value = "Contractual">Contractual</option></select></td>';
											
	dyrow += '<td><textarea type="text" id = "'+curindex+'BT4" style="width:120px;" ></textarea></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'BT5" style="width:80px;"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'BT6" style="width:80px;"/></td>';
	dyrow += '<td><input type="text" id = "'+curindex+'BT7" style="width:80px;"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'BT8" style="width:50px;"/></td>';	
	dyrow += '<td><input type="hidden" id = "'+curindex+'BT9"/><span onclick ="delfullexp('+curindex+')">'+dellink+'</span></td>';
	dyrow += '</tr></tbody>';
	$("#fulltimeexptable").append(dyrow);
	if(respdata)	
	{	
		if(respdata.data.length > 0)
		{
			document.getElementById(curindex+"BT1").value = respdata.data[curindex-1].fposition;
			document.getElementById(curindex+"BT2").value = respdata.data[curindex-1].femoluments;
			document.getElementById(curindex+"BT3").value = respdata.data[curindex-1].finstname;
			document.getElementById(curindex+"BT4").value = respdata.data[curindex-1].ffromdate;
			document.getElementById(curindex+"BT5").value = respdata.data[curindex-1].ftodate;
			document.getElementById(curindex+"BT6").value = respdata.data[curindex-1].fnoyears;
		}	
	}	
}


function delfullexp(rowid)
{
	if(confirm("Are you sure do you want to remove this details"))
	{
		$("#fullproj"+rowid).hide();
		document.getElementById(rowid+"BT9").value = 'T';	
	}	
	
}


//full time experiance
function addresearchpapersa(respdata)
{
	//alert(respdata);
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "researchpapersaexp"  )
		{   
			++chkCnt;
		}
	}	
	var dellink ='';
	if(chkCnt!=0)
	{
		dellink = "<img src='images/Remove-icon.png' />";
	}	
	var curindex = chkCnt+1;
	var dyrow =	'<tbody id="fullresearch'+curindex+'"><tr><td><input type = "text" style="display:none; " name="researchpapersaexp"/><select style="width:80px;" id = "'+curindex+'RA1"><option value = "">Select</option><option value = "Research Paper / Review Article">Research Paper / Review Article</option><option value = "Conference Proc. Full Length Paper">Conference Proc. Full Length Paper</option></select></td>'; 
		
	dyrow += '<td><textarea type="text" id = "'+curindex+'RA2" style="width:80px;" > </textarea></td>';
	//dyrow += '<td><textarea type="text" id = "'+curindex+'BT3" ></textarea></td>'; 
	
	dyrow += '<td><input type="text" id = "'+curindex+'RA3" style="width:80px;"/></td>';
											
	dyrow += '<td><input type="text" id = "'+curindex+'RA4" style="width:50px;"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'RA5" style="width:80px;"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'RA6" style="width:80px;"/></td>';
	dyrow += '<td><select style="width:80px;" id = "'+curindex+'RA7"><option value = "">Select</option><option value = "yes">Yes</option><option value = "No">No</option></select></td>'; 
	dyrow += '<td><select style="width:80px;" id = "'+curindex+'RA8"><option value = "">Select</option><option value = "First and Principal Author/Editor">First and Principal Author/Editor</option><option value = "Corresponding Author/Editor">Corresponding Author/Editor</option><option value = "Sole Author/Editor">Sole Author/Editor</option><option value = "Co-Author">Co-Author</option><option value = "Co-Editor">Co-Editor</option></select></td>';	
	dyrow += '<td><input type="text" id = "'+curindex+'RA9"  style="width:80px;"/></td>';
	dyrow += '<td><input type="text" id = "'+curindex+'RA10" disabled style="width:30px;"/></td>';
	dyrow += '<td><input type="hidden" id = "'+curindex+'RA11"/><span onclick ="delresearchaexp('+curindex+')">'+dellink+'</span></td>';
	dyrow += '</tr></tbody>';
	$("#researchpaperatable").append(dyrow);
	if(respdata)	
	{	
		if(respdata.data.length > 0)
		{
			document.getElementById(curindex+"BT1").value = respdata.data[curindex-1].fposition;
			document.getElementById(curindex+"BT2").value = respdata.data[curindex-1].femoluments;
			document.getElementById(curindex+"BT3").value = respdata.data[curindex-1].finstname;
			document.getElementById(curindex+"BT4").value = respdata.data[curindex-1].ffromdate;
			document.getElementById(curindex+"BT5").value = respdata.data[curindex-1].ftodate;
			document.getElementById(curindex+"BT6").value = respdata.data[curindex-1].fnoyears;
		}	
	}	
}


function delresearchaexp(rowid)
{
	if(confirm("Are you sure do you want to remove this details"))
	{
		$("#fullresearch"+rowid).hide();
		document.getElementById(rowid+"RA11").value = 'T';	
	}	
	
}



function addresearchpapersb(respdata)
{
	//alert(respdata);
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "researchpapersaexp"  )
		{   
			++chkCnt;
		}
	}	
	var dellink ='';
	if(chkCnt!=0)
	{
		dellink = "<img src='images/Remove-icon.png' />";
	}	
	var curindex = chkCnt+1;
	var dyrow =	'<tbody id="fullresearchb'+curindex+'"><tr><td><input type = "text" style="display:none; " name="researchpapersaexp"/><select style="width:80px;" id = "'+curindex+'RB1"><option value = "">Select</option><option value = "Research Paper / Review Article">Research Paper / Review Article</option><option value = "Conference Proc. Full Length Paper">Conference Proc. Full Length Paper</option></select></td>'; 
		
	dyrow += '<td><textarea type="text" id = "'+curindex+'RB2" style="width:80px;" > </textarea></td>';
	//dyrow += '<td><textarea type="text" id = "'+curindex+'BT3" ></textarea></td>'; 
	
	dyrow += '<td><input type="text" id = "'+curindex+'RB3" style="width:80px;"/></td>';
											
	dyrow += '<td><input type="text" id = "'+curindex+'RB4" style="width:50px;"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'RB5" style="width:80px;"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'RB6" style="width:80px;"/></td>';
	dyrow += '<td><select style="width:80px;" id = "'+curindex+'RB7"><option value = "">Select</option><option value = "yes">Yes</option><option value = "No">No</option></select></td>'; 
	dyrow += '<td><select style="width:80px;" id = "'+curindex+'RB8"><option value = "">Select</option><option value = "First and Principal Author/Editor">First and Principal Author/Editor</option><option value = "Corresponding Author/Editor">Corresponding Author/Editor</option><option value = "Sole Author/Editor">Sole Author/Editor</option><option value = "Co-Author">Co-Author</option><option value = "Co-Editor">Co-Editor</option></select></td>';	
	dyrow += '<td><input type="text" id = "'+curindex+'RB9"  style="width:80px;"/></td>';
	dyrow += '<td><input type="text" id = "'+curindex+'RB10" disabled style="width:30px;"/></td>';
	dyrow += '<td><input type="hidden" id = "'+curindex+'RB11"/><span onclick ="delresearchaexp('+curindex+')">'+dellink+'</span></td>';
	dyrow += '</tr></tbody>';
	$("#researchpaperatableb").append(dyrow);
	if(respdata)	
	{	
		if(respdata.data.length > 0)
		{
			document.getElementById(curindex+"BT1").value = respdata.data[curindex-1].fposition;
			document.getElementById(curindex+"BT2").value = respdata.data[curindex-1].femoluments;
			document.getElementById(curindex+"BT3").value = respdata.data[curindex-1].finstname;
			document.getElementById(curindex+"BT4").value = respdata.data[curindex-1].ffromdate;
			document.getElementById(curindex+"BT5").value = respdata.data[curindex-1].ftodate;
			document.getElementById(curindex+"BT6").value = respdata.data[curindex-1].fnoyears;
		}	
	}	
}


function delresearchaexp(rowid)
{
	if(confirm("Are you sure do you want to remove this details"))
	{
		$("#fullresearchb"+rowid).hide();
		document.getElementById(rowid+"RB11").value = 'T';	
	}	
	
}




//full time experiance phd
function addfullphdexperiance(respdata)
{
	//alert(respdata);
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "fulltimeexp"  )
		{   
			++chkCnt;
		}
	}	
	var dellink ='';
	if(chkCnt!=0)
	{
		dellink = "<img src='images/Remove-icon.png' />";
	}	
	var curindex = chkCnt+1;
	var dyrow =	'<tbody id="fullphdproj'+curindex+'"><tr><td><input type = "text" style="display:none; " name="fulltimeexp"/><textarea type="text" id = "'+curindex+'BT10"  style="width:120px;" name="fulltimeexp"> </textarea></td>'; 
	dyrow += '<td><textarea type="text" id = "'+curindex+'BT11" style="width:120px;" > </textarea></td>';
	//dyrow += '<td><textarea type="text" id = "'+curindex+'BT3" ></textarea></td>'; 
	dyrow += '<td><textarea type="text" id = "'+curindex+'BT12" style="width:120px;" ></textarea></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'BT13" style="width:80px;"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'BT14" style="width:80px;"/></td>';
	dyrow += '<td><input type="text" id = "'+curindex+'BT15" style="width:80px;"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'BT16" style="width:50px;"/></td>';	
	dyrow += '<td><input type="hidden" id = "'+curindex+'BT17"/><span onclick ="delfullexp('+curindex+')">'+dellink+'</span></td>';
	dyrow += '</tr></tbody>';
	$("#fulltimephdexptable").append(dyrow);
	if(respdata)	
	{	
		if(respdata.data.length > 0)
		{
			document.getElementById(curindex+"BT1").value = respdata.data[curindex-1].fposition;
			document.getElementById(curindex+"BT2").value = respdata.data[curindex-1].femoluments;
			document.getElementById(curindex+"BT3").value = respdata.data[curindex-1].finstname;
			document.getElementById(curindex+"BT4").value = respdata.data[curindex-1].ffromdate;
			document.getElementById(curindex+"BT5").value = respdata.data[curindex-1].ftodate;
			document.getElementById(curindex+"BT6").value = respdata.data[curindex-1].fnoyears;
		}	
	}	
}


function delfullexp(rowid)
{
	if(confirm("Are you sure do you want to remove this details"))
	{
		$("#fullphdproj"+rowid).hide();
		document.getElementById(rowid+"BT17").value = 'T';	
	}	
	
}

//Research Project details
function addresearchproject(respdata)
{
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "researchproj"  )
		{   
			++chkCnt;
		}
	}	
	var dellink ='';
	if(chkCnt!=0)
	{
		dellink = "<img src='images/Remove-icon.png' />";
	}	
	var curindex = chkCnt+1;
	var dyrow =	'<tbody id="resproj'+curindex+'"><tr><td><input type="text" id = "'+curindex+'CT1" class="form-control1" name="researchproj"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'CT2" class="form-control1"/></td>';
	dyrow += '<td><input type="text" id = "'+curindex+'CT3" class="form-control1"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'CT4" class="form-control1"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'CT5" class="form-control1"/></td>'; 
	dyrow += '<td><select id = "'+curindex+'CT6" class="form-control1"><option value = "Completed">Completed</option><option value = "Ongoing">Ongoing</option></select></td>'; 
	dyrow += '<td><input type="hidden" id = "'+curindex+'CT7"/><span onclick ="delresearchproject('+curindex+')">'+dellink+'</td>';
	dyrow += '</tr></tbody>';
	$("#researchprojecttable").append(dyrow);
	
}


function delresearchproject(rowid)
{
	if(confirm("Are you sure do you want to remove this details"))
	{
		$("#resproj"+rowid).hide();
		document.getElementById(rowid+"CT7").value = 'T';	
	}	
	
}

//Orientation Programs Details
function addorientationdet(resdata)
{
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "orientationdet"  )
		{   
			++chkCnt;
		}
	}	
	var dellink ='';
	if(chkCnt!=0)
	{
		dellink = "<img src='images/Remove-icon.png' />";
	}	
	var curindex = chkCnt+1;
	var dyrow =	'<tbody id="orientprgs'+curindex+'"><tr><td><input type="text" id = "'+curindex+'DT1" class="form-control1" name="orientationdet"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'DT2" class="form-control1"/></td>';
	dyrow += '<td><input type="text" id = "'+curindex+'DT3" class="form-control1"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'DT4" class="form-control1"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'DT5" class="form-control1"/></td>';
	dyrow += '<td><input type="text" id = "'+curindex+'DT6" class="form-control1"/></td>';
	dyrow += '<td><input type="hidden" id = "'+curindex+'DT7"/><span onclick ="delorientationdet('+curindex+')">'+dellink+'</span></td>';
	dyrow += '</tr></tbody>';
	$("#orientationprgms").append(dyrow);
	if(resdata)	
	{	
		if(resdata.data.length > 0)
		{
			document.getElementById(curindex+"DT1").value = resdata.data[curindex-1].finstname;
			document.getElementById(curindex+"DT2").value = resdata.data[curindex-1].frefcourse;
			document.getElementById(curindex+"DT3").value = resdata.data[curindex-1].fsponsname;
			document.getElementById(curindex+"DT4").value = resdata.data[curindex-1].ffromdate;
			document.getElementById(curindex+"DT5").value = resdata.data[curindex-1].ftodate;
			document.getElementById(curindex+"DT6").value = resdata.data[curindex-1].fremarks;
		}	
	}	
}


function delorientationdet(rowid)
{
	if(confirm("Are you sure do you want to remove this details"))
	{
		$("#orientprgs"+rowid).hide();
		document.getElementById(rowid+"DT7").value = 'T';	
	}	
	
}

//conference Work Details
function addconferencedet()
{
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "conferencedet"  )
		{   
			++chkCnt;
		}
	}	
	var curindex = chkCnt+1;
	var dyrow =	'<tbody id="conference'+curindex+'"><tr><td><input type="text" id = "'+curindex+'ET1" class="form-control1" name="conferencedet"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'ET2" class="form-control1"/></td>';
	dyrow += '<td><input type="text" id = "'+curindex+'ET3" class="form-control1"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'ET4" class="form-control1"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'ET5" class="form-control1"/></td>';
	dyrow += '<td><input type="text" id = "'+curindex+'ET6" class="form-control1"/></td>';
	dyrow += '<td><input type="hidden" id = "'+curindex+'ET7"/><span onclick ="delconferencedet('+curindex+')"><img src="images/Remove-icon.png" /></span></td>';
	dyrow += '</tr></tbody>';
	$("#conferencedettable").append(dyrow);
}


function delconferencedet(rowid)
{
	if(confirm("Are you sure do you want to remove this details"))
	{
		$("#conference"+rowid).hide();
		document.getElementById(rowid+"ET7").value = 'T';	
	}	
	
}

//Details of Lectures Delivered 
function addlecturesdet()
{
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "detlecdel"  )
		{   
			++chkCnt;
		}
	}	
	var curindex = chkCnt+1;
	var dyrow =	'<tbody id="lecdet'+curindex+'"><tr><td><input type="text" id = "'+curindex+'FT1" class="form-control1" name="detlecdel"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'FT2" class="form-control1"/></td>';
	dyrow += '<td><input type="text" id = "'+curindex+'FT3" class="form-control1"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'FT4" class="form-control1"/></td>'; 
	dyrow += '<td><input type="hidden" id = "'+curindex+'FT5"/><span onclick ="dellecturesdet('+curindex+')"><img src="images/Remove-icon.png" /></span></td>';
	dyrow += '</tr></tbody>';
	$("#lecturesdettable").append(dyrow);
}

function dellecturesdet(rowid)
{
	if(confirm("Are you sure do you want to remove this details"))
	{
		$("#lecdet"+rowid).hide();
		document.getElementById(rowid+"FT5").value = 'T';	
	}	
	
}

//consultancy work undertaken details
function addconsultancydet()
{
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "consultancy"  )
		{   
			++chkCnt;
		}
	}	
	var curindex = chkCnt+1;
	var dyrow =	'<tbody id="condet'+curindex+'"><tr><td><input type="text" id = "'+curindex+'GT1" class="form-control1" name="consultancy"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'GT2" class="form-control1"/></td>';
	dyrow += '<td><input type="text" id = "'+curindex+'GT3" class="form-control1"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'GT4" class="form-control1"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'GT5" class="form-control1"/></td>'; 
	dyrow += '<td><input type="hidden" id = "'+curindex+'GT6"/><span onclick ="delconsultancydet('+curindex+')"><img src="images/Remove-icon.png" /></span></td>';
	dyrow += '</tr></tbody>';
	$("#consultancydettable").append(dyrow);
}


function delconsultancydet(rowid)
{
	if(confirm("Are you sure do you want to remove this details"))
	{
		$("#condet"+rowid).hide();
		document.getElementById(rowid+"GT6").value = 'T';	
	}	
}

//Languages Known Details
function addlanguagesdet(resdata)
{
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "language"  )
		{   
			++chkCnt;
		}
	}	
	var dellink ='';
	if(chkCnt!=0)
	{
		dellink = "<img src='images/Remove-icon.png' />";
	}	
	var curindex = chkCnt+1;
	var dyrow =	'<tbody id="lanknown'+curindex+'"><tr><td><input type="text" id = "'+curindex+'HT1" class="form-control1" name="language"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'HT2" class="form-control1"/></td>';
	dyrow += '<td><input type="hidden" id = "'+curindex+'HT3"/><span onclick ="dellanguagesdet('+curindex+')">'+dellink+'</span></td>';
	dyrow += '</tr></tbody>';
	$("#languageknowntable").append(dyrow);
	if(resdata)	
	{	
		if(resdata.length > 0)
		{
			document.getElementById(curindex+"HT1").value = resdata[curindex-1].fspoken;
			document.getElementById(curindex+"HT2").value = resdata[curindex-1].fwritten;
		}	
	}	
}

function dellanguagesdet(rowid)
{
	if(confirm("Are you sure do you want to remove this details"))
	{
		$("#lanknown"+rowid).hide();
		document.getElementById(rowid+"HT3").value = 'T';	
	}	
	
}

//Foreign Visit Details
function addforeignvisitdet(respdata)
{
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "foreignvisit"  )
		{   
			++chkCnt;
		}
	}	
	var dellink ='';
	if(chkCnt!=0)
	{
		dellink = "<img src='images/Remove-icon.png' />";
	}	
	var curindex = chkCnt+1;
	var dyrow =	'<tbody id="foreigndet'+curindex+'"><tr><td><input type="text" id = "'+curindex+'IT1" class="form-control1" name="foreignvisit"/></td>'; 
	dyrow += '<td><input type="text" id = "'+curindex+'IT2" class="form-control1"/></td>';
	dyrow += '<td><input type="text" id = "'+curindex+'IT3" class="form-control1"/></td>';
	dyrow += '<td><input type="text" id = "'+curindex+'IT4" class="form-control1"/></td>';
	dyrow += '<td><input type="text" id = "'+curindex+'IT5" class="form-control1"/></td>';
	dyrow += '<td><input type="text" id = "'+curindex+'IT6" class="form-control1"/></td>';
	dyrow += '<td><input type="hidden" id = "'+curindex+'IT7"/><span onclick ="delforeignvisitdet('+curindex+')">'+dellink+'</span></td>';
	dyrow += '</tr></tbody>';
	$("#foreignvisittable").append(dyrow);
	if(respdata)	
	{	
		if(respdata.data.length > 0)
		{
			document.getElementById(curindex+"IT1").value = respdata.data[curindex-1].fcountry;
			document.getElementById(curindex+"IT2").value = respdata.data[curindex-1].fpurpose;
			document.getElementById(curindex+"IT3").value = respdata.data[curindex-1].ffromdate;
			document.getElementById(curindex+"IT4").value = respdata.data[curindex-1].ftodate;
			document.getElementById(curindex+"IT5").value = respdata.data[curindex-1].ftotal;
			document.getElementById(curindex+"IT6").value = respdata.data[curindex-1].fperiod;
		}	
	}	
}

function delforeignvisitdet(rowid)
{
	if(confirm("Are you sure do you want to remove this details"))
	{
		$("#foreigndet"+rowid).hide();
		document.getElementById(rowid+"IT7").value = 'T';	
	}		
}

function addpostdet(resdata)
{
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='HIDDEN'  && inputFileds[counter].name == "postname"  )
		{   
			++chkCnt;
		}
	}
	if(!resdata)
	{	
		if(trim(document.getElementById(chkCnt+"S1").value) == '')
		{
			alert("Select Post");
			document.getElementById(chkCnt+"S1").focus();
			return false;
		}	
		if(trim(document.getElementById(chkCnt+"S2").value) == '')
		{
			alert("Select Qualifying Exam");
			document.getElementById(chkCnt+"S2").focus();
			return false;
		}
	}
	var dellink ='';
	if(chkCnt!=0)
	{
		dellink = "<img src='images/Remove-icon.png' />";
	}	
	var curindex = chkCnt+1;
	var dyrow =	'<tbody id="postdet'+curindex+'"><tr>';
	dyrow +='<td><input type="hidden" name="postname" /><select id = "'+curindex+'S1" class="form-control1" onchange="vldpostDuplicate(this.id)"></select></td>'; 
	dyrow += '<td><select id = "'+curindex+'S2" class="form-control1" name="qualexam"  ></select></td>';
	dyrow += '<td><input type="hidden" id = "'+curindex+'HS3" value="F"/><span onclick ="delpostdet('+curindex+')">'+dellink+'</span></td>';
	dyrow += '</tr></tbody>';
	$("#posttable").append(dyrow);
	
	$.ajax({
	type: "POST",
	async:false,
	url:$host_url+'getdropdown', 
	success: function getcatcoderesponce(responce)
	{
		responce = eval('(' + responce + ')');	
		
		document.getElementById(curindex+"S1").options.length = 0;		
		var post =responce.data['post'];
		setCookie('post',post);		
		$op = new Option("Select Post","");
		$op.id=0;//specifying the id  for options
		document.getElementById(curindex+"S1").options.add($op)
		for($i=0;$i < post.length;$i++)                                  
		{            
			$op = new Option(post[$i]['value'], post[$i]['internal_code']);
			$op.id=post[$i]['internal_code'];//specifying the id  for options
			document.getElementById(curindex+"S1").options.add($op);
		}	
		
		document.getElementById(curindex+"S2").options.length = 0;		
		var course =responce.data['course'];
		setCookie('course',course);		
		$op = new Option("Select Qualifying Exam","");
		$op.id=0;//specifying the id  for options
		document.getElementById(curindex+"S2").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(curindex+"S2").options.add($op);
		}
		if(resdata)	
		{	
			if(resdata.data.length > 0)
			{
				document.getElementById(curindex+"S1").value = resdata.data[curindex-1].fdegncode;
				document.getElementById(curindex+"S2").value = resdata.data[curindex-1].fdegree;
			}	
		}	
	}
	});		
}	

function delpostdet(rowid)
{
	if(confirm("Are you sure do you want to remove this details"))
	{
		$("#postdet"+rowid).hide();
		document.getElementById(rowid+"HS3").value = 'T';	
	}	
}	

function vldpostDuplicate(id)
{
	var cval = document.getElementById(id).value;
	var arr = new Array();
	var chkCnt=0;
	var cnt =0;
	var dupstatus = 0;
	var inputFileds = document.getElementsByTagName('input');
	
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='HIDDEN'  && inputFileds[counter].name == "postname"  )
		{   
			++chkCnt;
			if(cval == $("#"+chkCnt+"S1").val() && id != chkCnt+"S1")
			{
				dupstatus = 1;
			}				
		}
	}
	if(dupstatus == 1)
	{	
		alert('Post already selected');
		document.getElementById(id).value='';
		document.getElementById(id).focus();
		return false;
	}
}