5, // Set your desired top margin in millimeters 'margin_bottom' => 1, 'margin_left' => 1, 'margin_right' => 1, ]); $mpdf->Addpage('P'); $stylesheet = file_get_contents('Styles/pdf.css'); $mpdf->WriteHTML($stylesheet, \Mpdf\HTMLParserMode::HEADER_CSS); $quote_res = $db->exec_query('quotes', ['*'], '', '', '', '', "record_id = {$_GET['record_id']}"); $quote = $quote_res->fetch_assoc(); $quote_number = $quote['quote_no']; $date_created = $quote['date_created']; $date_exp = $quote['date_exp']; $description = $quote['description']; $total = $quote['total']; $content_array = explode(';', $quote['quote_content']); $content_table = ''; foreach ($content_array as $content) { if (strlen($content) > 2) { $info = explode(',', $content); $content_table = $content_table . " $info[0] $info[1] R " . number_format($info[2], 2, '.', ',') . " $info[3] R " . number_format($info[4], 2, '.', ',') . " "; } } $company_details = $db->exec_query('company', ['*']); $company_info = $company_details->fetch_assoc(); $company_name = $company_info['company_name']; $company_email = $company_info['email']; $company_address = $company_info['address']; $company_phone = $company_info['phone']; $bank = $company_info['bank']; $acc = $company_info['acc']; $branch = $company_info['branch']; $client_res = $db->exec_query('clients', ['*'], '', '', '', '', "record_id = {$quote['clients_id']}"); $client = $client_res->fetch_assoc(); $client_name = $client['clients_name']; $client_email = $client['email']; $client_address = $client['address']; $client_phone = $client['cell']; $htmlContent = "

EST. QUOTE

#$quote_number

DATE: $date_created

EXP : $date_exp

FROM

TO

$company_name

$client_name

$company_email

$client_email

$company_phone

$client_phone

$company_address

$client_address

$company_vat

$client_vat


$description

$content_table
DESCRIPTION QUANTITY AMOUNT DISCOUNT SUB TOTAL
"; $mpdf->WriteHTML($htmlContent); $mpdf->Output(); }