whoami7 - Manager
:
/
home
/
gracious
/
ledgerless.graciousphils.com
/
Upload File:
files >> /home/gracious/ledgerless.graciousphils.com/ervPrint1.php
<?php require('fpdf.php'); include 'connection.php'; if(isset($_POST['btnPrint1'])){ $fromDate = date('Y-m-d H:i:s', strtotime($_POST['fromDate'])); $toDate = date('Y-m-d H:i:s', strtotime($_POST['toDate'])); $startdate = $fromDate; $enddate = $toDate; $query = "select salesOffice,clientName,agentName,transactionDetails, SUM(transactionCashout) AS total_amount, modeTransfer, accountNumber, accountName, dateRequested from tblrequests where dateRequested >= :startdate and dateRequested <= :enddate and transactionType = 'ERV FUND' and modeTransfer LIKE '%BPI BANK%' GROUP BY clientName, agentName WITH ROLLUP;"; $st = $pdo->prepare($query); $st->bindParam(':startdate', $startdate); $st->bindParam(':enddate', $enddate); $st->execute(); $pdf = new FPDF('L','mm','Letter'); $pdf->AddPage(); $pdf->SetFont('Arial','B',10); $pdf->Cell(0,10,'ERV Funding Report',0,1,'C'); $pdf->Ln(5); $pdf->SetFont('Arial','B',8); $pdf->Cell(35,10,'Employee Name',1); $pdf->Cell(35,10,'Client Name',1); $pdf->Cell(10,10,'Sales Ofc',1); $pdf->Cell(70,10,'Transaction Details',1); $pdf->Cell(20,10,'Referral Fee',1); $pdf->Cell(25,10,'Mode of Transfer',1); $pdf->Cell(25,10,'Account Number',1); /*$pdf->Cell(30,10,'Account Name',1);*/ $pdf->Cell(30,10,'Date Requested',1); $pdf->Ln(); if($st->rowCount() > 0){ $pdf->SetFont('Arial','',8); while ($data = $st->fetch()) { if(!empty($data['clientName'])){ if(!empty($data['agentName'])){ $pdf->Cell(35,10,$data['clientName'],1); $pdf->Cell(35,10,$data['agentName'],1); $pdf->Cell(10,10,$data['salesOffice'],1); $pdf->Cell(70,10,$data['transactionDetails'],1); $pdf->Cell(20,10,$data['total_amount'],1); $pdf->Cell(25,10,$data['modeTransfer'],1); $pdf->Cell(25,10,$data['accountNumber'],1); /*$pdf->Cell(30,10,$data['accountName'],1);*/ $pdf->Cell(30,10,$data['dateRequested'],1); $pdf->Ln(); } else{ $pdf->Cell(35,10,'',1); $pdf->Cell(35,10,'',1); $pdf->Cell(10,10,'',1); $pdf->Cell(70,10,"Sub Total:",1); $pdf->Cell(20,10,$data['total_amount'],1); $pdf->Cell(25,10,'',1); $pdf->Cell(25,10,'',1); /*$pdf->Cell(30,10,$data['accountName'],1);*/ $pdf->Cell(30,10,'',1); $pdf->Ln(); } } else{ $pdf->Cell(35,10,'',1); $pdf->Cell(35,10,'',1); $pdf->Cell(10,10,'',1); $pdf->Cell(70,10,"Grand Total:",1); $pdf->Cell(20,10,$data['total_amount'],1); $pdf->Cell(25,10,'',1); $pdf->Cell(25,10,'',1); /*$pdf->Cell(30,10,$data['accountName'],1);*/ $pdf->Cell(30,10,'',1); $pdf->Ln(); } } } $pdf->Output('D', 'erv-funding.pdf'); } ?>
Copyright ©2021 || Defacer Indonesia