42 lines
1.1 KiB
PHP
Executable File
42 lines
1.1 KiB
PHP
Executable File
<?php
|
|
|
|
if (!$_REQUEST ['record'] || $_REQUEST ['record'] == '')
|
|
die('Brak rekordu');
|
|
else
|
|
$record = $_REQUEST ['record'];
|
|
|
|
include_once ("modules/EcmStockDocInsideIns/PDFTemplate/helper.php");
|
|
|
|
$focus = new EcmStockDocInsideIn ();
|
|
$focus->retrieve($record);
|
|
$user = new User ();
|
|
$user->retrieve($focus->assigned_user_id);
|
|
|
|
include_once ("include/MPDF57/mpdf.php");
|
|
$p = new mPDF('', 'A4', null, 'helvetica', 10, 10, 30, 45, 5, 5);
|
|
$mpdf->mirrorMargins = 1;
|
|
|
|
$db = $GLOBALS ['db'];
|
|
|
|
// create and save document
|
|
$positions = formatPDFPositions($focus->getPositionList(true), $focus);
|
|
$ec = new EcmSysInfo ();
|
|
|
|
$footer = $ec->getFooterForModule('EcmStockDocIns');
|
|
$header = $ec->getHeaderForModule('EcmStockDocIns');
|
|
$content = '';
|
|
if ($_REQUEST['pdf_type']=='lr') {
|
|
include_once ("modules/EcmStockOperations/PdfTemplate/content.php");
|
|
$content = getDocOperations('EcmStockDocInsideIns', $record);
|
|
} else
|
|
include_once ("modules/EcmStockDocInsideIns/PDFTemplate/content.php");
|
|
|
|
|
|
$p->SetHTMLHeader($header);
|
|
$p->WriteHTML($content);
|
|
$p->SetHTMLFooter($footer);
|
|
|
|
// draw PDF
|
|
$p->Output();
|
|
|