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


Current Path : /var/www/results/vskub/js/
Upload File :
Current File : /var/www/results/vskub/js/jscript_18112017.js

var path_name=window.location.pathname;
//var	funivcode = getCookie('univcode');
path_name=path_name.replace("result.php","");
path_name=path_name.replace("index.php","");
path_name=path_name.replace("subjectDetails.php","");
var $host_url="http://"+window.location.host+"/"+path_name+"/app.php?a=";
path_name=path_name.replace("update_challan.php","");
path_name=path_name.replace("payment_gate_way_responce.php","");
path_name=path_name.replace("src/download_upload.html/","");
$host_url=$host_url.replace("/src/download_upload.html","");
$g_dropdown_data='';
$g_edit_app_code=0;

function GetUrlParameters()
{
	var url_object=new Object();
	var data_set=window.location.href.split("?");
	if(data_set.length>1)
	{
		var params_set=data_set[1].split("&");
		for(i=0;i<params_set.length;i++)
		{
			var pv=params_set[i];
			var pvv=pv.split("=");
			url_object[pvv[0]]=pvv[1];
		}
	}		
	return url_object;	 
}

function home()
{
	window.location.href="index.php";
}

function PopulateResultDegreeList()
{
		$.ajax({
		type: "POST",
		async:false,
		url: $host_url+"PopulateResultDegreeList",
		success: PopulateResultDegreeListResponce
		});
}

function PopulateResultDegreeListResponce(responce)
{	
	responce = eval('(' + responce + ')');
	var html = responce.data['html'];
	$("#degree_list_div").html(html);	
	
}

function ValidateRegNo()
{ 
	var reg_no=trim($("#reg_no").val());
	var exam=$("#exam").val();
	if(empty(reg_no))
	{
		alert("Register number should be entered");
		return false;
	}
	if(exam == 'none')
	{
		alert("Select semister");
		return false;
	} 
	var reg_no = document.getElementById('reg_no').value;
		$.ajax({
		type: "POST",
		data:"&reg_no="+reg_no+"&exam="+exam, 
		url: $host_url+"ValidateRegNo",
		success: function ValidateReg(responce)
				{
					responce = eval('(' +  responce + ')');
					if(responce.error_code== '-1')
					{
						alert(responce.data);
						document.getElementById('reg_no').focus();
						return false;
					}else
					if(responce.error_code== '0')
						var temres = responce.data
						setCookie("univcode",temres,1);
						//window.location.href="result.php?r="+reg_no+"&e="+exam;
					if(document.getElementById('catscst').checked ==true)
						category = document.getElementById('catscst').value;
					else
						category = '';						
						window.location.href="result.php?r="+reg_no+"&e="+exam+"&ct="+category;
				}
		});
	
}

	function OpenUpdateChallanScreen(app_no,reg_no,exam_no)
	{
		var s = $(".reg_no_div").position();	
		var Left = s.left+2+"px";;
		var Top = s.top+50+"px";	

			$.ajax({
				type: "POST",
				async:false,
				url: $host_url+"GetStudentDetailsForPayment",
				data:"&app_no="+app_no,
				success: function GetStudentDetailsForPaymentResponse(responce)
				{
					responce = eval('(' + responce + ')'); 
					if(responce.error_code=="0")
					{ 
						ftotal=responce.data['ftotal'];
						$('#dialog').dialog('open');
						$("#dialog").parent().css("top",Top);
						$("#dialog").parent().css("left",Left);
						$("#dialog").parent().css("width","720px");
						$("#dialog").parent().css("height","220px");
						$("#dialog").css("min-height","110px");
						$("#dialog").parent().css("height","170px");
						$("#ui-id-5").css("font-size","12px");
						$("#dialog").dialog('option', 'title', "Challan Update Details for "+app_no);
						$("#dialog").load("update_challan.html",function()
						{
							$("#date_of_payment").mask({mask: "##/##/####"}) ; 
							$("#amount_paid").val(ftotal);
							$("#st_app_no").val(app_no);
						});
					}
					else
					{
						alert(responce.data);
					}
				} 
			 
			});		
	//window.location.href="update_challan.php?app_no="+app_no+"&r="+reg_no+"&e="+exam_no;
	}

	function date_format($str)
	{ 
		if(trim($str)=="" || $str=="undefined")
			return "0000-00-00";	
		else				
		{
			var indx=$str.indexOf("/");
			if(indx==-1)
				return $str;
			else
			{
				$date=$str.split('/');
				return($date[2] +'-'+$date[1]+'-'+$date[0]);
			}
		}	
			
	}

	function DoUpdateChallan()
	{
		var app_no=trim($("#st_app_no").val());
		var challan_no=trim($("#challan_no").val());
		app_no=app_no.replace(":","");
		var bank_name=trim($("#bank_name").val());
		var date_of_payment=date_format(trim($("#date_of_payment").val()));
		var fchallan_amt=trim($("#amount_paid").val());
		 
		if(empty(challan_no))
		{
			alert("Please Enter Challan No");
			$("#challan_no").focus();
			return false;
		}
		else if(empty(bank_name))
		{
			alert("Please Enter Bank Name");
			$("#bank_name").focus();
			return false;
		}else if((date_of_payment)=="0000-00-00")
		{
			alert("Please Enter Date Of Payment");
			$("#date_of_payment").focus();
			return false;
		}
		else if(empty(fchallan_amt) || fchallan_amt=='0')
		{
			alert("Please Enter Amount Paids");
			return false;
		}
		var lstr_data="&app_no="+app_no+"&fbank_name="+bank_name+"&fchallan_date="+date_of_payment+"&fchallan_no="+challan_no+"&fchallan_amt="+fchallan_amt;	
			$.ajax({
			type: "POST",
			async:false,
			data:lstr_data,
			url: $host_url+"DoUpdateChallan",
			success: function DoUpdateChallanResponce(responce)
					{  
						responce = eval('(' +  responce + ')');
						if(responce.error_code==0)
						{
							alert(responce.data);
							$('#dialog').dialog('close');
							DisplayRevalutionApplications();
						}
						else
						{
							alert(responce.data);
						}
					}
			});

	}

