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


Current Path : /var/www/html/stph/js/
Upload File :
Current File : /var/www/html/stph/js/college_approve.js

function CallenableCollAdmissionApprove()
{
	$("#page_main_div").load('html_modules/college_approve.html',function()
	{	
		document.getElementById('display_module_name').innerHTML = ' Admission Approve ';
		document.getElementById('module_name_for_save').value = 'Admission Approve';
		gsl_no = 0;
		getDefaultHeadFooterLinks('College Admission Approve'); 
		loadCollegeDegree();
		
	});


}





function loadCollegeDegree()
{
		$.ajax({
        type: "POST",
	   	url: $host_url+"GetCollegeStatusDegreeDropdown",
		success: responceGetCollegeDegreeDropdown
		});
}


function responceGetCollegeDegreeDropdown($responce)
{
	$responce = eval('('+$responce+')');
	document.getElementById('appdegree').options.length = 0;
	var $lobj_Option = document.createElement("OPTION");
	$lobj_Option.value = "All";
	$lobj_Option.text = "All";         
	document.getElementById('appdegree').options[0]=($lobj_Option);   
	for($i=0;$i < $responce.data.length;$i++)                                  
	{            
			$op = new Option($responce.data[$i]['value'], $responce.data[$i]['internal_code']);
			$op.id=$responce.data[$i]['internal_code'];//specifying the id  for options
			document.getElementById('appdegree').options.add($op);
			
	}


}


function loadCollegeDegreeComb(degcode)
{
		alert(degcode);
		$.ajax({
			type: "POST",
			//async:false,
			url: $host_url+"getCombinationNames", 
			data:"&degree="+encodeURIComponent(trim(degcode)),
			success:function($responce)
			{
				$responce = eval('(' +  $responce + ')');
				if($responce.error_code==0)
				{	
					document.getElementById('degcomb').options.length = 0;
					var $lobj_Option = document.createElement("OPTION");
					$lobj_Option.value = "All";
					$lobj_Option.text = "All";         
					document.getElementById('degcomb').options[0]=($lobj_Option);   
					for($i=0;$i < $responce.data.length;$i++)                                  
					{            
							$op = new Option($responce.data[$i]['value'], $responce.data[$i]['internal_code']);
							$op.id=$responce.data[$i]['internal_code'];//specifying the id  for options
							document.getElementById('degcomb').options.add($op);
					}
				}
				else
				{
					document.getElementById('degcomb').options.length = 0;
					var $lobj_Option = document.createElement("OPTION");
					$lobj_Option.value = "All";
					$lobj_Option.text = "All";         
					document.getElementById('degcomb').options[0]=($lobj_Option);   
				}
			}
			});
	
}

var gsrchColl='';
var gsrchDeg = '';
var gsrchComb = '';
var gsrchStatus = '';

function GetCollAdmissionList()
{

	gsrchColl = $("#appcollege").val();
	gsrchDeg = $("#appdegree").val();
	gsrchComb = $("#degcomb").val();
	gsrchStatus = $("#appr_status").val();
	
	$.ajax({
        type: "POST",
		data:'&collcode='+$("#appcollege").val()+"&degcode="+$("#appdegree").val()
		+"&combcode="+$("#degcomb").val()+"&apprstatus="+$("#appr_status").val(),
	   	url: $host_url+"GetCollAdmissionList",
		success: responceGetAdmissionList
		});
}

function responceGetAdmissionList($responce)
{
	$responce = eval('('+$responce+')');
	$("#adm_application_details").html($responce.data);
	$("#adm_application_details").show();
	//$("#adm_application_details").contents().find("body").append($responce.data);
	/*var doc = document.getElementById('adm_application_details').contentWindow.document;
	doc.open();
	doc.write($responce.data);
	*/

}

	

