| Server IP : 172.64.80.1 / Your IP : 108.162.241.66 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/eace_entranceForm/ |
Upload File : |
<?php
/**
* Created by PhpStorm.
* User: adisa
* Date: 2016-05-07
* Time: 05:57 PM
*/
ob_start();
session_start();
$matNo=$_SESSION['formNo'];
?>
<?php
require 'remita_constantsAcc.php';
$orderID = "";
if( isset( $_GET['id'] )) {
$orderID = $_GET['id'];
$ptype=$_GET['ptype'];
}
$response_code ="";
$rrr = "";
$response_message = "";
//die($orderID);
//Verify Transaction
function remita_transaction_details($orderId){
$mert = MERCHANTID;
$api_key = APIKEY;
$concatString = $orderId . $api_key . $mert;
$hash = hash('sha512', $concatString);
http://www.remitademo.net/remita/ecomm/merchantId/RRR/hash/RESPONSE_TYPE/status.reg
$url = 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);
// Closing
curl_close($ch);
$result;
$response = json_decode($result, true);
return $response;
}
if($orderID !=null){
$response = remita_transaction_details($orderID);
$response_code = $response['status'];
// echo $response['RRR'];
if (isset($response['RRR']))
{
$rrr = $response['RRR'];
}
$response_message = $response['message'];
$transactiontime= $response['transactiontime'];
$RRR= $response['RRR'];
$status= $response['status'];
$message= $response['message'];
//echo $response['Approved'];
if (($status=='00') or ($status=='01')){
$transA='True';
}else{
$transA='False';
}
require_once('../connect.php');
$db=db_connect();
require('../filetoU/logFile.php');
$logD='Requerying. OrderID: '.$orderID.' RRR: '.$RRR;
logDetail($matNo,$logD);
$kk=$db->query("UPDATE `fedpoly`.`remitaorder` SET `remitaRRR` = '$RRR',`transDate` = '$transactiontime',`transStatus` = '$status',`transDetail` = '$message',`transApproved` = '$transA' WHERE `remitaorder`.`orderID` ='$orderID'");
if($kk){
echo $status;
}else{
echo 'No';
}
//----------------------------------------------------------------------
$pValue=$db->query("select orderID from remitaorder where orderID='$orderID' and transApproved='True' and paymenttype='School Fees'")->rowCount();
// if (($transApproved=='True') and ($ptype=='School Fees')){
if ($pValue>0){
$regNo=$_SESSION['transID'];
$mSQL="select * from realdata where formNo='$regNo' and matNo='$regNo' and fresher='2'";
$mResult=$db->query($mSQL);
$mNum=$mResult->rowCount();
if ($mNum>0){
//generate prefix and sufix
$deptID=$_SESSION['deptID'] ;
$levelID=$_SESSION['levelID'] ;
$prefixQ=$db->query("select * from dept where sn='$deptID'");
$prefixQ_fetch=$prefixQ->fetch(PDO::FETCH_BOTH);
//mysql_num_rows($prefixQ);
if ($prefixQ->rowCount()>0){
if ($levelID=='1'){
$prefix=$prefixQ_fetch['nd'];
$sufix='';
}elseif($levelID=='3'){
$prefix=$prefixQ_fetch['hnd'];
$sufix='';
}elseif($levelID=='5'){
$prefix=$prefixQ_fetch['nd'];
$sufix='PT';
}elseif($levelID=='8'){
$prefix=$prefixQ_fetch['nd'];
$sufix='DPT';
}elseif($levelID=='10'){
$prefix=$prefixQ_fetch['nd'];
$sufix='';
}
}
//End of prefix and sufix
//generate serial Number
$matSQL="select * from realdata where fresher='20'";
$matResult=$DB->query($matSQL);
$matNum=$matResult->rowCount();
if ($matNum>0){
$realNo=$matNum+1;
if ($realNo<10){
$serialNo='20160000'.$realNo;
}elseif($realNo<100){
$serialNo='2016000'.$realNo;
}elseif($realNo<1000){
$serialNo='201600'.$realNo;
}elseif($realNo<10000){
$serialNo='20160'.$realNo;
}else{
$serialNo='2016'.$realNo;
}
$newMatNo=$prefix.$serialNo.$sufix;
$db->query("UPDATE `fedpoly`.`realdata` SET `matNo` = '$newMatNo',`usernamea` = '$newMatNo',`passworda` = '$newMatNo',`fresher` = '20' WHERE `realdata`.`formNo` ='$matNo'");
$db->query("UPDATE `fedpoly`.`remitaorder` SET `regNo` = '$newMatNo' WHERE `remitaorder`.`orderID` ='$orderID'");
$_SESSION['matNo']=$newMatNo;
// echo '<font color="#FF0000"><h2><br> Note: Your Username and Password is now '.$newMatNo.'</h2></font>';
}
}
//end of generating serial number
}else{
//=========================================================
if (($transA=='True') and ($ptype=='Acceptance Fee')){
$k=($db->query("select * from remitaorder where regNo='$matNo'and paymentType='Acceptance Fee' and transApproved='True'")->rowCount());
if ($k>0){
$cardGet=$db->query("select * from stddata where formNo='$matNo' or jambNo='$matNo'");
$cardGet_fetch=$cardGet->fetch(PDO::FETCH_BOTH);
if ($numGet=$cardGet->rowCount()>0){
$admittedGet=$db->query("select * from admitted where formNo='$matNo'");
$admittedGet_fetch=$admittedGet->fetch(PDO::FETCH_BOTH);
if ($admittedGet->rowCount()>0) {
$names = $cardGet_fetch['surname'] . ' ' . $cardGet_fetch['otherNames'];
$names = str_replossce("'", "''", $names);
$course = $cardGet_fetch['option'];
$levelID = $admittedGet_fetch['levelID'];
$address = $cardGet_fetch['address'];
$state = $cardGet_fetch['state'];
$lga = $cardGet_fetch['lga'];
$email = $cardGet_fetch['email'];
$gsm = $cardGet_fetch['gsm'];
$ausername = $admittedGet_fetch['formNo'];
$apassword = $admittedGet_fetch['formNo'];
$mode = $admittedGet_fetch['mode'];
$dob = $cardGet_fetch['dob'];
$sex = $cardGet_fetch['sex'];
$db->query("INSERT INTO `fedpoly`.`realdata` (`sn`, `formNo`, `matNo`, `names`, `course`, `levelID`, `mode`, `state`, `lga`, `dob`, `gsm`, `sex`, `address`, `email`, `usernamea`, `passworda`, `fresher`) VALUES (NULL, '$matNo', '$matNo', '$names', '$course', '$levelID', '$mode', '$state', '$lga', '$dob', '$gsm', '$sex', '$address', '$email', '$matNo', '$matNo', '2')") or die('Error');
}
}
}
}
header('location:'.'paymentHistory.php');
}
}
ob_end_flush();
?>
<!-- InstanceEndEditable --></td>
<td align="right" valign="top"><!-- InstanceBeginEditable name="EditRegion4" --><!-- InstanceEndEditable --></td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
</tr>
</table>
<p> </p>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"../SpryAssets/SpryMenuBarDownHover.gif", imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
<!-- InstanceEnd --></html>