| 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/externalCall/ |
Upload File : |
<?php
session_start();
//$deptE=$_SESSION['dept'];
//$levelID=$_SESSION['level'];
//show status like '%connected%';
include("SpreadsheetAPI_pdo_Alumni.php");
function recordSetToJson($mysql_result,$jsonencode=false,$marker="") {
$return_arr = array();
while($datarow = mysql_fetch_assoc($mysql_result)){
$return_arr[] = $datarow;
}
if (!$jsonencode)
return $return_arr;
else{
if ($marker != "")
return json_encode(array($marker =>$return_arr));
else
return json_encode($return_arr);
}
}
$dat=date('d-m-y');
$filename = "Alumni".$dat.".xls";
require('../connect.php');
$db=db_connect();
if (isset($_REQUEST['VIEW']) && $_REQUEST['VIEW']=='TRUE'){
$Query="SELECT a.orderID,a.remitaRRR,a.transDate,a.regNo,b.names,c.names,a.amtPaid,a.charges FROM `remitaorder_2` a left join realdata b on b.matNo=a.regNo join otherpayment c on c.idNo=a.regNo where a.paymentType='Alumni Due' and a.transApproved='True' ORDER BY `a.transDate` DESC";
}else{
$Query="SELECT a.orderID,a.remitaRRR,a.transDate,a.regNo,b.names,c.names,a.amtPaid,a.charges FROM `remitaorder_2` a left join realdata b on b.matNo=a.regNo join otherpayment c on c.idNo=a.regNo where a.paymentType='Alumni Due' and a.transApproved='True' ORDER BY `a.transDate` DESC";
// die("Error Occur!");
}
if (isset($_REQUEST['JSON'])){
$result = $db->query($Query);
if ($result->rowCount() == 0)
echo "NOT_FOUND";
else
echo recordSetToJson($results,true);
}else {
//$result=$result1->fetchAll(PDO::FETCH_BOTH);
// $result=mysql_query($Query,$db);
//echo 'here';
// $result = $db->query($Query);
xlsProcess($filename);
exit;
}
?>