function ViewStudentDetailsForApprove(id,degree,collcode)
{
	$.ajax({
			type: "POST",
			//async:false,
			url: $host_url+"getAppStudentDetails", 
			data:"sl_no="+id+"&degree="+degree+"&collcode="+collcode,
			success: EditStudentDetailsForUpdateResponse
		}); 
}
var gsl_no=0;
var gcollcode=0;
var gdegree=0;
function EditStudentDetailsForUpdateResponse($responce)
{ 	
	$responce = eval('(' + $responce + ')'); 
	document.getElementById('is_add_edit').value = 'Edit';
	
	if($responce.error_code == 0)
	{		
	$("#page_main_div").load('html_modules/admission_entryapp.html',function()
	{
		
		$("#error_msg").html(" ");
		gsl_no = $responce.data['FSLNO'];
		gcollcode = $responce.data['FCOLLCODE'];
		gdegree = $responce.data['FDEGREE'];
		document.getElementById('student_entry_admno').value = $responce.data['FSLNO'];
		document.getElementById('student_entry_degree_code').value = $responce.data['FDEGREE'];
		document.getElementById('approvestatus').value = $responce.data['FAPPRSTATUS'];
		document.getElementById('student_entry_degree_code').disabled=true;
		document.getElementById('student_entry_degree_name').disabled=true;
		document.getElementById('student_entry_degree_name').value = $responce.data['FDESCPN'];
		document.getElementById('student_entry_name').value = $responce.data['FNAME'];
	
		if($responce.data['FLANGEXAM'] == 'Kannada')
		$("#student_entry_rdbKannada").attr("checked",true);
		if($responce.data['FLANGEXAM'] == 'English')
		$("#student_entry_rdbEnglish").attr("checked",true);
		
		if($responce.data['Fgender'] == 'Male')
		$("#student_entry_genderm").attr("checked",true);
		if($responce.data['Fgender'] == 'Female')
		$("#student_entry_genderf").attr("checked",true);
		document.getElementById('student_entry_marital').value = $responce.data['FMARITALSTATUS'];
		document.getElementById('student_entry_dob').value = $responce.data['FDOBirth'];
		document.getElementById('student_entry_nationality').value = $responce.data['FNATIONAL'];
		document.getElementById('student_entry_national').value = $responce.data['FNATCANDIDATE'];
		document.getElementById('student_entry_state').value = $responce.data['FSTATE'];
		document.getElementById('sltBelongsToKarnatakaBy').value = $responce.data['FKARBIRTH'];
		document.getElementById('student_entry_religion').value = $responce.data['FRELIGION'];
		document.getElementById('degree_category').value = $responce.data['FCATBIRTH'];
		document.getElementById('student_entry_caste').value = $responce.data['FCASTE'];
		document.getElementById('student_entry_academicYear').value = $responce.data['FACADYEAR'];
		document.getElementById('student_entry_catadm').value = $responce.data['FADMCAT'];
		document.getElementById('combination').value = $responce.data['FCOMBCODE'];
		document.getElementById('student_entry_admdate').value = $responce.data['FADMISDATE'];
		document.getElementById('student_entry_Intake').value = $responce.data['FADMINTAKE'];
		document.getElementById('student_entry_admQuota').value = $responce.data['FADMQUOTA'];
		
		document.getElementById('student_entry_fname').value = $responce.data['FFATNAME'];
		document.getElementById('student_entry_fincome').value = $responce.data['FFATINCOME'];
		document.getElementById('student_entry_mname').value = $responce.data['FMOTNAME'];
		document.getElementById('student_entry_mincome').value = $responce.data['FMOTHINCOME'];
		document.getElementById('student_entry_phone').value = $responce.data['FCONTACT_NO'];
		document.getElementById('student_entry_comm_addr1').value = $responce.data['FCURRADD1'];
		document.getElementById('student_entry_comm_addr2').value = $responce.data['FCURRADD2'];
		document.getElementById('student_entry_comm_addr3').value = $responce.data['FCURRADD3'];
		document.getElementById('student_entry_comm_addr4').value = $responce.data['FCURRADD4'];
		document.getElementById('student_entry_per_add1').value = $responce.data['FPERMADD1'];
		document.getElementById('student_entry_per_add2').value = $responce.data['FPERMADD2'];
		document.getElementById('student_entry_per_add3').value = $responce.data['FPERMADD3'];
		document.getElementById('student_entry_per_add4').value = $responce.data['FPERMADD4'];		
		document.getElementById('student_entry_religion').value =$responce.data['FRELIGION'];		
		document.getElementById('student_entry_email').value=$responce.data['FEMAIL'];	
		document.getElementById('student_entry_mobile').value =$responce.data['FMOBILE_NO'];	
		document.getElementById('seLinguisticMinority').value =$responce.data['FLINGMINORITY'];	
		document.getElementById('seReligiousMinority').value =$responce.data['FREGMINORITY'];	
		document.getElementById('seAadharNumber').value =$responce.data['FAADHARNO'];	
		document.getElementById('degree_category').value = $responce.data['FCATBIRTH'];
		document.getElementById('txtUnvRegFee').value = $responce.data['FUNIVFEE'];
		document.getElementById('txtUnvRegReceiptNo').value = $responce.data['FUNIVRECNO'];
		document.getElementById('txtAdmnFee').value = $responce.data['FLATADMFEE'];
		document.getElementById('txtAdmnReceiptNo').value = $responce.data['FLATRECNO'];
		 
		$.ajax({
				type: "POST",
				url: $host_url+"getCategoryNames.demo",
				data:"id="+'degree_category',
				success:function($responceCat){
				$responceCat = eval('(' +  $responceCat + ')');
				if($responceCat.error_code==0)
				{	
				var optionsAsString = "<option value=''> Select Category </option>";
				for(var i = 0; i < $responceCat.data.length; i++)
				{
					if($responceCat.data[i].internal_code == $responce.data['FCATBIRTH'])
					{
						optionsAsString += "<option value='" + $responceCat.data[i].internal_code + "' selected>" + $responceCat.data[i].value + "</option>";
					}
					else
					optionsAsString += "<option value='" + $responceCat.data[i].internal_code + "'>" + $responceCat.data[i].value + "</option>";
				}
					$("#degree_category" ).append( optionsAsString );
				}
				}
				});
				
			
			$.ajax({
			type: "POST",
			//async:false,
			url: $host_url+"getCombinationNames", 
			data:"&degree="+encodeURIComponent($responce.data['FDEGREE']),
			success:function($responces)
			{
			$responces = eval('(' + $responces + ')');
			
			var optionsAsString = "<option value=''> Select Combination</option>";
			for(var i = 0; i < $responces.data.length; i++) {
				if($responces.data[i].internal_code == $responce.data['FCOMBCODE'])
				{
					optionsAsString += "<option value='" + $responces.data[i].internal_code + "' selected>" + $responces.data[i].value + "</option>";
				}
				else
				optionsAsString += "<option value='" + $responces.data[i].internal_code + "'>" + $responces.data[i].value + "</option>";
			}
			$("#combination" ).append( optionsAsString );
			var inputBoxes = document.getElementsByTagName('input');
		
			for (var counter=0; counter < inputBoxes.length; counter++)
			{
								inputBoxes[counter].disabled=true;
                               
			}
			/* var inputBoxes = document.getElementsByTagName('select');
		
			for (var counter=0; counter < inputBoxes.length; counter++)
			{					
								inputBoxes[counter].disabled=true;
                               
			}*/
			}
			});			
			
			document.getElementById('combination').value = $responce.data['FCOMBCODE'];
		
		$.ajax({
			type: "POST",
			//async:false,
			url: $host_url+"GetUploadedStudentDocuments", 
			data:"&degree="+encodeURIComponent($responce.data['FDEGREE'])+"&appno="+encodeURIComponent($responce.data['FSLNO']),
			success:function(responce)
			{
					responce = eval('(' + responce + ')');

					$("#sedocs_div").html(responce.data);
					
			}
			});
		
		
		document.getElementById('sePADNationality').value = $responce.data['FNATQUALEXAM'];
		document.getElementById('sePADState').value = $responce.data['FSTATEQUALEXM'];
		document.getElementById('seTypeOfQualifyingExam').value = $responce.data['FTYPEQUALEXAM'];
		document.getElementById('seInstitutionName').value = $responce.data['FINSTNAME'];
		document.getElementById('seLocation').value = $responce.data['FINSTLOCAT'];
		document.getElementById('seUniversityName').value = $responce.data['FUNIVNAME'];
		document.getElementById('seExamRegNo').value = $responce.data['FQUALEXREGNO'];
		document.getElementById('seLanguages1').value = $responce.data['FLANGUAGE'];
		document.getElementById('seSpecialization').value = $responce.data['FSUBSPECIAL'];
		document.getElementById('seModeEdu').value = $responce.data['FMODEDU'];
		document.getElementById('seInterval').value = $responce.data['FEXAMINTERVAL'];
		document.getElementById('entranceExamMarks').value = $responce.data['FENTEXMARKS'];
		document.getElementById('nosemYear').value = $responce.data['FNOSEMYEAR'];
		document.getElementById('student_entry_Ph').value = $responce.data['FPHTYPE'];
		document.getElementById('txtEligbFee').value = $responce.data['FELIGFEE'];
		document.getElementById('txtEligbRecNo').value = $responce.data['FELIGRECNO'];
		if($responce.data['FHK'] == 'HK')
		{
			document.getElementById('chkHydKar').checked = true; 
		}
		$('#seWeightedAverage').html($responce.data['FWGHTAVGMARKS']);
		  
		//yearof_pass  mnth_pass  marks_sec  marks_total marks_per
		
		$("#student_entry_photo").attr("src", $responce.data['FPHOTOPATH']);
		$("#student_signature_photo").attr("src", $responce.data['FSIGNPATH']);
		document.getElementById('wghtAvgPer').value = $responce.data['FWGHTAVGMARKS'];
		var yscnt =$responce.data['FNOSEMYEAR'];
		var ystable='';
		ystable +="<tr><td style='width:100px;border:1px solid #000;padding:5px 5px;font-size:14px;'>Sem / Year</td><td style='width:100px;border:1px solid #000;padding:5px 5px;font-size:14px;'>Month of Passing</td><td style='width:100px;border:1px solid #000;padding:5px 5px;font-size:14px;'>Year of Passing</td><td style='width:100px;border:1px solid #000;padding:5px 5px;font-size:14px;'>Marks Scored</td><td style='width:100px;border:1px solid #000;padding:5px 5px;font-size:14px;'>Total Marks</td><td style='border:1px solid #000;padding:5px 5px;font-size:14px;'>% of Marks</td></tr>";
		var passmth = $responce.data['FPASSMNTH'];
		var passmthArray = passmth.split('*'); 
		var passyear = $responce.data['FPASSYER'];
		var passyearArray = passyear.split('*'); 
		var marksecure = $responce.data['FMARKSECURED'];
		var marksecArray = marksecure.split('*'); 
		var markTotal = $responce.data['FMARKTOTAL'];
		var markTotArray = markTotal.split('*'); 
		var markPercnt = $responce.data['FPERMARK'];
		var markPercntArray = markPercnt.split('*'); 
		
		var index = 0;
		var avgSecMarks= 0;
		var avgTotMarks= 0;
		var avgPerMarks =0;
		for(var i=0;i<yscnt;i++)
		{	
			++index;
			avgSecMarks += parseInt(marksecArray[i]);
			avgTotMarks += parseInt(markTotArray[i]);
			
			ystable +="<tr><td style='border:1px solid #000'><input type='text' id='semyear"+index+"' value="+index+" style='width:100px;text-align:center;padding:5px 5px;'/></td><td style='border:1px solid #000'><input type='text' id='mnth_pass"+index+"' value='"+passmthArray[i]+"' maxlength=3 style='width:100px;padding:5px 5px;text-transform: uppercase;'/></td><td style='border:1px solid #000'><input type='text' id='yearof_pass"+index+"' value='"+passyearArray[i]+"' style='width:100px;padding:5px 5px;'/></td><td style='border:1px solid #000'><input type='text' id='marks_sec"+index+"' value='"+marksecArray[i]+"' style='width:100px;padding:5px 5px;'/></td><td style='border:1px solid #000'><input type='text' id='marks_total"+index+"' value='"+markTotArray[i]+"' onblur='calcuPercent("+index+")' style='width:100px;padding:5px 5px;'/></td><td style='border:1px solid #000'><input disabled id='marks_per"+index+"' value='"+markPercntArray[i]+"' style='padding:5px 5px;'></td></tr>";
		}

		avgPerMarks = (parseInt(avgSecMarks) / parseInt(avgTotMarks)) * 100;
		var totalpertage = avgPerMarks.toFixed(2);
		ystable +="<tr><td style='border:1px solid #000;font-size:16px;text-align:center;' colspan='3'>Total </td><td style='border:1px solid #000'><input disabled type='text' id='marks_secTot' value='"+avgSecMarks+"' style='width:100px;padding:5px 5px;'/></td><td style='border:1px solid #000'><input type='text' disabled id='marks_subtotal' value='"+avgTotMarks+"' style='width:100px;padding:5px 5px;'/></td><td style='border:1px solid #000'><input disabled id='marks_Avgper' value='"+totalpertage+"' style='padding:5px 5px;'></td></tr>";
		$("#symdytable").html(ystable);
		var Vmode = 1;
		
		GetCombinationSubjectList($responce.data['FCOLLCODE'],$responce.data['FCOMBCODE']);
		});
	}	
	else if($responce.error_code == -2)
	{
		DeletedRecords = 0;
		//$("#error_msg").html(" In Valid SL Number ");
		alert('In Valid SL Number');
		$("#student_entry_slno").val('');	
		document.getElementById('student_entry_slno').focus();	
	}
}


