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


Current Path : /proc/thread-self/root/var/www/html/gcm/js/
Upload File :
Current File : //proc/thread-self/root/var/www/html/gcm/js/revaluation_withdegree.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)
		$("#allready_html_div").html($responce.data.allready_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);
		$("#allready_html_div").html("")
		$("#revaluation_div").html("")
		$("#allready_html_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 Challan number"); 
		$("#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*='rv_']");
	var reval_arr = new Object();
	 
	for($i=0;$i<html_objects.length;$i++)
	{
	 var id=html_objects[$i]['id'];
	 var internal_code=id.split("rv_")[1];
		var rv_total="0";
		var rt_total="0";
		var xr_total="0";
		var cv_total="0";
	   reval_arr[internal_code]= new Object();
	 
	  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;
		
	  }
	  
	   
	 
	 }
	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_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+="&myJSONText="+myJSONText;	
		$.ajax({
		type: "Post",
		url: $host_url+"SaveRevalution",
		data: $lstr_string,
		success:saveRevaluationresponce
		});	
    }		 
	function saveRevaluationresponce($responce)
	{
		$responce=eval('(' +$responce +')');
		alert($responce.data);
		if($responce.error_code==0)
		{
		$("#allready_html_div").html("")
		$("#revaluation_div").html("")
		$("#allready_html_div").show();
		$("#revalution_fee_total").val("0");
		$("#revalution_receipt_no").val("");
		$("#revalution_dd_no").val("");
		$("#revalution_start").val("");
		$("#name").val("");
		$("#revalution_degree_code").focus();
		}
		
	}
	
function CalculateRevaluationTotFee()
{
 
	html_objects = $("input[id*='rv_']");
	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("rv_")[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);
	  
	} 
	$("#revalution_fee_total").val(total_fee);	
	  
}
function DeleteMresultDetail(int_code,app_no)
{
	$("#delete_td_1_"+int_code).css("background","orange");
	$("#delete_td_2_"+int_code).css("background","orange");
	$("#delete_td_3_"+int_code).css("background","orange");
	$("#delete_td_4_"+int_code).css("background","orange");
	var c=confirm("Are you sure about deleting the record");
	if(c)
	{
		$.ajax({
		type: "Post",
		url: $host_url+"DeleteMresultDetail",
		data: "int_code="+int_code+"&app_no="+app_no,
		success:DeleteMresultDetailesresponce
		});	
	}
	else
	{
		$("#delete_td_1_"+int_code).css("background","none");
	$("#delete_td_2_"+int_code).css("background","none");
	$("#delete_td_3_"+int_code).css("background","none");
	$("#delete_td_4_"+int_code).css("background","none");
	}
	
}function DeleteMresultDetailesresponce($responce)
	{
		$responce=eval('(' +$responce +')');
		 DisplayRevalutionDetails();
	}