:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/www/crm/quatation/**
:: Editing File: qdpo .php
<?php // Enable error reporting for debugging error_reporting(E_ALL); ini_set('display_errors', '1'); // Include your database connection and Composer's autoloader //include("db.php"); require_once __DIR__ . '/vendor/autoload.php'; // --- 5. Get the captured HTML content and generate the PDF --- $poHTML = ob_get_clean(); // Create a new mPDF instance $mpdf = new \Mpdf\Mpdf([ 'mode' => 'utf-8', 'format' => 'A4', 'margin_left' => 10, 'margin_right' => 10, 'margin_top' => 10, 'margin_bottom' => 10, ]); /* =============================== WATERMARK =============================== */ $watermark = __DIR__ . '/assets/images/watermark.png'; if (file_exists($watermark)) { $mpdf->SetWatermarkImage( $watermark, 0.1, // opacity '', [150, 150] // size ); $mpdf->showWatermarkImage = true; } else { die('Watermark image not found'); } $mpdf->SetWatermarkImage($watermark, 0.1); $mpdf->SetWatermarkImage( __DIR__ . '/assets/images/watermark.png', 0.1 ); $mpdf->showWatermarkImage = true; /* WATERMARK FIRST */ //$mpdf->SetWatermarkImage(...); //$mpdf->showWatermarkImage = true; /* =============================== HEADER =============================== */ $mpdf->SetHTMLHeader(' <div style="text-align:right;font-size:10px;"> PSA HAPPY HOME SOLUTIONS FOR EVERY SPACE...! </div> '); /* =============================== FOOTER =============================== */ $mpdf->SetHTMLFooter(' <div style="text-align:center; font-size:13px; color:#555;"> <!-- Line 1 --> <div style="margin-bottom:10px;"> <img src="'.__DIR__.'/assets/icons/facebook.png" width="10"> psahappyhome <img src="'.__DIR__.'/assets/icons/instagram.png" width="10"> psahappyhome <img src="'.__DIR__.'/assets/icons/phone.png" width="10"> +91 97686 76862 <img src="'.__DIR__.'/assets/icons/location.png" width="15"> Shimoga • Bangalore • Karnataka </div> <!-- Line 2 --> <div style="font-size:10px;margin-top:10px;"> Page {PAGENO} | ARCHITECTS, CONTRACTORS & INTERIORS </div> </div> '); function loadPhpAsHtml($filePath) { ob_start(); include $filePath; return ob_get_clean(); } /* =============================== LOAD CSS =============================== */ $cssPath = __DIR__ . '/assets/css/quotation.css'; if (file_exists($cssPath)) { $css = file_get_contents($cssPath); $mpdf->WriteHTML($css, \Mpdf\HTMLParserMode::HEADER_CSS); } /* =============================== LOAD PAGES (ONE BY ONE) =============================== */ //$mpdf->WriteHTML(file_get_contents(__DIR__ . '/pages/page1-cover.php')); $mpdf->WriteHTML(loadPhpAsHtml(__DIR__ . '/pages/page1-cover.php')); $mpdf->AddPage(); $mpdf->WriteHTML(loadPhpAsHtml(__DIR__ . '/pages/page21-scope.php')); $mpdf->AddPage(); $mpdf->WriteHTML(loadPhpAsHtml(__DIR__ . '/pages/page22-scope.php')); $mpdf->AddPage(); $mpdf->WriteHTML(loadPhpAsHtml(__DIR__ . '/pages/page3-estimation.php')); $mpdf->AddPage(); $mpdf->WriteHTML(loadPhpAsHtml(__DIR__ . '/pages/page4-extra.php')); $mpdf->AddPage(); $mpdf->WriteHTML(loadPhpAsHtml(__DIR__ . '/pages/page5-terms.php')); /*$mpdf->AddPage(); $mpdf->WriteHTML(file_get_contents(__DIR__ . '/pages/page2-scope.php')); $mpdf->AddPage(); $mpdf->WriteHTML(file_get_contents(__DIR__ . '/pages/page3-estimation.php')); $mpdf->AddPage(); $mpdf->WriteHTML(file_get_contents(__DIR__ . '/pages/page4-extra.php')); $mpdf->AddPage(); $mpdf->WriteHTML(file_get_contents(__DIR__ . '/pages/page5-terms.php')); */ /* =============================== OUTPUT PDF =============================== */ $mpdf->Output('Professional_Quotation.pdf', 'D'); // Output the PDF to the browser for inline display ('I') //$mpdf->Output('PO-123.pdf', 'I'); ?>