function GetCombinationSubjectList(collcode,combcode)
{
	if( jQuery.trim($("#student_entry_degree_code").val())!='')
	{
		$sl_no='';
		$sl_no=encodeURIComponent(trim($("#student_entry_admno").val()));
		$.ajax({
				type: "POST",
				//async:false,
				url: $host_url+"getAppStudsubApprTotal", 
				data:"degree_code="+$("#student_entry_degree_code").val()+"&exam="+$("#student_entry_exam").val() +
				"&sl_no="+$sl_no+"&collcode="+collcode+
				"&sub_degree="+encodeURIComponent(trim($("#student_entry_sub_degree_code").val()))+
				"&combination="+combcode,
				success: subjectAppearingTotalResponse
			});	
	}	
}
function subjectAppearingTotalResponse($responce)
{
	$responce = eval('(' + $responce + ')'); 
	$("#subject_appearing").show();
	$("#subject_appearing").html($responce.data.html);	
}


function saveApproveStatus()
{
   if(gsl_no != 0)
   {
	$.ajax({
			type: "POST",
			//async:false,
			url: $host_url+"updateAdmissionStatus", 
			data:"&sl_no="+encodeURIComponent(gsl_no)+"&collcode="+encodeURIComponent(gcollcode)
			+"&degree="+encodeURIComponent(gdegree)+"&appstatus="+encodeURIComponent($("#approvestatus").val()),
			success:function(responce)
			{
					responce = eval('(' + responce + ')');
					if(responce.error_code == 0)
					{
						alert(responce.data);
						gsl_no = 0;
					}
			}
			});
	}		
}

