| 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/admin_student/ |
Upload File : |
<?php
//die("am here");
//session_start();
//require_once('../connect.php');
//$db=db_connect();
$matno= $_SESSION['matNo'];
$levelID=$_SESSION['levelID'];
$course= $_SESSION['course'];
//echo $formNo;
//echo $numFresher;
//Get course ID
$res=$db->query("select * from dept where dOption='$course'");
$res_fetch=$res->fetch(PDO::FETCH_BOTH);
$n=$res->rowCount();
if ($n>0){
$deptID=$_SESSION['deptID']=$res_fetch['sn'];
}
//get currect Semester and session
$sql_current=$db->query("select * from current where sn=2");
$sql_current_fetch=$sql_current->fetch(PDO::FETCH_BOTH);
$num_current=$sql_current->rowCount();
if ($num_current==1){
$semester=$_SESSION['asemester']=$sql_current_fetch['asemester'];
$asession=$_SESSION['asession']=$sql_current_fetch['asession'];
}
//get fresher status
$sdouble=$db->query("select * from realdata where matNo='$matno' and fresher like '10%'");
$sdouble_fetch=$sdouble->fetch(PDO::FETCH_BOTH);
$rdouble=$sdouble->rowCount();
$formNo=$sdouble_fetch['formNo'];
if ($rdouble==1){
$matno=$sdouble_fetch['matNo'];
}
//Check amount already paid
//require_once('../connect_Consultant.php');
//$matno='OT20230100002';
$db_con=db_con_connect();
//echo $db_con->query("select sum(amtPaid) as amtP from remitaorder where `regNo`='$matno' and transApproved=True")->rowCount();
// $hhh="select amtPaid as amtP from remitaorder where `regNo`='$matno'";
//echo "select * from stdprofile where matno='$matno'";
$kk=$db_con->query("select * from stdprofile where matricno='$matno'");
if ($kk->rowCount()==1){
$kk_fetch=$kk->fetch(PDO::FETCH_BOTH);
$kMatNo=$kk_fetch['stdid'];
$matNo=$kMatNo;
}
$hhh = "select sum(AmountAuthorized) as amtP from payment_log where stdid='$matNo' and PaymentState='Paid' and PaymentSession='2024/2025'";
//die();
$query=$db_con->query($hhh);
$q2_num=$query->rowCount();
//echo "am here";
$aspoaa="select sum(amtPaid) as amtP from remitaorder where `regNo`='$matno' and transApproved='True' and (paymentType='School Fees' or paymentType='Additional School Fees')and status<>'Re-fund' and `pay_session`='$asession'";
$aspoaa_query=$db->query($aspoaa);
if ($aspoaa_query->rowCount()>0){
$aspoaa_fetch=$aspoaa_query->fetch(PDO::FETCH_BOTH);
$aspoaa_amt=$aspoaa_fetch['amtP'];
}else{
$aspoaa_amt=0;
}
$query_fetch=$query->fetch(PDO::FETCH_BOTH);
//echo $asession;
//echo $query_fetch['amtP'];
if (($q2_num>0) and ($query_fetch['amtP']>0)) {
// $amtPaid = $query_fetch['amtP']+$query_fetch['amtP']/100*5;
$amtPaid = $query_fetch['amtP']-500+$aspoaa_amt;
// echo "Payment Has Been Made, Proceed to Registration";
//check status repeater
}else{
$amtPaid = 0;
}
//die();
//check status repeater
$session_split=explode('/',$asession);
$session_gena=$session_split[0]-1;
$session_genb=$session_split[1]-1;
$session_gen=$session_gena.'/'.$session_genb;
//$checkRemark="select * from rawcgpa where matNo='$matno' and `remark` LIKE 'REPE%' and asession='$session_gen' order by sn";
$checkRemark = "select * from realdata where matNo='$matno' and `status` like '%Repeat%'";
$resultRemark=$db->query($checkRemark);
$numRemark=$resultRemark->rowCount();
$specialFee=$_SESSION['specialFee'] = 0;
if (($numRemark>0) and ! (($levelID==7) or ($levelID==9) or ($levelID==2)or ($levelID==4) )) {
$remark = 'Repeater';
// echo $numRemark;
// echo $levelID;
$_SESSION['repeater'] = $remark;
// echo 'bbbbbb';
}elseif(($numRemark>0) and (($levelID==7) or ($levelID==9) or ($levelID==2)or ($levelID==4))){
$remark = 'Normal';
$_SESSION['repeater'] = 'Normal';
// echo 'hrrrrrr';
}else{
// $specialFee=$_SESSION['specialFee'] = 0;
$checkFresher="select * from admitted where formNo='$formNo'";
$resultFresher=$db->query($checkFresher);
$numFresher=$resultFresher->rowCount();
// echo '==='.$numFresher.'===';
if ($numFresher>0){
$resultFresher_fetch=$resultFresher->fetch(PDO::FETCH_BOTH);
$remark=$resultFresher_fetch['status'];
$specialFee=$_SESSION['specialFee'] = $resultFresher_fetch['specialFee'];
}else {
$remark = 'Normal';
$statusRealdata = "select * from realdata where matNo='$matno' and status='Ex-Student'";
$statusRemarkCount = $db->query($statusRealdata)->rowCount();
if ($statusRemarkCount == 1) {
$remark = 'Ex-Student';
}
// $specialFee=$_SESSION['specialFee'] =0.0;
// echo 'herererrerere';
}
}
$dd=$_SESSION['ndStatus'];
//die();
if ($dd==1){
$remark='Ex-Student';
}
$k=$db->query("select * from realdata where matNo='$matno' and (`status`='Deferment' or `status`='Repeater') ");
$deferment=$k->rowCount();
if ($deferment=='1'){
$remark='Repeater';
$_SESSION['repeater']=$remark;
}
if ((($levelID == '6') or ($levelID == '7')or ($levelID == '2')or ($levelID == '6')) and ($remark == 'Repeater')) {
$remark='Normal';
}
//End statuse
//$deptID=16;
//$levelID=4;
//$asession='2018/2019';
//$remark='Normal';
//$remark='Repeater';
//$remark='Ex-Student';
//echo $numFresher;
if (($remark=='Ex-Student') and ($levelID==4)){
$remark='Normal';
}
if (($remark=='Ex-Student') and ($levelID==12)){
$remark='Normal';
}
//if ($matno=='2142105554'){
// echo $checkAmount="select * from schoolfee where dept='$deptID' and level='$levelID' and status='$remark' and asession='$asession'" ;
// die();
//}
if ($matno=='CM202401141319x'){
echo $checkAmount="select * from schoolfee where dept='$deptID' and level='$levelID' and status='$remark' and asession='$asession'" ;
die();
}
$checkAmount="select * from schoolfee where dept='$deptID' and level='$levelID' and status='$remark' and asession='$asession'" ;
//die();
$resultAmount=$db->query($checkAmount);
$numAmount=$resultAmount->rowCount();
$resultAmount_fetch=$resultAmount->fetch(PDO::FETCH_BOTH);
//$kAmt1=$resultAmount_fetch['amount']-$resultAmount_fetch['amount']/100*5;
$kAmt1=$resultAmount_fetch['amount'];
$kAmt= $kAmt1+$specialFee;
//if ($matNo=='HQ20220100971'){
// echo $checkAmount;
// die();
//}
$pamela="select * from olevel where formNo='$matno'";
$pamela_exe=$db->query($pamela);
if ($pamela_exe->rowCount()>0){
$pamela_fetch=$pamela_exe->fetch(PDO::FETCH_BOTH);
$olvelCount=$pamela_fetch['noOfResult'];
// echo $olvelCount;
// echo "===".$numFresher;
if (($olvelCount==2) and ($numFresher>0)){
$kAmt1=$resultAmount_fetch['amount'];
$kAmt= $kAmt1+$specialFee+2500;
}
}
//$kAmt=$kAmt-$kAmt/100*5;
$k_amount=$_SESSION['amount']=$_SESSION['amount1']=$kAmt-$amtPaid;
//echo $remark;
//echo $levelID;
//echo $amtPaid;
//echo "1:";
//echo $asession;
//echo $kAmt.'----';
//echo "2:";
//die($k_amount);
//if ($matno=='PA20230103159'){
// echo $resultAmount_fetch['amount'];
// echo $kAmt;
// echo $k_amount;
//// die();
//}
//die($matno);
?>