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


Current Path : /var/www/html/sikkim/js19042016/popups/
Upload File :
Current File : /var/www/html/sikkim/js19042016/popups/SubDegreeDetailsPopup.js

//Jijo Added SubDegree.


function openSubDegreeDetailsPopup()
{

	switch(document.getElementById('module_name_for_save').value)
	{	
	
		case 'StudentEntry':			
			SubDegreePopHtml('FCADSTATUS');						
		break;
		
		default: 
			SubDegreePopHtml('');
			break;
	}	
} 

var $g_ref_data_arr='';
$host_url= getCookie('host_url');
$image_path= getCookie('image_path');

function SubDegreePopHtml($module)
{	
	$('#dialog').dialog('open');	
	$("#dialog").data("height.dialog", 222);
	$(".ui-dialog").css({width:460});
	$('#ui-dialog-title-dialog').html("Sub Degree Details"); 
	
$main="<table id='sub_degree_grid' class='scroll' ondblclick='selectSubDegreeCode();'></table> <div  id='sub_grid_div3' class='scroll' style='text-align:center;'></div>";
document.getElementById('dialog').innerHTML=$main;

var subdegree =jQuery("#sub_degree_grid").jqGrid(
	{	 
	 url:$host_url+'degreeDetailsPopup.demo'+"&type="+$module,	 
	 datatype: "json",	 
	 colNames:['Code','Description'],	 
	 colModel:[{name:'FDEGREE',index:'FDEGREE', width:80 },{name:'FDESCPN',index:'FDESCPN', width:80 }],
	 rowNum:10,
	 rowList:[5,10,15,20,25,30],
	 imgpath:$image_path,
	 pager: jQuery('#sub_grid_div3'),
	 sortname: 'id',
	 height:'119',
	 width:'457',
	 viewrecords: true,
	sortorder: 'desc',
	multiselect: false,
	cellEdit: true,
	//forceFit : true, 
	//cellsubmit: 'clientArray',						 
	addCaption: "Add Recordddd" 
	}		
 	).navGrid('#sub_grid_div3',{edit:false,add:false,del:false,search:false},{},{},{},{multipleSearch:true}).
	navButtonAdd('#sub_grid_div3',{caption:"",
	buttonicon :'ui-icon-search', onClickButton:function(){degree[0].toggleToolbar() } }). 
	navButtonAdd('#sub_grid_div3',{caption:"Select", onClickButton:function()
		{
			selectSubDegreeCode();
		}
		}); 
		subdegree.filterToolbar();	
		$("#gs_FDEGREE").focus();
			   $('.ui-search-toolbar').bind('keydown',function(evt) 
				{
					var kC  = (evt.which) ? evt.which : evt.keyCode;
					 
				 	if(kC==40)
					jQuery('#sub_degree_grid').editCell(0,0,false);	
				/* 	if(kC==39) 
					 $('#'+evt.target.id).focusNextInputField();
					 if(kC==37) 
					 $('#'+evt.target.id).focusPreviousInputField();	 */					
				} );			
	} 	
	
function selectSubDegreeCode()
{
var id=jQuery("#sub_degree_grid").getGridParam('selrow'); 
	if( id!=null  )   
	{  
		$.ajax({
	       type: "POST",
			async:false,
	       data: "degree_code="+id,
	       url: $host_url+"getdegreeNames.demo",
 	       success: PopulateSubDegreeCodeResponse
	    });
		$('#dialog').dialog("close"); 	
	} 
	else
	{ 
		alert("Please select row");  
	} 
	return;
}

function  PopulateSubDegreeCodeResponse($responce)
{
 $responce = eval('(' + $responce + ')'); 
 
	if($responce.error_code == 0)
	{ 
		switch(document.getElementById('module_name_for_save').value)
		{
			case 'StudentEntry':	   
				$("#error_msg").html(" ");				
				$("#student_entry_sub_degree_code").val($responce.data.FDEGREE);
				$("#student_entry_sub_degree").val($responce.data.FDESCPN);				
				
			//document.getElementById('student_entry_sub_degree_code').value = $responce.data['FDEGREE'];
			//document.getElementById('student_entry_sub_degree').value = $responce.data['FDESCPN']; 
			
			var degree_code_val=$("#student_entry_degree_code").val();  
			var sub_degree_code_val=$("#student_entry_sub_degree_code").val();  

			if(degree_code_val== sub_degree_code_val)
			{
			alert('Sub Degree Cannot be same as Degree');			
			 $("#student_entry_sub_degree_code").val('');
		     $("#student_entry_sub_degree").val('');
			 document.getElementById('student_entry_sub_degree_code').focus();
			return;
			}			
			chkStudentEditAdd();
			getsubjectAppearingTotal();
			if((document.getElementById('is_add_edit').value)=='Edit')
				$("#student_entry_slno").focus();
			else
				$("#student_entry_name").focus();
			break;
			
			
					
			case 'ReportAdmissionList':	 		
			    $("#error_msg").html(" ");				
				$("#report_branch_code").val($responce.data.FDEGREE);
				$("#report_branch_name").val($responce.data.FDESCPN);				
				
			var admin_list_degree_code_val=$("#report_degree_code").val();  
			var admin_list_branch_code_val=$("#report_branch_code").val();  

			if(admin_list_degree_code_val== admin_list_branch_code_val)
			{
			alert('Branch Cannot be same as Degree');			
			 $("#report_branch_code").val('');
		     $("#report_branch_name").val('');
			 document.getElementById('report_branch_code').focus();
			return;
			}			
			break;	
			
		}
		
		
		
    }
}