function backAdmissionList()
{
	gsl_no = 0;
	$("#page_main_div").load('html_modules/approve.html',function()
	{	
		document.getElementById('display_module_name').innerHTML = ' Admission Approve ';
		document.getElementById('module_name_for_save').value = 'Admission Approve'; 
		getDefaultHeadFooterLinks('Admission Approve'); 
	
 	$.ajax({
        type: "POST",
	   	url: $host_url+"GetAllSelectDropdown",
		success: function($responce)
		{
			$responce = eval('('+$responce+')');
			 var optionsAsString = "<option value=''> Select College </option>";
			for(var i = 0; i < $responce.data.length; i++)
			{
				if($responce.data[i].internal_code == gsrchColl)
				{
					optionsAsString += "<option value='" + $responce.data[i].internal_code + "' selected>" + $responce.data[i].value + "</option>";
				}
				else
				optionsAsString += "<option value='" + $responce.data[i].internal_code + "'>" + $responce.data[i].value + "</option>";
			}
			$("#appcollege" ).append( optionsAsString ); 
		}
		
  });
	
	$.ajax({
        type: "POST",
		data:'&collcode='+gsrchColl,
	   	url: $host_url+"GetCollegeDegreeDropdown",
		success: function($responceDeg)
		{
			$responceDeg = eval('('+$responceDeg+')');
			 var optionsAsString = "<option value=''> Select College </option>";
			for(var i = 0; i < $responceDeg.data.length; i++)
			{
				if($responceDeg.data[i].internal_code == gsrchDeg)
				{
					optionsAsString += "<option value='" + $responceDeg.data[i].internal_code + "' selected>" + $responceDeg.data[i].value + "</option>";
				}
				else
				optionsAsString += "<option value='" + $responceDeg.data[i].internal_code + "'>" + $responceDeg.data[i].value + "</option>";
			}
			$("#appdegree" ).append( optionsAsString ); 
		}
		});
		
		$.ajax({
			type: "POST",
			//async:false,
			url: $host_url+"getCombinationNames", 
			data:"&degree="+gsrchDeg,
			success:function($responceComb)
			{
				$responceComb = eval('(' +  $responceComb + ')');
				var optionsAsString = "<option value=''> Select Combination </option>";
				for(var i = 0; i < $responceComb.data.length; i++)
				{
					if($responceComb.data[i].internal_code == gsrchComb)
					{
						optionsAsString += "<option value='" + $responceComb.data[i].internal_code + "' selected>" + $responceComb.data[i].value + "</option>";
					}
					else
					optionsAsString += "<option value='" + $responceComb.data[i].internal_code + "'>" + $responceComb.data[i].value + "</option>";
				}
				$("#degcomb" ).append( optionsAsString ); 
			}
			});
		
	
	$("#appr_status").val(gsrchStatus);
	   	
	$.ajax({
        type: "POST",
		data:'&collcode='+gsrchColl+"&degcode="+gsrchDeg
		+"&combcode="+gsrchComb+"&apprstatus="+gsrchStatus,
	   	url: $host_url+"GetAdmissionList",
		success: responceGetAdmissionList
		});
		
	});	
}