function PopulateResultDegreeList()
{
	$.ajax({
	type: "POST",
	async:false,
	url: $host_url+"PopulateResultDegreeList",
	success: PopulateResultDegreeListResponce
	});
}

function PopulateResultDegreeListResponce(responce)
{
	responce = eval('(' + responce + ')');
	var html=responce.data['html'];
	var mess_data=responce.data['mess_data'];
	$("#degree_list_div").html(html);	
	$("#message_board").html(mess_data);	
	 
}

function DisplayStudentResult(r,e,ct)
{
	//alert(getCookie('univcode'));
	$.ajax({
	type: "POST",
	async:false,
	data:"r="+r+"&e="+trim(e)+"&ct="+ct,
	url: $host_url+"DisplayStudentResult",
	success: DisplayStudentResultResponce
	});
}

function DisplayStudentResultResponce(responce)
{
	 responce = eval('(' + responce + ')');
	 //alert(getCookie('univcode'));
	 var html=responce.data['html'];
	 var FRESULTDATE=responce.data['FRESULTDATE'];
	 var scroll_txt=responce.data['scroll_txt'];
	 var rv_rt_total_fee=parseFloat(responce.data['rv_rt_total_fee']);
	
	 if(rv_rt_total_fee==0)
	 {
		$("#ui-id-3").hide();
		$("#ui-id-2").hide();
		$("#ui-id-4").hide();
	 }	 
	 $("#ContentPlaceHolder1_lblDate").html("Result Announced Date: "+FRESULTDATE);
	 $("#ContentPlaceHolder1_lblExmLastDate").html(scroll_txt);
	 if(responce.error_code==-1)
	 {
		$("#result_error_div").html(html);
		$("#result_error_div").show();
		$("#ContentPlaceHolder1_lblDate").html("");
		$("#ContentPlaceHolder1_lblExmLastDate").html("");
	 }
	 else
	 {
		$("#result_error_div").html("");
		$("#result_error_div").hide();
		$("#result_success_div").html(html);
	 }	 
}

function DisplayStudentsubjectDetailsResult(r,e)
{
	$.ajax({
	type: "POST",
	async:false,
	data:"r="+r+"&e="+e,
	url: $host_url+"DisplayStudentsubjectDetailsResult",
	success: DisplayStudentsubjectDetailsResultResponce
	});
}

function DisplayStudentsubjectDetailsResultResponce(responce)
{
	 responce = eval('(' + responce + ')');
	 var html=responce.data['html'];
	 if(responce.error_code==-1)
	 {
		 $("#result_error_div").html(html);
		 $("#result_error_div").show();
	 }
	 else
	 {
		 $("#result_error_div").html("");
		 $("#result_error_div").hide();
		 $("#result_success_div").html(html);
	 } 
}

