retrieve ( $record ); $user = new User (); $user->retrieve ( $focus->assigned_user_id ); $labels = return_module_language($focus->ecmlanguage, 'EcmInvoiceCosOuts'); include_once ("include/MPDF57/mpdf.php"); $p = new mPDF ( '', 'A4', null, 'helvetica', 10, 10, 30, 45, 5, 5 ); $mpdf->mirrorMargins = 1; $db = $GLOBALS ['db']; // document pdf // document already exist? /* $res = $db->query ( "SELECT footer, content FROM ecminvoicecosout_pdf WHERE id='$record'" ); if ($res->num_rows == 0) { */ // create and save document $positions = formatPDFPositions ( $focus->getPositionList ( true ), $focus ); // get header $header = ''; if($focus->pdf_type=='K'){ include_once ("modules/EcmInvoiceCosOuts/PDFTemplate/header.php"); $content = ''; include_once ("modules/EcmInvoiceCosOuts/PDFTemplate/content.php"); } else { include_once ("modules/EcmInvoiceCosOuts/PDFTemplate/header_en.php"); $content = ''; include_once ("modules/EcmInvoiceCosOuts/PDFTemplate/content_en.php"); } global $current_user,$app_list_strings; /* $db->query ( "INSERT INTO ecminvoicecosout_pdf VALUES ('$record','$current_user->id', NOW(),'" . urlencode ( $header ) . "', '" . urlencode( $content ) . "')" ); } else { $row = $db->fetchByAssoc ( $res ); $header = urldecode ( $row ['footer'] ); // punk rock! $content = urldecode ( $row ['content'] ); }*/ //var_dump($positions); $p->SetHTMLHeader ( $header ); $footer='
e5 Polska Sp. z o.o
ul. WÄ…wozowa 11, 02-796 Warszawa, Poland
22 228 20 90
+ 48 (56) 674 60 47
www.e5.pl
Bank: BANK MILLENIUM
Bank IBAN: PL36116022020000000064080587
Bank SWIFT: BIGBPLPW
KRS: 28207
NIP: PL 525-21-73-990
REGON: 016280234
'; $p->SetHTMLFooter($footer); $p->WriteHTML ( $content ); //echo $content; // draw PDF $p->Output ();