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


Current Path : /var/www/results/ssc/src/
Upload File :
Current File : /var/www/results/ssc/src/process_payment.php

 <?php
    
	class process_payment
	{
		
		function __construct($aobj_context)
		{
			session_start();
			$this->aobj_context=$aobj_context;
			$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);	
			$this->aobj_context=$aobj_context;
			$this->ip=$_SERVER["REMOTE_ADDR"];
		}

		function GetStudentDetailsForPayment()
		{
			
			$this->app_no=trim($this->aobj_context->mobj_data["app_no"]);
			$get_data="SELECT res.APPNO,CONCAT(fname,' ',fmotname,' ',ffatname) AS fname ,

							FTOTAL AS ftotal 
							FROM student s
							INNER JOIN res_stud res ON res.FREGNO=s.FREGNO 
							WHERE APPNO= '{$this->app_no}'";
			$obj_get_data=$this->aobj_context->mobj_db->GetRow($get_data);
			 
			$fname=$obj_get_data['fname'];
			$fcatcode=$obj_get_data['fcatcode'];
			$femail=$obj_get_data['femail'];
			$fpaymode=$obj_get_data['fpaymode'];
			$famount=round($obj_get_data['famount'],2);
			$fextamt=round($obj_get_data['fextamt']);
			$ftotal=round($obj_get_data['ftotal']);
			 
			if(empty($obj_get_data))
			{
				$data="Invalid Application No";
				echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
				return;
			}else
			{	
				$arr['ftotal']=$ftotal;
				echo $this->aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
				return;
			}		
		}
			 
		function DoUpdateChallan()
		{
			$a=trim($this->aobj_context->mobj_data["a"]);
			$r=trim($this->aobj_context->mobj_data["r"]);
			$this->app_no=trim($this->aobj_context->mobj_data["app_no"]);
			$this->fchallan_amt=trim($this->aobj_context->mobj_data["fchallan_amt"]);
			$this->fbank_name=trim($this->aobj_context->mobj_data["fbank_name"]);
			$this->fchallan_date=trim($this->aobj_context->mobj_data["fchallan_date"]);
			$this->fchallan_no=trim($this->aobj_context->mobj_data["fchallan_no"]);
			$get_date="select  date_add(current_date(),interval -3 month) as prev_day,
						date_add(current_date(),interval  3 month) as next_day ";
			$obj_get_date=$this->aobj_context->mobj_db->GetRow($get_date);
			$prev_day=$obj_get_date['prev_day'];
			$next_day=$obj_get_date['next_day'];
			if($this->fchallan_date<$prev_day || $this->fchallan_date>$next_day)
			{
				$data="Please enter the valid challan date ";
				echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
				return;
			}		
			$get_fapproved="select ifnull(fapproved,'F') as fapproved
						from student where app_no='{$this->app_no}'";
			$obj_get_fapproved=$this->aobj_context->mobj_db->GetRow($get_fapproved);	

			$fapproved=$obj_get_fapproved['fapproved'];
			if($fapproved=="aaaaa")
			{
				$data="Challan is allready updated, you cannot update";
				echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
				return;
			}
			$update="update res_stud set 
					FCHALLANNO='{$this->fchallan_no}',
					FCHALLANBANK='{$this->fbank_name}',
					FCHALLANDATE='{$this->fchallan_date}',
					FCHALLANAMOUNT='{$this->fchallan_amt}' 
					where APPNO='{$this->app_no}'";
			$obj_get_data=$this->aobj_context->mobj_db->Execute($update);	

			if(!$obj_get_data)
			{
				$data="failed";
				echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
				return;
			}	
			else 
			{
				$data="updated successfully"; 
				echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,0,"success"); 
				return;
			}	
		}
			  
	}

	function GetStudentDetailsForPayment($aobj_context)
	{ 
		$obj=new process_payment($aobj_context);
		$obj->GetStudentDetailsForPayment();
	}

	function CheckPaymentAppNo($aobj_context)
	{ 
		$obj=new process_payment($aobj_context);
		$obj->CheckPaymentAppNo();
	}

	function DoUpdateChallan($aobj_context)
	{ 
		$obj=new process_payment($aobj_context);
		$obj->DoUpdateChallan();
	}
 
?>