Backups Created:
/home/japatmex/public_html/wp-content/edit-wolf.php
Savvy
W
olf -
MANAGER
Edit File: createpdfinvoice.php
<?php //$Vdata = file_get_contents('mpdf/html/index.php'); $html = ''; $html.='<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Tax Invoice</title> <link rel="stylesheet" href="style.css" media="all" /> <style> @font-face { font-family: Arial; } .clearfix:after { content: ""; display: table; clear: both; } a { color: #0087C3; text-decoration: none; } body { position: relative; width: 21cm; height: 29.7cm; margin: 0 auto; color: #555555; background: #FFFFFF; font-family: Arial, sans-serif; font-size: 12px; } header { padding: 10px 0; margin-bottom: 20px; border-bottom: 1px solid #AAAAAA; } #logo { float: left; margin-top: 8px; } #logo img { height: 70px; } #company { float: right; text-align: right; } #details { margin-bottom: 50px; } #client { padding-left: 6px; margin-left: 15px; border-left: 6px solid #0087C3; width: 190px; display: inline-table; float: left; min-height: 110px; } #client .to { color: #777777; } h2.name { font-size: 13px; font-weight: normal; margin: 0; } #invoice { display: block; } #invoice h1 { color: #0087C3; font-size: 2.4em; line-height: 1em; font-weight: normal; margin: 0 0 10px 0; } #invoice .date { font-size: 1.1em; color: #777777; } table { width: 100%; border-collapse: collapse; border-spacing: 0; margin-bottom: 20px; } table th, table td { padding: 6px 20px; background: #EEEEEE; text-align: center; border-bottom: 1px solid #FFFFFF; } table th { white-space: nowrap; font-weight: normal; } table td { text-align: right; } table td h3{ color: #555555; font-size: 13px; font-weight: normal; margin: 0 0 0.2em 0; } table .no { color: #FFFFFF; font-size: 1.6em; background: #555555; } table .desc { text-align: left; } table .unit { background: #DDDDDD; } table .qty { } table .total { background: #555555; color: #FFFFFF; } table td.unit, table td.qty, table td.total { font-size: 1.2em; } table tbody tr:last-child td { border: none; } table tfoot td { padding: 4px; background: #FFFFFF; border-bottom: none; font-size: 1.2em; white-space: nowrap; border-top: 1px solid #AAAAAA; } table tfoot tr:first-child td { border-top: none; } table tfoot tr:last-child td { color: #555555; font-size: 1.4em; border-top: 1px solid #555555; } table tfoot tr td:first-child { border: none; } #thanks{ font-size: 2em; margin-bottom: 50px; } #notices{ padding-left: 6px; border-left: 6px solid #0087C3; } #notices .notice { font-size: 1.2em; } footer { color: #777777; width: 100%; height: 30px; position: absolute; bottom: 0; border-top: 1px solid #AAAAAA; padding: 8px 0; text-align: center; } .bg-dark > th{ border-color: #fff !important; color: #fff !important; font-size: 12px; } </style> </head> <body> <header class="clearfix"> <div id="logo"> <img src="'.$INV_LOGO.'"> </div> <div id="company"> <h2 style="margin: 0px;" >INVOICE # '.$id.' - '.$pStatus.'</h2> <div class="date">Date of Invoice: '.convertDate($invDate).'</div> </div> </header> <main> <div id="details" class="clearfix"> <div id="client"> <span> <div class="to">Client:</div> <h2 class="name">'.$userName.'</h2> <h2 class="name">'.$firstName.' '.$lastName.'</h2> <h2 class="name">'.$uPhone.'</h2> <div class="address">'.$uAddress.'</div> <div class="email"><a href="mailto:'.$userEmail.'">'.$userEmail.'</a></div> </span> </div> <div id="client"> <span> <div class="to">About Us:</div> <h2 class="name">'.$myCompany.'</h2> <div>'; $arr = explode("\n", $companyDtls); foreach ($arr as $value) { if($value != '') $value; } $html.='</div> <div>'.$phone.'</div> <div><a href="mailto:'.$email.'">'.$email.'</a></div> </span> </div> <div id="client"> <span> <div class="to">Payment Details:</div> <h2 class="name"><strong>Payment Method:</strong> '.$pMethod.'</h2> <h2 class="name"><strong>Transaction ID:</strong> '.$transactionId.'</h2> <div class="email"><strong>Email: </strong><a href="mailto:'.$payerEmail.'">'.$payerEmail.'</a></div> <h2 class="name"><strong>Paid Date: </strong> '.$paidDtTm.'</h2> <h2 class="name"><strong>Comments:</strong> '.$comments.'</h2> </span> </div> </div> <table border="0" cellspacing="0" cellpadding="0"> <thead> <tr> <th class="no">#</th> <th class="desc">DESCRIPTION</th> <th class="qty">QUANTITY</th> <th class="unit">UNIT COST</th> <th class="total">TOTAL</th> </tr> </thead> <tbody> <tr> <td class="no">1</td> <td class="desc"><h3>For Services Rendered</h3></td> <td class="unit">1</td> <td class="qty">'.$currency.' '.roundMe($invCredits).'</td> <td class="total">'.$currency.' '.roundMe($invCredits).'</td> </tr> </tbody> <tfoot> <tr> <td colspan="3"></td> <td>Sub Total:</td> <td>'.$currency.' '.roundMe($invCredits).'</td> </tr> <tr> <td colspan="3"></td> <td>Fee Amount:</td> <td>'.$currency. ' ' . ($invAmount - $invCredits) .'</td> </tr>'; if($amountPaid > 0) { $html.='<tr> <td colspan="3"></td> <td>Amount Paid:</td> <td>'.$currency.' '.roundMe($amountPaid).'</td> </tr>'; } $html.=' <tr> <td colspan="3"></td> <td>Amount Left:</td> <td>'.$currency.' '.roundMe($balance).'</td> </tr> <tr> <td colspan="3"></td> <td>VAT:</td> <td>'.$currency.' '.roundMe($vat).'</td> </tr> <tr> <td colspan="3"></td> <td>Grand Total:</td> <td>'.$currency.' '.roundMe($invAmount).'</td> </tr> </tfoot> </table>'; if($countPmnts > 0) { $html.='<div class="col-xs-12"> <div class="well"> <h3><strong>Partial Payments</strong></h3> <table class="table"> <tbody> <tr class="bg-dark text-white" style=""> <th class="no">Amount</th> <th class="no">Payment Method</th> <th class="no">Transaction ID</th> <th class="no">Date</th> <th class="no">Comments</th> </tr> '; $html .= (!empty($htmlPdf) ? $htmlPdf : ''); $html.='</tbody></table></div> </div>'; } //$html.='<div id="thanks">Thank you!</div> $html.='</main></body></html>'; $mpdf = new \Mpdf\Mpdf(); $mpdf->WriteHTML($html); //$mpdf->Output(); $file = "invoice-".$id; $pdfFilePath = $file.".pdf"; //save in folder $mpdf->Output(FCPATH . "invoices/".$pdfFilePath, "F");