| Server IP : 172.64.80.1 / Your IP : 172.70.50.62 Web Server : Apache System : Linux mail.federalpolyede.edu.ng 5.10.0-32-amd64 #1 SMP Debian 5.10.223-1 (2024-08-10) x86_64 User : federalpolyede.edu.ng_idh35skikv ( 10000) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/federalpolyede.edu.ng/httpdocs_backup/admin_student/ |
Upload File : |
<?php
ob_start();
//session_start();
function HTTPConnect($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, $timeout );
//
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
if(session_id() == '') {
// echo "here";
session_start();
$ptype=$_SESSION['paymentType'];
}else{
$ptype=$_SESSION['paymentType'];
}
$matNo=$_SESSION['formNo'];
//require 'remita_constants2.php';
require 'remita_constants2.php';
//require 'remita_constants2_Demo.php';
$orderID = "";
if( isset( $_GET['orderID'] )) {
$orderID = $_GET["orderID"];
$_SESSION['orderAspoa']=$orderID;
}
$response_code ="";
$rrr = "";
$response_message = "";
//Verify Transaction
function remita_transaction_details($orderId){
$mert = MERCHANTID;
$api_key = APIKEY;
$concatString = $orderId . $api_key . $mert;
$hash = hash('sha512', $concatString);
$url = trim(CHECKSTATUSURL . '/' . $mert . '/' . $orderId . '/' . $hash . '/' . 'orderstatus.reg');
// Initiate curl
$ch = curl_init();
// Disable SSL verification
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// Will return the response, if false it print the response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Set the url
curl_setopt($ch, CURLOPT_URL,$url);
// Execute
$result=curl_exec($ch);
if ($result === false) $result = curl_error($ch);
// echo stripslashes($result);
curl_close($ch);
// Closing
//curl_close($ch);
$response = json_decode($result, true);
return $response;
}
if($orderID !=null){
//echo 'Here';
$response = remita_transaction_details($orderID);
$response_code = $response['status'];
if (isset($response['RRR']))
{
$rrr = $response['RRR'];
}
$response_message = $response['message'];
}
?>
<html>
<head>
<title></title>
</head>
<body>
<table width="50%" align="center" cellpadding="3" cellspacing="5">
<tr>
<td align="center"><img src="../images/edebanner2.png" width="731" height="95"></td>
</tr>
<tr>
<td><fieldset><legend>Payment Detail </legend>
<div style="text-align: center;">
<?php //echo $response_code;
// echo $_SESSION['payerID'];
if($response_code == '01' || $response_code == '00') { ?>
<h2>Transaction Successful</h2>
<p><b>Remita Retrieval Reference: </b><?php echo $rrr; ?><p>
<p><b>Transaction ID: </b><?php echo $orderID; ?><p>
<?php
$transApproved='True';
$remitaRRR=$rrr;
$transDate=date('y/m/d h:i:s a');
$transStatus=$response_code;
$transDetail=$response_message;
}else if($response_code == '021') { ?>
<h2>RRR Generated Successfully</h2>
<p><b>Remita Retrieval Reference: </b><?php echo $rrr; ?><p>
<?php
$transApproved='False';
$remitaRRR=$rrr;
$transDate=date('y/m/d h:i:s a');
$transStatus=$response_code;
$transDetail=$response_message;
}else{ ?>
<h2>Your Transaction was not Successful</h2>
<?php
$transApproved='False';
$remitaRRR=$rrr;
$transDate=date('y/m/d h:i:s a');
$transStatus=$response_code;
$transDetail=$response_message;
if ($rrr !=null){ ?>
<p>Your Remita Retrieval Reference is <span><b><?php echo $rrr; ?></b></span><br />
<?php } ?>
<p><b>Reason: </b><?php echo $response_message; ?><p>
<br><h3 style="color: red">Note: Kindly wait for 2 hours before re-try the Payment, to avoid double deduction.</h3>
<?php }
require_once('../connect.php');
$db=db_connect();
require('logFile.php');
$logD='Payment. OrderID: '.$orderID.' PaymentType: '.$ptype;
logDetail($matNo,$logD);
$princess= $db->prepare("UPDATE `fedpoly`.`remitaorder` SET `remitaRRR` = ?,`transDate` = ?,`transStatus` = ?,`transDetail` = ?,`transApproved` =? WHERE `remitaorder`.`orderID` =?");
$princess->execute([$remitaRRR,$transDate,$transStatus,$transDetail,$transApproved,$orderID]);
$princess_2= $db->prepare("UPDATE `fedpoly`.`remitaorder_2` SET `remitaRRR` = ?,`transDate` = ?,`transStatus` = ?,`transDetail` = ?,`transApproved` =? WHERE `remitaorder_2`.`orderID` =?");
$princess_2->execute([$remitaRRR,$transDate,$transStatus,$transDetail,$transApproved,$orderID]);
//inserting data to ROOM_ALLOCATIONS table
// echo $transApproved;
// echo $ptype.'khhfds'.$_SESSION['paymentType'];
if ($transApproved == 'True') {
$kk="select regNo,paymentType from remitaorder where orderID='$orderID'";
$kk_exe=$db->query($kk);
if ($kk_exe->rowCount()>0){
$kk_fetch=$kk_exe->fetch(PDO::FETCH_ASSOC);
$matNo=$kk_fetch['regNo'];
$payType=$kk_fetch['paymentType'];
}
// echo $matNo;
// echo $payType;
if ($payType=='Accommodation Levy') {
$asp = $db->prepare("UPDATE room_allocation SET paid=1,status=1 WHERE matNo=?");
$aspa = $asp->execute([$matNo]);
echo "<a href='admin.php'>Click here to Print TENANCY AGREEMENT </a>";
}
if ($payType=='Reactivation of Studentship') {
$asp = $db->prepare("UPDATE realdata SET graduated='' WHERE matNo=?");
$aspa = $asp->execute([$matNo]);
// echo "<a href='admin.php'>Click here to Print TENANCY AGREEMENT </a>";
}
?>
<h2>Transaction Successful</h2>
<?php
$aspoa=$db->query("select * from remitaorder_2 where orderID='$orderID' and amtPaid>0")->rowCount();
$aspoak=$db->query("select * from remitaorder_2 where orderID='$orderID' and amtPaid>0 and paymentType='Alumni Due'")->rowCount();
// if ($aspoa==1) {
// if ($aspoa==10) {
//
// just pass the RRR number here
$TransID = $remitaRRR;
//
$TransID = base64_encode($TransID);
$PortalURL = "http://errandex.com.ng/portal_call.php?";
$parameters = $PortalURL . "opCode=REQUEST_ALERT&TransID=$TransID";
$jsondata = HTTPConnect($parameters);
// echo $jsondata;
}
//echo $_SESSION['idNo'];
echo '<br>';
echo $_SESSION['paymentTYPE'];
echo' <a href="print/otherFeePrint.php?ID='.$orderID.'" target="_blank">Click Here to Print Payment Receipt</a>';
if ($aspoak==1){
echo' <p> <a href="print/alumniFeePrint.php?ID='.$orderID.'" target="_blank">Click Here to Print Alumni Due Receipt</a>';
}
$aspoa=$db->query("select amtPaid from remitaorder_2 where orderID='$orderID'");
$k_count=$aspoa->rowCount();
if ($aspoa->rowCount()>0) {
$aspoa_fetch=$aspoa->fetch((PDO::FETCH_BOTH));
$am=$aspoa_fetch['amtPaid'];
if($am>0){
$TransID = base64_encode($remitaRRR);
echo "<p><a href='http://errandex.com.ng/formloader.php?transID=".$TransID."'>Click here to proceed to errandEX Service</a>";
}
}
ob_end_flush();
?>
<br><a href="../index.php" target="_blank">Back to Home Page</a>
</div>
</fieldset>
</td>
</tr>
</table>
</body>
</html>