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


Current Path : /var/www/results/sikkim_test/hdfc/
Upload File :
Current File : /var/www/results/sikkim_test/hdfc/ccavResponseHandler.php

<html>
<head>
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
    <meta content="utf-8" http-equiv="encoding">
    <link rel="shortcut icon" type="image/jpg" href="img/favicon.jpg" />
    <?php require_once("links/js_files.php");?> 
    <script src="js/candidate_list.js"></script>
    <script type="text/javascript">
        $(function(){
        
            
          $('.index_label_div').corner("5px").css("border","1px solid #6F6868");    
          $('.messageboard-div').corner("5px").css("border","1px solid #6F6868");   
          $('.reg_no_div').corner("bl br").css("border","1px solid #6F6868");   
          $('#main_message_board').corner("bl br").css("border","1px solid #2596CE");   
          $('.submit_div_button').corner("5px");    
          $('.div_app_form_center_blue').corner("tl tr");
          $('.div_app_form_center_black').corner("tl tr");
          $('#print_app_form').corner("5px");
        
        });
     
    </script>   
    
</head>
<body>
<div id='main_frame'>
    <div class='header_main_div'>
        <?php require_once("../links/header.php");?> 
        <div id='main_page_div' style=' text-align: center;'>

<?php include('Crypto.php')?>
<?php

	error_reporting(0);
	
	$workingKey='4C951A28AAA39C9F123E3897FC1C699E';		//Working Key should be provided here.
	$encResponse=$_POST["encResp"];			//This is the response sent by the CCAvenue Server
	$rcvdString=decrypt($encResponse,$workingKey);		//Crypto Decryption used as per the specified working key.
	$order_status="";
	$decryptValues=explode('&', $rcvdString);
	$dataSize=sizeof($decryptValues);
	echo "<center>";    
    $servername = "97.74.228.93";
    $username = "logisys3_logu";
    $password = "Logisys@2106";
   
    $dbname = "logisys3_bcu";

	$conn = new mysqli($servername, $username, $password, $dbname);
	
	for($i = 0; $i < $dataSize; $i++) 
	{
		$information=explode('=',$decryptValues[$i]);
		$response[$information[0]] = $information[1];
	}

	if($response['order_status']==="Success")
	{
		$productinfo = $response['merchant_param3'];
		$txnid       = $response['tracking_id'];
		$amt         = $response['amount'];
		$firstname   = 'HDFC';

		$html = "";
		echo "<h1 style='color:green;'>Thank You. Your order status is success</h1>";
		echo "<h2>Your Transaction ID for this transaction is ".$txnid.".</h2>";
		echo "<h3>We have received a payment of Rs. " .$amt."</h3>";
		$html="
		<div class='raval_submit' style='width:241px;float:none; margin: 0 auto;' >
		<span onclick=\"PrintApplicationFormNETBANKING('{$productinfo}');\" style='float:left;margin-left:8px;cursor: pointer; line-height: 19px;font-size:14px;font-weight:bold;'>Click here to take a PrintOut</span>
		</div>";
		echo $html;
		$html = "";
		$update="update appcandsum set FPAYMENTREMARKS='{$txnid}',FPAYMENTSTATUS='success',
		FPAYMENTCONFIRM='success',FACKDATE=now(),FPAYGATEWAY = '{$firstname}',FACKUSER='{$firstname}',
		FORDERID = '{$txnid}'
		where APPNO='{$productinfo}'";
		//var_dump($update);
		$result=$conn->query($update); 


		//var_dump($result);		
	   
		$get_app_cand_det = "SELECT a.FDEGREE,a.FEXAMNO,a.FCOLLCODE,
		a.FREGNO,a.FSUBCODE,a.FINSERTED,a.FPRESENT,a.FYEAR,a.FEXAMTYPE,concat('Message from Bengaluru Central University : ', 
		' Dear ',s.fname,' (Reg. no. : ',s.fregno,' , Stud. id. : ',s.fstudid,'),', 
		' Rs.',FLOOR(c.FTOTALFEE),'/- is received at university. Your application no. is ',c.appno,
		'. keep this information for future reference.',' Sent Time: ',time(now())) as message
		FROM appcanddet a inner join student s on 
		a.fregno = s.fregno inner join appcandsum c on a.appno = c.appno
		WHERE c.APPNO='{$productinfo}'";  
		//var_dump($get_app_cand_det);
		$result = $conn->query($get_app_cand_det); 
		//var_dump($result);

		if (mysqli_num_rows($result) > 0) 
		{
			while($row = mysqli_fetch_assoc($result)) 
			{
				$collcode = $row['FCOLLCODE'];
				$degree = $row['FDEGREE'];
				$regno = $row['FREGNO'];
				$text = $row['message'];
			}
		}
				
		$update_cand_sum = "UPDATE appcandsum a,candsum c
		SET 
		c.FEXAMFEEA=if(ifnull(c.FEXAMFEEA,0) <=0,ifnull(a.FEXAMFEEA,0),ifnull(c.FEXAMFEEA,0)),
		c.FEXAMFEEB=if(ifnull(c.FEXAMFEEB,0) <=0,ifnull(a.FEXAMFEEB,0),ifnull(c.FEXAMFEEB,0)),
		c.FEXAMFEEC=if(ifnull(c.FEXAMFEEC,0) <=0,ifnull(a.FEXAMFEEC,0),ifnull(c.FEXAMFEEC,0)),
		c.FEXAMFEED=if(ifnull(c.FEXAMFEED,0) <=0,ifnull(a.FEXAMFEED,0),ifnull(c.FEXAMFEED,0)),
		c.FEXAMFEEE=if(ifnull(c.FEXAMFEEE,0) <=0,ifnull(a.FEXAMFEEE,0),ifnull(c.FEXAMFEEE,0)),
		c.FEXAMFEEF=if(ifnull(c.FEXAMFEEF,0) <=0,ifnull(a.FEXAMFEEF,0),ifnull(c.FEXAMFEEF,0)),
		c.FEXAMFEEG=if(ifnull(c.FEXAMFEEG,0) <=0,ifnull(a.FEXAMFEEG,0),ifnull(c.FEXAMFEEG,0)),
		c.FEXAMFEEH=if(ifnull(c.FEXAMFEEH,0) <=0,ifnull(a.FEXAMFEEH,0),ifnull(c.FEXAMFEEH,0)),
		c.FEXAMFEEI=if(ifnull(c.FEXAMFEEI,0) <=0,ifnull(a.FEXAMFEEI,0),ifnull(c.FEXAMFEEI,0)),
		c.FEXAMFEEJ=if(ifnull(c.FEXAMFEEJ,0) <=0,ifnull(a.FEXAMFEEJ,0),ifnull(c.FEXAMFEEJ,0)),
		c.FTOTALFEE=a.FTOTALFEE,
		c.frecptdate = date(now())
		WHERE a.fregno=c.FREGNO
		AND a.APPNO='{$productinfo}' and a.FCOLLCODE='{$collcode}'";
				
		$result = $conn->query($update_cand_sum); 
		
		$update_cand_appCand = "update canddet c, appcanddet t  
		set c.finserted = t.finserted,
		c.fpresent = t.fpresent
		where c.fdegree = t.fdegree
		and c.fexamno = t.fexamno
		and c.fregno = t.fregno
		and c.fsubcode = t.fsubcode
		and c.fdegree = '{$degree}' and  c.fregno = '{$regno}' and t.APPNO='{$productinfo}' and ifnull(c.fpresent,'') <> 'P'";
		
		$result = $conn->query($update_cand_appCand); 
				
		$insert_canddet ="insert into canddet(fdegree,FEXAMNO, FCOLLCODE, FREGNO, FSUBCODE, FINSERTED, FPRESENT, FYEAR, FEXAMTYPE)
		select fdegree, FEXAMNO, FCOLLCODE,FREGNO, FSUBCODE,FINSERTED, FPRESENT, FYEAR,FEXAMTYPE from appcanddet where 
		fregno = '{$regno}' and appno ='{$productinfo}' and CONCAT(fdegree,fexamno,fregno,fsubcode) 
		not in(select CONCAT(fdegree,fexamno,fregno,fsubcode) from canddet where  fregno = '{$regno}')
		";
		
		$result = $conn->query($insert_canddet); 
		
		
		$update_studfee = "update studfee s, appstudfee a
		set s.famount = a.famount,
		s.flogdate = a.flogdate
		where s.fdegree = a.fdegree
		and s.fexamno = a.fexamno
		and s.fregno = a.fregno
		and s.ffeecode = a.ffeecode
		and  s.fregno = '{$regno}' and a.appno ='{$productinfo}'";
		
		$result = $conn->query($update_studfee);
		
		$insert_studfee = "insert into studfee(fdegree,fexamno,fcollcode,fregno,ffeecode,famount,flogdate)
		select fdegree,fexamno,fcollcode,fregno,ffeecode,famount,flogdate from appstudfee where 
		fregno = '{$regno}' and appno ='{$productinfo}' and CONCAT(fdegree,fexamno,fregno,ffeecode) 
		not in(select CONCAT(fdegree,fexamno,fregno,ffeecode) from studfee where  fdegree = '{$degree}' 
		and fregno = '{$regno}')";
		$result = $conn->query($insert_studfee); 

		$servername = "97.74.228.93";
		$username = "logisys3_logu";
		$password = "Logisys@2106";
	
			   /* $servername = "localhost";
				$username = "root";
				$password = "";*/
	
		$dbname = "logisys3_comexam";
		$conn = new mysqli($servername, $username, $password, $dbname);
		
		$get_data = "select fmobileno from masuser where fregno = '{$regno}' 
		and funivcode = '{$payment->notes->univcode}'";

		$result1=$conn->query($get_data); 

		if (mysqli_num_rows($result1) > 0) 
		{
			// output data of each row
			$dbnames = array();
			while($row = mysqli_fetch_assoc($result1)) 
			{
				$to = $row['fmobileno'];
			}
		}
	
		$username = 'logisyhttp';
		$password = 'Logis986';
		$from = 'UNISOL';
		$category = '';
		//$smsresp = sendsmaapi($username,$password,$from,$to,$text,$category);

		//$strInsertQuery = "insert into smslog(funivcode, fregno,fmobileno, freasoncode, fguid, fenttype, fstatus,fackdate, facktime,fremarks) values('041','{$regno}','{$to}','PG','{$smsresp}','PG','{$smsresp}',now(),now(),'razorpay')";
		
		//$result1=$conn->query($strInsertQuery);
		//mysqli_close($conn);
		


		//echo "<br>Thank you for shopping with us. Your credit card has been charged and your transaction is successful. We will be shipping your order to you soon.";
	}
	else if($order_status==="Aborted")
	{
		echo "<br>Thank you for shopping with us.We will keep you posted regarding the status of your order through e-mail";
	
	}
	else if($order_status==="Failure")
	{
		echo "<br>Thank you for shopping with us.However,the transaction has been declined.";
	}
	else
	{
		echo "<br>Security Error. Illegal access detected";
	
	}

	echo "<br><br>";

	echo "<table cellspacing=4 cellpadding=4>";
	for($i = 0; $i < $dataSize; $i++) 
	{
		$information=explode('=',$decryptValues[$i]);
	    	echo '<tr><td>'.$information[0].'</td><td>'.urldecode($information[1]).'</td></tr>';
	}

	echo "</table><br>";
	echo "</center>";
?>