function DisplayRevalutionDetails()
{
	url_object=GetUrlParameters();
	var r=url_object['r'];
	var e=url_object['e'];
	$.ajax({
		type: "POST",
		async:false,
		data:"r="+r+"&e="+e,
		url: $host_url+"DisplayRevalutionDetails",
		success: DisplayRevalutionDetailsResponce
		});		 
}

function DisplayRevalutionDetailsResponce(responce)
{
	 responce = eval('(' + responce + ')');
	 var html=responce.data['reval_html'];
	 if(responce.error_code==0)
	 {
		var student_info='<br><table width="100%" align="center" class="result_table_header">'+$("#student_info").html()+'</table><br>';
		$("#revaluation").html(student_info+html);
		$("#result_error_div").show();
	 }
}
function ValidateStudentMobileNo()
{
	var FMOBILE=$("#FMOBILE").val();
	if(empty(FMOBILE))
	{
		alert(FMOBILE);
		return false;
	}
	url_object=GetUrlParameters();
	var r=url_object['r'];
	var e=url_object['e'];
	$.ajax({
		type: "POST",
		async:false,
		data:"r="+r+"&e="+e+"&FMOBILE="+FMOBILE,
		url: $host_url+"ValidateStudentMobileNo",
		success: ValidateStudentMobileNoResponce
		});		 
}

function MakeOnlinePayment(app_no)
{
	window.location.href="payment_gateway.php?productinfo="+app_no;
}

function ValidateStudentMobileNoResponce(responce)
{
	responce = eval('(' + responce + ')');
	if(responce.error_code==0)
	{
		DisplayRevalutionApplications();
	}
	else
	{
		alert("Invalid Mobile No");
		$("#your_app_div").html("");
	}
}

function DisplayRevalutionApplications()
{
	url_object=GetUrlParameters();
	var r=url_object['r'];
	var e=url_object['e'];
	$.ajax({
		type: "POST",
		async:false,
		data:"r="+r+"&e="+e,
		url: $host_url+"DisplayRevalutionApplications",
		success: DisplayRevalutionApplicationsResponce
		});		 
}

function DisplayRevalutionApplicationsResponce(responce)
{
	 responce = eval('(' + responce + ')');
	 var html=responce.data['html'];
	 if(responce.error_code==0)
	 {
		var student_info="";
		if(trim($("#student_info").html())!='undefined' && !empty($("#student_info").html()))
		{	 
			student_info='<table width="100%" align="center" class="result_table_header">'+$("#student_info").html()+'</table><br><br>';
		}
		$("#mobile_no_div").hide();
			$("#applications").html(student_info+html);
		$("#your_app_div").html(student_info+html);
	 }
}

function CalculateRevaluationTotFee()
{
 
	html_objects = $("input[id*='rv_']");
	if(empty(html_objects) || html_objects.length==0)
	html_objects = $("input[id*='rt_']");
	if(empty(html_objects) || html_objects.length==0)
	html_objects = $("input[id*='xr_']");
	if(empty(html_objects) || html_objects.length==0)
	html_objects = $("input[id*='cv_']"); 
	var total_fee=0;
	
	for($i=0;$i<html_objects.length;$i++)
	{
		var rv_total="0";
		var rt_total="0";
		var xr_total="0";
		var cv_total="0";
		var id=html_objects[$i]['id'];
		var internal_code=id.split("_")[1];
		
		if($("#rv_"+internal_code).is(':disabled')==false && $("#rv_"+internal_code).is(':checked')==true)
			rv_total=$("#fee_rv_"+internal_code).html();
		else
			rv_total="0";
			rv_total=rv_total.replace("(","");
			rv_total=rv_total.replace(")","");
		if($("#rt_"+internal_code).is(':disabled')==false && $("#rt_"+internal_code).is(':checked')==true)
			rt_total=$("#fee_rt_"+internal_code).html();
		else
			rt_total="0";
			rt_total=rt_total.replace("(","");
			rt_total=rt_total.replace(")","");
		if($("#xr_"+internal_code).is(':disabled')==false && $("#xr_"+internal_code).is(':checked')==true)
			xr_total=$("#fee_xr_"+internal_code).html();
		else
			xr_total="0";
			xr_total=xr_total.replace("(","");
			xr_total=xr_total.replace(")","");
			
		if($("#cv_"+internal_code).is(':disabled')==false && $("#cv_"+internal_code).is(':checked')==true)
			cv_total=$("#fee_cv_"+internal_code).html();
		else
			cv_total="0";
			cv_total=cv_total.replace("(","");
			cv_total=cv_total.replace(")","");
			
		var row_tot=parseFloat(rv_total)+parseFloat(rt_total)+parseFloat(xr_total)+parseFloat(cv_total);
		$("#total_"+internal_code).html(row_tot);
		total_fee=parseFloat(total_fee+row_tot);
	  
	} 
	$("#grand_total").html(total_fee);	
	  
}

