| Server IP : 172.64.80.1 / Your IP : 172.70.50.63 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/print/ |
Upload File : |
<?php
session_start();
$mainBody='
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ePortal | Other Payment</title>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body>
';
//$_SESSION['idNo']='SG201603085DPT';
//$_SESSION['paymentTYPE']='New Transcript Request';
if (isset($_GET['ID'])){
$orderIDAspoa=$_GET['ID'];
if (isset($_SESSION['ptype'])){
$ptype=$_SESSION['ptype'];
}
}else{
die("An Error Occured");
}
//die();
require_once('../../connect.php');
$db=db_connect();
//$orderIDAspoa=$_SESSION['orderAspoa'];
$sqlBank="select * from remitaorder where orderID='$orderIDAspoa'";
//die();
$aspoaBank=$db->query($sqlBank);
$aspoaBank->rowCount();
//die();
$resultBank_fetch=$aspoaBank->fetch(PDO::FETCH_BOTH);
$orderIDNow=$resultBank_fetch['regNo'];
$paymentType=$resultBank_fetch['paymentType'];
//die();
//$ptype=$_GET['ptype'];
$sqlBank="select * from remitaorder where orderID='$orderIDAspoa' and transApproved='True' and paymenttype='$paymentType' order by transDate desc";
//die();
$resultBank=$db->query($sqlBank);
$countBank=$resultBank->rowCount();
$resultBank_fetch=$resultBank->fetch(PDO::FETCH_BOTH);
$ptype=$resultBank_fetch['paymentType'];
//echo $idNo;
include('../qr/qrlib.php');
$mm=$resultBank_fetch['orderID'].'.png';
//$qrText='https://www.federalpolyede.edu.ng/qrCheck.php?ID='.$resultBank_fetch['orderID'];
//$qrText = 'https://login.remita.net/remita/onepage/invoice.spa?rrr=201026692025';
// Path to save the QR code image file
$filePath = 'qrGen/'.$mm;
// Specify the desired file path
// Generate QR code image
QRcode::png($qrText, $filePath);
// Output QR code directly to the browser
//QRcode::png($qrText);
$qrText='https://login.remita.net/remita/onepage/invoice.spa?rrr='.$resultBank_fetch['remitaRRR'];
//$qrValue='https://login.remita.net/remita/onepage/invoice.spa?rrr='.$resultBank_fetch['remitaRRR'];
$sqlBank_2="select * from remitaorder_2 where orderID='$orderIDAspoa' and transApproved='True' and paymenttype='$ptype' order by transDate desc";
//die();
$resultBank_2=$db->query($sqlBank_2);
$countBank_2=$resultBank_2->rowCount();
$resultBank_fetch_2=$resultBank_2->fetch(PDO::FETCH_BOTH);
$amtPay=$resultBank_fetch['amtPaid'];
$idNo=$resultBank_fetch['regNo'];
$biodataSQL="select * from otherpayment where idNo='$idNo'";
$biodataResult=$db->query($biodataSQL);
$biodataResult_fetch=$biodataResult->fetch(PDO::FETCH_BOTH);
$biodataNum=$biodataResult->rowCount();
// $orderID=mysql_result($biodataResult,0,'orderID');
$names=$biodataResult_fetch['names'];
//$idNo=$biodataResult_fetch['idNo'];
if ($biodataNum==0){
$biodataSQL_r="select * from realdata where matNo='$idNo'";
$biodataResult_r=$db->query($biodataSQL_r);
$biodataResult_fetch_r=$biodataResult_r->fetch(PDO::FETCH_BOTH);
$biodataNum_r=$biodataResult_r->rowCount();
// $orderID=mysql_result($biodataResult,0,'orderID');
$names=$biodataResult_fetch_r['names'];
}
//$ptype=mysql_result($biodataResult,0,'ptype');
$descr=$resultBank_fetch['descr'];
$mainBody.='
<table width="80%" align="center" cellpadding="3" cellspacing="5">
<tr>
<td>
<table width="100%" cellspacing="1" cellpadding="1">
<tr>
<td valign="top">
<table width="100%" cellspacing="1" cellpadding="1">
<tr>
<td align="center" valign="top"><p><img src="../../images/siwesHead.png" width="731" height="95" /></p></td>
</tr>
<tr>
<td align="center" bgcolor="#CCCCCC"><strong id="cen"> '.strtoupper($ptype);
$mainBody.='
RECEIPT </strong></td>
</tr>
</table></td>
</tr>
<tr>
<td>
<table width="100%" cellspacing="5" cellpadding="3">
<tr>
<td colspan="1" id="lab">ID No.</td>
<td > </td>
<td colspan="3">'. $idNo.'</td>
</tr>
<tr>
<td colspan="1" id="lab">Name</td>
<td> </td>
<td colspan="3"><b><H3>'. strtoupper($names).'</H3></b></td>
</tr>
<tr>
<td colspan="1" id="lab">Description</td>
<td> </td>
<td colspan="3">'. $descr.'</td>
</tr>
<tr>
<td colspan="6" id="lab"> </td>
</tr>
</table> </td>
</tr>
<tr>
<td>
<table width="100%" cellspacing="5" cellpadding="3">
<tr>
<td colspan="5" bgcolor="#999999" id="headingg">PAYMENT DETAILS</td>
</tr>
<tr>
<td colspan="5">
<table width="100%" cellspacing="5" cellpadding="3">
<tr>
<td><table width="100%" border="1" cellpadding="3" cellspacing="0">
';
if ($countBank>0){
$qrValue='https://login.remita.net/remita/onepage/invoice.spa?rrr='.$resultBank_fetch['remitaRRR'];
$mainBody.='
<tr>
<td colspan="2" id="heeee">Payment Details</td>
</tr>
<tr>
<td width="29%"><strong>Receipt Number</strong></td>
<td width="71%">'.$resultBank_fetch['orderID'].'</td>
</tr>
<tr>
<td><strong>Remita Retrieval Reference</strong></td>
<td>'. $resultBank_fetch['remitaRRR'].'</td>
</tr>
<tr>
<td><strong>Date Paid</strong></td>
<td>'.$resultBank_fetch['dateCreated'].'</td>
</tr>
<tr>
<td><strong>Service Fee</strong></td>
<td>N'. $resultBank_fetch['amtPaid'].'</td>
<tr>
<td><strong>Total Amount Paid</strong></td>
<td style="font-size: x-large;">N'. number_format($amtPay,2).'</td>
</tr>
';
}else{
$mainBody.='
<tr>
<td> </td>
<td id="errr"><h3>'. 'Payment has not been made</h3></td>
</tr>';
}
$mainBody.='
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="25" colspan="5" ><em>*Proceed to the Students Account Unit of the Bursary Department for confirmation of your payment.</em></td>
</tr>
<tr>
<td height="25" colspan="5" bgcolor="#FFFFFF" id="headingg2"> </td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#666666" id="headingg">FOR OFFICIAL USE ONLY
<tr>
<td colspan="5"><table width="100%" cellspacing="5" cellpadding="3">
<tr>
<td> </td>
<td id="sch"> </td>
</tr>
<tr>
<td>Account Officer:: ______________________</td>
<td rowspan="2"><img src="' . $filePath . '" alt="QR Code"></td>
</tr>
<tr>
<td>Sign./ Date & Stamp: _________________</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="2" align="right"><hr />'.date('l, M d, o, h:i:s a').'</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>';
//echo $mainBody;
//die();
require_once 'dompdf/autoload.inc.php';
// Reference the Dompdf namespace
use Dompdf\Dompdf;
// Reference the Options namespace
use Dompdf\Options;
// Set options to enable embedded PHP
$options = new Options();
$options->set('isPhpEnabled', 'true');
// Instantiate dompdf class
$dompdf = new Dompdf($options);
$options->set('defaultFont', 'Helvetica');
$options->set('dpi','120');
$options->set('enable_html5_parser',true);
//$options->set('tempDir','C:\xampp\htdocs'); //Any directory)
//$dompdf=new Dompdf($options);
$dompdf->loadHTML($HTML);
$dompdf->setPaper('A4','landscape');
// (Optional) Setup the paper size and orientation
$dompdf->setPaper('A4', 'portrait');
// Render the HTML as PDF
$dompdf->render();
// Instantiate canvas instance
$canvas = $dompdf->getCanvas();
// Get height and width of page
$w = $canvas->get_width();
$h = $canvas->get_height();
$filename='otherPay-'.$orderIDNow.'.pdf';
// Specify watermark image
$imageURL = 'assets/img/avatars/fpelogo.png';
$imgWidth = 400;
$imgHeight = 400;
// Set image opacity
$canvas->set_opacity(.05);
// Specify horizontal and vertical position
$x = (($w-$imgWidth)/2);
$y = (($h-$imgHeight)/2);
// Add an image to the pdf
$canvas->image($imageURL, $x, $y, $imgWidth, $imgHeight);
// Output the generated PDF (1 = download and 0 = preview)
$dompdf->stream($filename, array("Attachment" => 0));
//
//include("../../mpdf/mpdf.php");
//$filename='otherPay-'.$orderIDNow.'.pdf';
//$mpdf=new mPDF('c');
//
//$mpdf->SetWatermarkImage('../../images/logoBack.png');
//$mpdf->showWatermarkImage = true;
//
//$dat=date('l, M d, o, h:i:s a');
//$customizedFooter='<img src="../../images/siwesfooter.png"><br><div align="right">'. $dat.'</div>';
//
//$mpdf->WriteHTML($mainBody);
//$mpdf->setFooter($customizedFooter) ;
//$mpdf->Output($filename,'D');
//exit;
//
//ob_end_flush();
//
?>