| 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
session_start();
$matNo=$formNo=$_SESSION['formNo'];
//$ptype= $_SESSION['ptype'];
//http://localhost:8080/response.php?LOGO_URL=http%3A%2F%2Fnsuid.com.ng%2Ffaq.php%2Fmfmlogo.jpg&
//RESPONSE_URL=http%3A%2F%2Flocalhost%3A8080%2Fresponse.php&CURRENCY_CODE=NGN&TERMINAL_ID=0000000001&TRANSACTION_ID=etz1467994932web&
//AMOUNT=1000&DESCRIPTION=Payment+Description&FINAL_CHECKSUM=FD0EBFD90AD46AE42B1BE5772CDA388A&SUCCESS=0&CHECKSUM=dacb90cd175360649a5cb23f8a70ccca&
//TRANS_NUM=ETZ1607081723072132SMIGs&msg=Approved&DEBITED_AMOUNT=1000&ECHODATA=
/*SUCCESS+AMOUNT+TERMINAL_ID+TRANSACTION_ID+RESPONSE_URL+SECRETKEY*/
$success = $_REQUEST['SUCCESS'];
$aspoa=explode('&',$success);
$aspoa_status=explode('=',$aspoa[0]);
$status= $aspoa_status[1];
$aspoa_orderID=explode('=',$aspoa[1]);
$orderID= $aspoa_orderID[1];
$aspoa_card=explode('=',$aspoa[6]);
$card= $aspoa_card[1];
$aspoa_paymentType=explode('=',$aspoa[5]);
$aspoa_transDate=explode('=',$aspoa[4]);
$transDate= $aspoa_transDate[1];
$aspoa_paymentType=explode('=',$aspoa[5]);
$paymentType=$aspoa_paymentType[1];
if (strlen($paymentType)>10){
$aspoa_paymentType=explode('~',$paymentType);
$paymentType=$aspoa_paymentType[0];
}
'<br> Paymet Type '. $paymentType;
$response_code=$status;
switch ($response_code) {
case "0":
$status_desc = "Transaction successful. Payment accepted";
$transApproved="True";
break;
case "-1":
$status_desc = "Transaction timeout or invalid parameters or unsuccessful transaction in the case of Query History";
break;
case "1":
$status_desc = "Destination Card Not Found";
break;
case "2":
$status_desc = "Card Number Not Found";
break;
case "3":
$status_desc = "Invalid Card PIN";
break;
case "4":
$status_desc = "Card Expiration Incorrect";
break;
case "5":
$status_desc = "Insufficient balance";
break;
case "6":
$status_desc = "Spending Limit Exceeded";
break;
case "7":
$status_desc = "Internal System Error Occurred, please contact the service provider";
break;
case "8":
$status_desc = "Financial Institution cannot authorize transaction, Please try later";
break;
case "9":
$status_desc = "PIN tries Exceeded";
break;
case "10":
$status_desc = "Card has been locked";
break;
case "11":
$status_desc = "Invalid Terminal Id";
break;
case "12":
$status_desc = "Payment Timeout";
break;
case "13":
$status_desc = "Destination card has been locked";
break;
case "14":
$status_desc = "Card has expired";
break;
case "15":
$status_desc = "PIN change required";
break;
case "16":
$status_desc = "Invalid Amount";
break;
case "17":
$status_desc = "Card has been disabled";
break;
case "18":
$status_desc = "Unable to credit this account immediately, credit will be done later";
break;
case "19":
$status_desc = "Transaction not permitted on terminal";
break;
case "20":
$status_desc = "Exceeds withdrawal frequency";
break;
case "21":
$status_desc = "Destination Card has expired";
break;
case "22":
$status_desc = "Destination Card Disabled";
break;
case "23":
$status_desc = "Source Card Disabled";
break;
case "24":
$status_desc = "Invalid Bank Account";
break;
case "25":
$status_desc = "Insufficient Balance";
break;
case "26":
$status_desc = "CHECKSUM/FINAL_CHECKSUM error";
break;
default:
$status_desc = "Your Transaction was not Successful. No amount was debited from your account.";
break;
}
if ($response_code==0) {
$transApproved = "True";
}else{
$transApproved="False";
}
$trans_num=$card;
//die($paymentType);
//die();
require_once('../connect.php');
$db=db_connect();
require('../filetoU/logFile.php');
$logD='Payment. OrderID: '.$orderID.' PaymentType: '.$reference;
logDetail($matNo,$logD);
$ade="UPDATE `fedpoly`.`eace_remitaorderform` SET `remitaRRR` = '$trans_num',`transDate` = '$transDate',`transStatus` = '$response_code',`transDetail` = '$status_desc',`transApproved` ='$transApproved' WHERE `eace_remitaorderform`.`orderID` ='$orderID'";
$db->query($ade);
//=====================Acceptance fees ======================================
if (($paymentType == 'Acceptance Fee') and ($response_code == 0)) {
echo '<a href="print/acceptancePrint.php" target="_blank">Click Here to Print Acceptance Receipt</a>';
echo '<br><a href="print/admissionLetter.php" target="_blank">Print Admission Letter</a>';
$k = $db->query("select * from eace_remitaorderform where regNo='$matNo'and paymentType='Acceptance Fee' and transApproved='True'")->rowCount();
if ($k > 0) {
$cardGet1 = $db->query("select * from eace_stddata where formNo='$matNo' or jambNo='$matNo'");
$cardGet1_fetch = $cardGet1->fetch(PDO::FETCH_BOTH);
$cardGet1_num = $cardGet1->rowCount();
if ($cardGet1->rowCount() > 0) {
$admittedGet = $db->query("select * from eace_admitted where formNo='$matNo'");
$admittedGet_fetch = $admittedGet->fetch(PDO::FETCH_BOTH);
if ($admittedGet->rowCount() > 0) {
$cardGet1_fetch['formNo'] . '==>';
$names = $cardGet1_fetch['surname'] . ' ' . $cardGet1_fetch['otherNames'];
$names = str_replace("'", "''", $names);
$course = $admittedGet_fetch['course'];
$levelID = $admittedGet_fetch['levelID'];
$address = $cardGet1_fetch['address'];
$address = str_replace("'", "''", $address);
$state = $cardGet1_fetch['state'];
$lga = $cardGet1_fetch['lga'];
$email = $cardGet1_fetch['email'];
$gsm = $cardGet1_fetch['gsm'];
$ausername = $admittedGet_fetch['formNo'];
$apassword = $admittedGet_fetch['formNo'];
$mode = $admittedGet_fetch['mode'];
$dob = $cardGet1_fetch['dob'];
$sex = $cardGet1_fetch['sex'];
$hh = $db->query("INSERT INTO `fedpoly`.`eace_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', '4')");
}
}
}
}
//=======================End Acceptance =====================================
if (($paymentType == '01BNKITSchool Fees') and ($response_code == 0)) {
// echo '<a href="print/schoolFeePrint.php" target="_blank">Click to Print School Receipt</a>';
//
// echo '<br><a href="admin.php" target="_blank">Continue Registration</a>';
//
// if ($response_code==0){
// echo '<a href="print/schoolFeePrint.php" target="_blank">Click to Print School Receipt</a>';
// echo '<br><a href="admin.php" target="_blank">Continue Registration</a>';
//===============================================*****************************
$mSQL = "select * from eace_realdata where formNo='$matNo' and matNo='$matNo' and fresher=4";
$mResult = $db->query($mSQL);
$mNum = $mResult->rowCount();
if ($mNum > 0) {
$matNoOld = $_SESSION['formNo'];
//generate prefix and sufix
$deptID = $_SESSION['deptID'];
$levelID = $_SESSION['levelID'];
// echo $_SESSION['course'] ;
$prefixQ = $db->query("select * from dept where sn='$deptID'");
$prefixQ_fetch = $prefixQ->fetch(PDO::FETCH_BOTH);
$numPrefix = $prefixQ->rowCount();
$courseName = $prefixQ_fetch['dOption'];
if ($numPrefix > 0) {
if ($levelID == '1') {
$prefix = $prefixQ_fetch['nd'];
$sufix = '';
$levelCode = '01';
} elseif ($levelID == '3') {
$prefix = $prefixQ_fetch['hnd'];
$sufix = '';
$levelCode = '01';
} elseif ($levelID == '5') {
$prefix = $prefixQ_fetch['nd'];
$sufix = 'PT';
$levelCode = '03';
} elseif ($levelID == '8') {
$prefix = $prefixQ_fetch['nd'];
$sufix = 'DPT';
$levelCode = '02';
} elseif ($levelID == '10') {
$prefix = $prefixQ_fetch['nd'];
$sufix = '';
$levelCode = '01';
} elseif ($levelID == '11') {
$prefix = $prefixQ_fetch['hnd'];
$sufix = '';
$levelCode = '02';
}
}
$levelCode='04';
//End of prefix and sufix
//generate serial Number
// echo $courseName;
//$matSQL="select * from realdata where fresher='20' and course='$courseName' and levelID='$levelID' ";
$matSQL = "select * from eace_realdata where fresher='40' ";
$matResult = $db->query($matSQL);
$matNum = $matResult->rowCount();
if ($matNum > 0) {
$realNo = $matNum + 1;
if ($realNo < 10) {
$serialNo = '2018' . $levelCode . '0000' . $realNo;
} elseif ($realNo < 100) {
$serialNo = '2018' . $levelCode . '000' . $realNo;
} elseif ($realNo < 1000) {
$serialNo = '2018' . $levelCode . '00' . $realNo;
} elseif ($realNo < 10000) {
$serialNo = '2018' . $levelCode . '0' . $realNo;
} else {
$serialNo = '2018' . $levelCode . $realNo;
}
} else {
$serialNo = '2018' . $levelCode . '00001';
}
$newMatNo = $prefix . $serialNo;
$real="UPDATE `fedpoly`.`eace_realdata` SET `matNo` = '$newMatNo',`usernamea` = '$newMatNo',`passworda` = '$newMatNo',`fresher` = '40' WHERE `eace_realdata`.`formNo` ='$matNo'";
$db->query($real);
$real2="UPDATE `fedpoly`.`eace_remitaorder` SET `regNo` = '$newMatNo' WHERE `eace_remitaorder`.`orderID` ='$orderID'";
$db->query($real2);
$_SESSION['matNo'] = $newMatNo;
// copy('../passportForm/' . $matNo . '.jpg', 'passport/Reg' . $newMatNo . '.jpg');
// '<font color="#FF0000"><h2><br> Note: Your Username and Password is now ' . $newMatNo . '</h2></font>';
}
}
//die();
//
//=========================Application Form=========================================================================
//echo $paymentType;
if (($paymentType == '01BNKITApplication Form Fee') and ($response_code == 0)) {
echo $matSQLK = "select * from eace_entrancetable where transID='$formNo'";
$mat=$db->query("$matSQLK");
if ($mat->rowCount()>0){
$r_fetch=$mat->fetch(PDO::FETCH_BOTH);
echo $ptype=$r_fetch['formType'];
echo $dept=$r_fetch['dept'];
}
echo '<a href="formPaymentReciept.php" target="_blank">Click Here to Print Application Receipt</a><hr>';
if ($dept < 10) {
$deptCode = '0' . $dept;
} else {
$deptCode = $dept;
}
// die($deptCode);
//end formType code generation
if ($ptype == 'aceForm') {
$formCode = '8';
} else {
$formCode = '0';
}
//End of Form type Code
//generate serial Number
$matSQL = "select * from eace_entrancetable where formNo<>''";
$matResult = $db->query($matSQL);
$matNum = $matResult->rowCount();
if ($matNum >= 0) {
$realNo = $matNum + 1;
if ($realNo < 10) {
$serialNo = '0000' . $realNo;
} elseif ($realNo < 100) {
$serialNo = '000' . $realNo;
} elseif ($realNo < 1000) {
$serialNo = '00' . $realNo;
} elseif ($realNo < 10000) {
$serialNo = '0' . $realNo;
} else {
$serialNo = $realNo;
}
$entranceUpdate = $db->query("select * from eace_remitaorderform where orderID='$orderID'");
$entranceUpdate_fetch = $entranceUpdate->fetch(PDO::FETCH_BOTH);
$transCode = $entranceUpdate_fetch['regNo'];
$matNo . 'matNo';
$transCode . 'transCode';
if ($transCode == $matNo) {
$newMatNo = '19' . $formCode . $deptCode . $serialNo;
// die($formCode);
//mysql_query("UPDATE `fedpoly`.`realdataform` SET `matNo` = '$newMatNo',`usernamea` = '$newMatNo',`passworda` = '$newMatNo',`fresher` = '10' WHERE `realdataform`.`formNo` ='$matNo'");
$db->query("UPDATE `fedpoly`.`eace_remitaorderform` SET `regNo` = '$newMatNo' WHERE `eace_remitaorderform`.`orderID` ='$orderID'");
$db->query("UPDATE `fedpoly`.`eace_entrancetable` SET `formNo` = '$newMatNo' WHERE `eace_entrancetable`.`transID` ='$transCode'");
echo $_SESSION['matNo'] = $newMatNo;
// die($paymentType);
//
// echo '<font color="#FF0000"><h2><br> Note: Your form Number is ' . $newMatNo . '</h2></font>';
// echo 'Here';
} else {
$matSQLa = "select * from eace_entrancetable where transID='$matNo'";
$matResulta = $db->query($matSQLa);
$matResulta_fetch = $matResulta->fetch(PDO::FETCH_BOTH);
$_SESSION['matNo'] = $newMatNo = $transCode;
// echo '<font color="#FF0000"><h2><br> Note: Your form Number is ' . $matResulta_fetch['formNo'] . '</h2></font>';
}
}
}
//die($ptype);
//end of generating serial number
//=========================end application form=====================================================================
header('location:'.'paymentHistoryForm.php');
?>