function SaveRevaluation()
{
	var	funivcode = getCookie('univcode');
	if(funivcode == '027' || funivcode == '016' || funivcode =='018' || funivcode =='029')
	{
		var grand_total=parseFloat($("#grand_total").html());
		if(empty(grand_total))
		{
		alert("Please select any Subjects");
		return false;
		}	
	}else
	{	
		var grand_total=parseFloat($("#grand_total").html());
		var fpaymode=  $("#fpaymode").val() ;
		var FMOBILE=  $("#FMOBILE").val() ;
		var FEMAIL =  $("#FEMAIL").val();
		
		if(funivcode == '026')
			var FEMAIL =  $("#FEMAIL").val() ;
		 
		if(fpaymode=="Select")
		{
			alert("Please select Payment Type");
			return false;
		} 
		else if(empty(grand_total))
		{
			alert("Please select any Subjects");
			return false;
		}

		if(empty(FMOBILE)|| FMOBILE.length != 10)
		{
			alert("Enter 10 digit valid Mobile No.");
			return false;
		}
		if(empty(FEMAIL))
		{
			alert("Please Enter Email");
			return false;
		}
		if(funivcode == '026')
		{
			//alert(FEMAIL);
			if(empty(FEMAIL))
			{
				alert("Please Enter valid Email");
				return false;
			}
		}	
		
	}
	html_objects = $("td[id*='fccode_']");
	var reval_arr = new Object();
	 
	for($i=0;$i<html_objects.length;$i++)
	{
		var id=html_objects[$i]['id'];
		var internal_code=id.split("fccode_")[1];
		var rv_total="0";
		var rt_total="0";
		var xr_total="0";
		var cv_total="0";
		var row_total=parseFloat($("#total_"+internal_code).html());
		var fccode=($("#fccode_"+internal_code).html());
		if(row_total>0)
		{
			reval_arr[internal_code]= new Object();
			reval_arr[internal_code]['row_total']=row_total;
			reval_arr[internal_code]['fccode']=fccode;
			if($("#rv_"+internal_code).is(':disabled')==false && $("#rv_"+internal_code).is(':checked')==true)
			{
				rv_total=$("#fee_rv_"+internal_code).html();
				rv_total=rv_total.replace("(","");
				rv_total=rv_total.replace(")","");
				reval_arr[internal_code]['RV']=rv_total;
			}
			if($("#rt_"+internal_code).is(':disabled')==false && $("#rt_"+internal_code).is(':checked')==true)
			{
				rt_total=$("#fee_rt_"+internal_code).html();
				rt_total=rt_total.replace("(","");
				rt_total=rt_total.replace(")","");
				reval_arr[internal_code]['RT']=rt_total;
			}
			if($("#xr_"+internal_code).is(':disabled')==false && $("#xr_"+internal_code).is(':checked')==true)
			{
				xr_total=$("#fee_xr_"+internal_code).html();
				xr_total=xr_total.replace("(","");
				xr_total=xr_total.replace(")","");
				reval_arr[internal_code]['XR']=xr_total;
			}
			if($("#cv_"+internal_code).is(':disabled')==false && $("#cv_"+internal_code).is(':checked')==true)
			{
				cv_total=$("#fee_cv_"+internal_code).html();
				cv_total=cv_total.replace("(","");
				cv_total=cv_total.replace(")","");
				reval_arr[internal_code]['CV']=cv_total;
			}
		}
		url_object=GetUrlParameters();
		var r=url_object['r'];
		var e=url_object['e'];
	}
	var myJSONText = JSON.stringify(reval_arr);   
	if(funivcode == '027' || funivcode == '016' || funivcode =='018' || funivcode =='029' )
	{
		$lstr_string="&reg_no="+encodeURIComponent(trim(r));	
		$lstr_string+="&e="+encodeURIComponent(trim(e));	
		$lstr_string+="&grand_total="+grand_total;
		$lstr_string+="&FEMAIL="+FEMAIL;
		
	}else
	{	
		$lstr_string="&reg_no="+encodeURIComponent(trim(r));	
		$lstr_string+="&e="+encodeURIComponent(trim(e));	
		$lstr_string+="&grand_total="+grand_total;	
		$lstr_string+="&fpaymode="+fpaymode;	
		$lstr_string+="&FMOBILE="+FMOBILE;
		$lstr_string+="&FEMAIL="+FEMAIL;
	}
	$lstr_string+="&myJSONText="+myJSONText;	
		$.ajax({
		type: "Post",
		url: $host_url+"SaveRevalution",
		data: $lstr_string,
		success:saveRevaluationresponce
		});	
}
		 
