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


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

function CallEnableUpdateSectionScreen()
{ 
	$("#page_main_div").load('html_modules/update_studentSection.html',function()
	{	
 
	document.getElementById('display_module_name').innerHTML = 'Update Section';
	document.getElementById('module_name_for_save').value = 'Update Section';	 	
	getDefaultHeadFooterLinks("Update Section");
	ClearStudentSection();
	}
	);



}

function ClearStudentSection()
{
	$("#stud_section_degree_code").val('');		
	$("#stud_section_degree_name").val('');
	$("#stud_section_Examno").val('');		
	$("#stud_section_Examno_name").val('');
	$("#update_stud_section").html('');

}

function studentUpdateSectionList()
{
	var degree=$("#stud_section_degree_code").val();
	var exam_no=$("#stud_section_Examno").val();
	if(empty(degree))
	{
	alert("Degree cannot be empty");
	$("#stud_section_degree_code").focus();
	return;
	}
	if(empty(exam_no))
	{
	alert("Exam cannot be empty");
	$("#stud_section_Examno").focus();
	return;
	}
	if($("#markentry_sub_range").val() == 'B/W')
	{
		condition_name = " between ";
		condition_val = "'"+$("#markentry_sub_range_from").val()+"'"+" and "+"'"+$("#markentry_sub_range_to").val()+"'";
	}
	else 
	{	
		condition_name = "like ";
		condition_val = $("#markentry_sub_range_bw").val();
	}
	$.blockUI({ message: "<h1 class='h1' style='font-size:12px'><img src='images/ajax-loader.gif' border='0'></h1>" });
		 $.ajax({
		type: "POST",
		data:"degree="+degree+"&examno="+exam_no+"&condition_val="+condition_val+"&condition_name="+condition_name,
		url: $host_url+"PopulateStudentUpdateSection",
		success: PopulateStudentUpdateSectionResponce
		});

}

function PopulateStudentUpdateSectionResponce($responce)
{
	$responce = eval('('+$responce+')');
	$.unblockUI();
	if($responce.error_code==-1)
	{
		alert($responce.data);
	}
	else
	{
	$("#update_stud_section").show();
	$("#update_stud_section").html($responce.data['html']);
	}
	

}

function SaveStudentSection()
{
	
	var att_data = new Object();
 
			html_objects =$("input[id*='regno_']");
			jQuery.each(html_objects, function(k, v) {
			var internal_code=v['id'].split("_")[1];
			att_data[internal_code]=new Object();
			
			att_data[internal_code]['c']=$("#section_"+internal_code).val();
			
	  	});	
		
	var myJSONText = encodeURIComponent(JSON.stringify(att_data));  
	$list_data="output_details="+myJSONText;
	$.ajax({
				type: "POST",
				async:false,
				url: $host_url+"SaveStudentSectionDetails",
				data:$list_data,	
				success: SaveStudentSectionDetailsResponce
			}); 
} 

function SaveStudentSectionDetailsResponce($responce)
{
	$responce = eval('(' + $responce + ')'); 
	
	if($responce.error_code==0)
	{
		alert($responce.data);   		
		$('#markentry_sub_degree_code').focus;
		 	
	}
	else  
	{
		alert($responce.data); 		
		 
	}	
	$("#update_stud_section").html('');
}