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


Current Path : /proc/thread-self/root/var/www/html/ssa/js_16042016/
Upload File :
Current File : //proc/thread-self/root/var/www/html/ssa/js_16042016/usersubj_identification_09012016.js

 var $g_user_subjIdentfy_details='';
 
function CallUserSubjIdentification()
 {
	$("#page_main_div").load('html_modules/user_subjIdentification.html',function()
	{
		window.location.g_FeePopUpExamNo='';
		document.getElementById('display_module_name').innerHTML = 'User Wise Subject Identification';
		document.getElementById('module_name_for_save').value = 'saveUserSubjIdentfy';
	
		getDefaultHeadFooterLinks("User Wise Subject Identification");
		ClearUserSubjIdentify();
		$.ajax({
			type: "POST",
			url: $host_url+"getUserRightsDetails.demo",      
			success: populateUserSubjDetailsResponse
		}); 
	});
}
function populateUserSubjDetailsResponse($responce)
{
  $responce = eval('(' + $responce + ')'); 
 
   document.getElementById('user_rights_user').options.length = 0;
  
		$op = new Option('Select One', '0');
		$op.id='0';
		document.getElementById('user_rights_user').options.add($op);
		
		
		 
	 for($i=0;$i < $responce.data['user_rights_user'].length;$i++)                                  
		{            
	    	$op = new Option($responce.data['user_rights_user'][$i]['value'], $responce.data['user_rights_user'][$i]['internal_code']);
			$op.id=$responce.data['user_rights_user'][$i]['internal_code'];//specifying the id  for options
			document.getElementById('user_rights_user').options.add($op);
		}
	
		 document.getElementById('user_subject_table_data_div').innerHTML='';
		 //getUserRightModuleNames(0,'');
		 
}

function ClearUserSubjIdentify()
{
	$("#user_rights_user").val('');		
	$("#user_subj_degree_code").val('');	
	$("#user_subj_degree_name").val('');	
	$("#user_subject_table_data_div").html("");	
	document.getElementById('user_rights_user').disabled=false;
	document.getElementById('user_subj_degree_code').disabled=false;
	document.getElementById('user_rights_user').focus();
}

function PopulateUserSubjectList()
{
	var userType=$("#user_rights_user").val();
	var degree=$("#user_subj_degree_code").val();
	if(empty(userType))
	{
		alert("Select User");
		return;
	}
	if(empty(degree))
	{
		alert("Select Degree");
		return;
	}
	$.blockUI({ message: "<h1 class='h1' style='font-size:12px'><img src='images/ajax-loader.gif' border='0'></h1>" });
		$.ajax({
		type: "POST",
		data:"degree="+degree+"&userType="+userType,
		url: $host_url+"PopulateUserSubjectList",
		success: PopulateUserSubjectListResponce
		});
}

function PopulateUserSubjectListResponce($responce)
{
	$responce = eval('('+$responce+')');
	$.unblockUI();
	if($responce.error_code==0)
	{
		$g_user_subjIdentfy_details = $responce;
		$("#user_subject_table_data_div").html($responce.data['html_data']);
		document.getElementById('user_rights_user').disabled=true;
		document.getElementById('user_subj_degree_code').disabled=true;
		
	}
	

}
function selectAllUserSubject()
{
		if(document.getElementById('check_Allrow').checked==true)
		{
			for($i=0;$i<$g_user_subjIdentfy_details.data['module_id_details'].length;$i++)
			{
				$id=$g_user_subjIdentfy_details.data['module_id_details'][$i].fsubcode;
				document.getElementById('check_row_'+$id).checked=true;
				
			}
		}
		else
		{
		 	for($i=0;$i<$g_user_subjIdentfy_details.data['module_id_details'].length;$i++)
			{
				$id=$g_user_subjIdentfy_details.data['module_id_details'][$i].fsubcode;
				document.getElementById('check_row_'+$id).checked=false;
				
			}
		} 
}


function SaveUserSubjIdentify()
{
	var userType=$("#user_rights_user").val();
	var degree=$("#user_subj_degree_code").val();
	var subjSelected='';
	for($i=0;$i<$g_user_subjIdentfy_details.data['module_id_details'].length;$i++)
	{
		$id=$g_user_subjIdentfy_details.data['module_id_details'][$i].fcsubcode;
		if(document.getElementById('check_row_'+$id).checked==true)
		{
			subjSelected+= document.getElementById('check_row_'+$id).value+"*";
		}
	}
	$.ajax({
		type: "POST",
		data:"degree="+degree+"&userType="+userType+"&subjSelected="+subjSelected,
		url: $host_url+"saveUserSelectedSubjectList",
		success: saveUserSelectedSubjectListResponce
		});
	

}


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