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


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

 
 $g_revaluation="";
function LoadRevaluation()
{   
   $("#page_main_div").load('html_modules/revaluation.html',function()
	{ 
    $geditinternalcode=0;
	window.enable_proper_module="enableLoadRevaluationt";	   
	document.getElementById('display_module_name').innerHTML = 'Revaluation';
	document.getElementById('module_name_for_save').value = 'saveRevaluation';
	document.getElementById('is_add_edit').value = 'Edit';	
  	getDefaultHeadFooterLinks("Revaluation"); 
	 
	}
	);
	 
}	
	function DisplayRevalutionDetails()
	{
	 
		if(!empty($("#revalution_start").val()))
		{
		$lstr_val="&revalution_degree_code="+encodeURIComponent(trim(document.getElementById('revalution_degree_code').value));
		$lstr_val+="&revalution_regno="+encodeURIComponent(trim(document.getElementById('revalution_start').value));
			$.ajax({
			type: "Post",
			url: $host_url+"DisplayRevalutionDetails",
			data: $lstr_val,
			success:DisplayRevalutionDetailsresponce
			});
		}
	}
	function DisplayRevalutionDetailsresponce($responce)
	{
		$responce=eval('(' +$responce +')');	
		if($responce.error_code==0)
		{	
		$("#revaluation_div").html($responce.data.reval_html)
		$("#revaluation_div").show();
		$g_revaluation=$responce.data.reval_data;
		$("#revalution_fee_total").val($responce.data.total_val);
		$("#name").val($responce.data.name);
		$("#revalution_date").val($responce.data.curr_date);
		}
		else
		{
		alert($responce.data);
		$("#revaluation_div").html("")
		$("#revaluation_div").show();
		return  false;
		}
	}
	

 function SaveRevaluation()
 {
	 if(empty($("#revalution_receipt_no").val()))
	{
		alert("Please Enter the Receipt No"); 
		 $("#revalution_receipt_no").focus();
		return false;
	}
	else if(empty($("#revalution_date").val()))
	{
		alert("Enter the Date"); 
		$("#revalution_date").focus();
		return false;
	}
	else if(empty($("#revalution_dd_no").val()))
	{
		alert("Please Enter the DD No"); 
		$("#revalution_dd_no").focus();
		return false;
	}
	else if(empty($("#revalution_dd_date").val()))
	{
		alert("Please Enter the Date");
		$("#revalution_dd_date").focus();		
		return false;
	}
	else if(empty($("#revalution_bank").val()))
	{
		alert("Please Enter the Bank"); 
		$("#revalution_bank").focus();
		return false;
	}
	else if(empty($("#revalution_place").val()))
	{
		alert("Please Enter the Place"); 
		$("#revalution_place").focus();
		return false;
	}
	
	html_objects = $("input[id*='column_view']");
	$reval_arr = new Object();
	var all_selected=false;
	for($i=0;$i<html_objects.length;$i++)
	{
	 var id=html_objects[$i]['id'];
	 var FSUBCODE=id.split("column_view_")[1];
	  $reval_arr[$i]= new Object();
	  $reval_arr[$i]['FSUBCODE']=FSUBCODE;
	 
	 if(document.getElementById(id).checked==true)
	 {
	  $reval_arr[$i]['checked']=1;
	  all_selected=true;
	  }
	  else
	  $reval_arr[$i]['checked']=0;
	  
	 } 
	 if(empty(all_selected))
	 {
	 alert("Please Select any One Subject"); return false;
	 }
	var myJSONText = JSON.stringify($reval_arr);   
	$lstr_string="internal_code="+$geditinternalcode;	
	$lstr_string+="&reg_no="+encodeURIComponent(trim(document.getElementById('revalution_start').value));	
	$lstr_string+="&revalution_corr_type="+encodeURIComponent(trim(document.getElementById('revalution_corr_type').value));	
	$lstr_string+="&revalution_fee_total="+encodeURIComponent(trim(document.getElementById('revalution_fee_total').value));
	$lstr_string+="&revalution_date="+date_format(trim(document.getElementById('revalution_date').value));
	$lstr_string+="&revalution_dd_no="+encodeURIComponent(trim(document.getElementById('revalution_dd_no').value));	
	$lstr_string+="&revalution_receipt_no="+encodeURIComponent(trim(document.getElementById('revalution_receipt_no').value));
	$lstr_string+="&revalution_bank="+encodeURIComponent(trim(document.getElementById('revalution_bank').value));
	$lstr_string+="&revalution_place="+encodeURIComponent(trim(document.getElementById('revalution_place').value));
	$lstr_string+="&revalution_dd_date="+date_format(trim(document.getElementById('revalution_dd_date').value));
	$lstr_string+="&myJSONText="+myJSONText;	
		$.ajax({
		type: "Post",
		url: $host_url+"SaveRevalution",
		data: $lstr_string,
		success:saveRevaluationresponce
		});	
    }		 
	function saveRevaluationresponce($responce)
	{
		$responce=eval('(' +$responce +')');
		alert($responce.data);
	}
	
function CalculateRevaluationTotFee()
{
 
	html_objects = $("input[id*='column_view']");
	var total_fee=0;
	for($i=0;$i<html_objects.length;$i++)
	{
	 var id=html_objects[$i]['id'];
	 var internal_code=id.split("column_view_")[1];
	 var fee_val=parseFloat($("#fee_"+internal_code).html());
	 
	 if(document.getElementById(id).checked==true)
	 total_fee=total_fee+fee_val;
	} 
	$("#revalution_fee_total").val(total_fee);	
	  
}