function saveRevaluationresponce($responce)
{
	$responce=eval('(' +$responce +')');
	if($responce.error_code==0)
	{	
		$("#reval_details").html($responce.data);
	}
	else
	{
		alert($responce.data)
	}	
}

function PrintRevaluationApplicationForm(app_no)
{
	window.location.href=$host_url+"PrintRevaluationApplicationForm&app_no="+app_no;
}

function PrintRevaluationApplicationFormChallan(app_no)
{
	window.location.href=$host_url+"PrintRevaluationApplicationFormChallan&app_no="+app_no;
}

function trim($str)
{
  return jQuery.trim($str);
}
 
function empty (mixed_var) 
{
    var key;    
    if (mixed_var === "" ||
        mixed_var === 0 ||
        mixed_var === "0" ||
        mixed_var === null ||        mixed_var === false ||
        typeof mixed_var === 'undefined'
    ){
        return true;
    } 
    if (typeof mixed_var == 'object') {
        for (key in mixed_var) {
            return false;
        }        return true;
    }
 
    return false;
}
function in_array(needle, haystack, argStrict)
{
    var key = '', strict = !!argStrict;
    if (strict)
	{
        for (key in haystack)
		{
            if (haystack[key] === needle)
			{
                return true;
            }
        }
    } else
	{
        for (key in haystack)
		{
            if (haystack[key] == needle)
			{
                return true;
            }
        }
    }

    return false;
}
//downloadFileFromServer
function DownLoadUpload()
{
	$('#tabs').load("src/download_upload.html");
}

function downloadFileFromServer()
{
	if( trim(document.getElementById('download_upload_path').value) == '' )
	{
		alert('Please Enter the Path.');
		document.getElementById('download_upload_path').focus();
		return;
	}
	else
	{		
		window.location.href=$host_url+"downloadFileFromServer&download_file_path="+$("#download_upload_path").val();
	}
}

function UploadFileToServer()
{
	if( trim(document.getElementById('upload_to_server_file_name').value) == '' )
	{
		alert('Please Enter the File Path.');
		document.getElementById('upload_to_server_file_name').focus();
		return;
	}
	else
	{		
		ext = document.getElementById('upload_to_server_file_name').value;
		filepath = ext;		
		ext = ext.substring(ext.length-3,ext.length);
		ext = ext.toLowerCase();    
	    if(ext != "")
	    {	  
			document.getElementById('form_upload_download_details').action = $host_url+"UploadFileToServer&filepath="+filepath+"&storage_path="+$("#download_upload_file_path").val();           
			document.getElementById('form_upload_download_details').target='_new';
			// document.getElementById('form_module_details_upload').target='report_display';
			document.getElementById('form_upload_download_details').submit();
 		}    		   		  
	    else 
		{
			alert("Please select a File");
		}
	} 	  
} 
function emailValidate(emailid)
{
	var atpos = emailid.indexOf("@");
    var dotpos = emailid.lastIndexOf(".");
	if (atpos<1 || dotpos<atpos+2 || dotpos+2>=emailid.length)
	{
		return false;
	}
	else
		return true;
}
function setCookie(c_name,value,expiredays)
{
	var exdate=new Date()
	exdate.setDate(exdate.getDate()+expiredays)
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}

function getCookie(c_name)
{
	if (document.cookie.length>0)
	  {
	  c_start=document.cookie.indexOf(c_name + "=")
	  if (c_start!=-1)
		{ 
		c_start=c_start + c_name.length+1 
		c_end=document.cookie.indexOf(";",c_start)
		if (c_end==-1) c_end=document.cookie.length
		return unescape(document.cookie.substring(c_start,c_end))
		} 
	  }
	return "";
}