init
This commit is contained in:
127
modules/EcmPurchaseOrders/createPDF.php
Normal file
127
modules/EcmPurchaseOrders/createPDF.php
Normal file
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
ini_set('display_errors',1);
|
||||
if (!$_REQUEST['record'] || $_REQUEST['record']=='')
|
||||
die('Brak rekordu');
|
||||
else
|
||||
$record = $_REQUEST['record'];
|
||||
|
||||
include_once("modules/EcmPurchaseOrders/PDFTemplate/helper.php");
|
||||
|
||||
$focus = new EcmPurchaseOrder();
|
||||
$focus -> retrieve($record);
|
||||
|
||||
$positions = formatPDFPositions($focus->getPositionList(true), $focus);
|
||||
|
||||
$user = new User();
|
||||
$user -> retrieve($focus->assigned_user_id);
|
||||
|
||||
$labels = return_module_language($focus->ecmlanguage, 'EcmPurchaseOrders');
|
||||
include_once("include/MPDF57/mpdf.php");
|
||||
$p=new mPDF('','A4', null, 'helvetica', 10,10,30,45,5,5);
|
||||
$mpdf->mirrorMargins = 1;
|
||||
|
||||
//get languages
|
||||
|
||||
//get header
|
||||
$header = '';
|
||||
include_once("modules/EcmPurchaseOrders/PDFTemplate/header.php");
|
||||
$p->SetHTMLHeader($header);
|
||||
|
||||
$ba_number = '35 1160 2202 0000 0000 6408 0411';
|
||||
$ba_name = 'BANK MILLENIUM';
|
||||
|
||||
//get content
|
||||
$content = '';
|
||||
include_once("modules/EcmPurchaseOrders/PDFTemplate/content.php");
|
||||
//$p->WriteHTML($style);
|
||||
$w = "62"; //first column width
|
||||
$w2 = "12"; //second column width
|
||||
$footer = '
|
||||
<hr>
|
||||
<table style="width: 100%; font-size: 7pt;">
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
e5 Polska Sp. z o.o
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_KRS'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
28207
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
ul. Wąwozowa 11
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_NIP'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
PL525273990
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
02-796 Warszawa
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_REGON'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
016280234
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
Tel: +48 (22) 228 20 90
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_BANK'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
'.$ba_name.'
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
Fax: +48 (56) 674 60 47
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_BANK_ACCOUNT'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
'.$ba_number.'
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
'.$user->email1.'
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_GIOS'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
E0006254W
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<table style="width: 100%; font-size: 7pt;">
|
||||
<tr>
|
||||
<td style="width: 50%;">
|
||||
{PAGENO}/{nb}
|
||||
</td>
|
||||
<td style="width: 50%; text-align: right">
|
||||
<b>'.$focus->document_no.'</b>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
';
|
||||
$p->SetHTMLFooter($footer);
|
||||
$p->WriteHTML($content);
|
||||
|
||||
|
||||
//draw PDF
|
||||
$p->Output();
|
||||
|
||||
Reference in New Issue
Block a user