| Server IP : 172.64.80.1 / Your IP : 172.70.100.163 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/ |
Upload File : |
<?php
function utf8_string_array_encode(&$array){
$func = function(&$value,&$key){
if(is_string($value)){
$value = utf8_encode($value);
}
if(is_string($key)){
$key = utf8_encode($key);
}
if(is_array($value)){
utf8_string_array_encode($value);
}
};
array_walk($array,$func);
return $array;
}
//
function recordSetToJson($mysql_result,$jsonencode=false,$marker="") {
$return_arr = array();
while($datarow = $mysql_result->fetch(PDO::FETCH_ASSOC)){
$return_arr[] = $datarow;
}
//
$return_arr = utf8_string_array_encode($return_arr);
//
if (!$jsonencode)
return $return_arr;
else{
if ($marker != "")
return json_encode(array($marker =>$return_arr));
else
return json_encode($return_arr);
}
}
//
require('connect.php');
$pdo = db_connect();
$opID = $_REQUEST['opID'];
$tstatus=0;
$ndStatus=0;
$asession = '2023/2024';
if ($opID == "CHECK_SCHOOL_FEES_FRESHER"){
$deptID = $_REQUEST['deptID'];
// $asession = '2023/2024';
// $asession = $_REQUEST['asession'];
$levelID = $_REQUEST['levelID'];
// $status = $_REQUEST['status'];
$status = 'Normal';
//check Ex-Student
if (isset($_REQUEST['ndMatNo'])) {
$ndMatNo = $_REQUEST['ndMatNo'];
$pamela="select * from realdata where matNo='$ndMatNo'";
$ndStatus = $pdo->query($pamela)->rowCount();
if ($ndStatus == 1) {
$status = 'Ex-Student';
}
}
//return student Payment
// if (isset($_REQUEST['rMatNo'])){
// $rMatNo=$_REQUEST['rMatNo'];
// $rPassword=$_REQUEST['rPassword'];
//
// $aspoa= "select status,levelID,(select sn from dept where dOption=realdata.course) as coursea from realdata where matNo='$rMatNo' and passworda='$rPassword' and graduated not like '%Yes%'";
// $rStatus=$pdo->query($aspoa);
// if ($rStatus->rowCount()==1) {
// $rStatus_fetch = $rStatus->fetch(PDO::FETCH_BOTH);
// echo $status = $rStatus_fetch['status'];
// if ($status==''){
// $status='Normal';
// }
// $levelID = $rStatus_fetch['levelID'];
// $deptID = $rStatus_fetch['coursea'];
// }
// }
$Query="select amount from schoolfee where dept= ? and level= ? and status= ? and asession= ?" ;
// $Query="select * from schoolfee where dept=$deptID and level=$levelID and status=$status and asession=$asession" ;
// $Query = "SELECT a.matNo, a.names, a.sex, a.course, a.levelID, a.mode, a.gsm,a.state,a.lga FROM realdata a WHERE graduated<>'Yes' and a.matNo = ?";
$stmt = $pdo->prepare($Query);
$stmt->execute([$deptID,$levelID,$status,$asession]);
if ($stmt->rowCount() == 0)
echo "NOT_FOUND";
else
echo recordSetToJson($stmt,true,"che_sch_fee");
//
}elseif ($opID == "CHECK_SCHOOL_FEES_RETURNING"){
$deptID = $_REQUEST['deptID'];
// $asession = $_REQUEST['asession'];
//$levelID = $_REQUEST['levelID'];
//$status = $_REQUEST['status'];
//check Ex-Student
// if (isset($_REQUEST['ndMatNo'])) {
// $ndMatNo = $_REQUEST['ndMatNo'];
// $pamela="select * from realdata where matNo='$ndMatNo'";
// $ndStatus = $pdo->query($pamela)->rowCount();
// if ($ndStatus == 1) {
// $status = 'Ex-Student';
// }
// }
//return student Payment
if (isset($_REQUEST['rMatNo'])){
$rMatNo=$_REQUEST['rMatNo'];
$rPassword=$_REQUEST['rPassword'];
$aspoa= "select status,levelID,(select sn from dept where dOption=realdata.course) as coursea from realdata where matNo='$rMatNo' and passworda='$rPassword' and graduated not like '%Yes%'";
$rStatus=$pdo->query($aspoa);
if ($rStatus->rowCount()==1) {
$rStatus_fetch = $rStatus->fetch(PDO::FETCH_BOTH);
$status = $rStatus_fetch['status'];
if ($status==''){
$status='Normal';
}
$levelID = $rStatus_fetch['levelID'];
$deptID = $rStatus_fetch['coursea'];
}
}
$Query="select amount from schoolfee where dept= ? and level= ? and status= ? and asession= ?" ;
// $Query="select * from schoolfee where dept=$deptID and level=$levelID and status=$status and asession=$asession" ;
// $Query = "SELECT a.matNo, a.names, a.sex, a.course, a.levelID, a.mode, a.gsm,a.state,a.lga FROM realdata a WHERE graduated<>'Yes' and a.matNo = ?";
$stmt = $pdo->prepare($Query);
$stmt->execute([$deptID,$levelID,$status,$asession]);
if ($stmt->rowCount() == 0)
echo "NOT_FOUND";
else
echo recordSetToJson($stmt,true,"che_sch_fee");
//
}else if ($opID == "STUDENT_RECORD"){
$usernamea= $_REQUEST['usernamea'];
$passworda=$_REQUEST['passworda'];
$Query = "SELECT a.matNo, a.names, a.sex, a.course, a.levelID,a.state,a.lga, a.mode, a.gsm, a.email,a.usernamea,a.passworda FROM realdata a WHERE a.usernamea =? AND passworda =? ";
$stmt = $pdo->prepare($Query);
// echo $usernamea;
$stmt->execute([$usernamea,$passworda]);
if ($stmt->rowCount() == 0)
echo "NOT_FOUND";
else
echo recordSetToJson($stmt,true,"std_rec");
//
}else if ($opID == "STUDENT_RECORD_ALL"){
// echo $Query = "SELECT remitaRRR,a.matNo, a.names, a.sex, a.course, a.levelID, a.state,a.lga,a.mode, a.gsm, a.email,a.usernamea,a.passworda FROM realdata a, remitaorder b WHERE a.matNo =b.regNo AND b.transApproved='$isApproved' AND b.paymentType= '$paymentType' and b.pay_session= '$session' ";
$Query = "SELECT a.matNo, a.names, a.sex, a.course, a.levelID, a.state,a.lga,a.mode, a.gsm, a.email FROM realdata a where matNo in (select regNo from remitaorder)";
$stmt = $pdo->prepare($Query);
$stmt->execute();
if ($stmt->rowCount() == 0)
echo "NOT_FOUND";
else
// echo "am here";
echo recordSetToJson($stmt,true,"Biodata");
}
$pdo=null;
?>