34 lines
1.1 KiB
PHP
34 lines
1.1 KiB
PHP
|
|
<?php
|
||
|
|
ini_set('display_errors', 1);
|
||
|
|
if (!$_REQUEST ['record'] || $_REQUEST ['record'] == '') {
|
||
|
|
die('Brak rekordu');
|
||
|
|
} else {
|
||
|
|
$record = $_REQUEST ['record'];
|
||
|
|
}
|
||
|
|
include_once ("modules/EcmStockDocCorrects/PDFTemplate/helper.php");
|
||
|
|
include_once ("modules/EcmSysInfos/EcmSysInfo.php");
|
||
|
|
$focus = new EcmStockDocCorrect ();
|
||
|
|
$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('EcmStockDocCorrects');
|
||
|
|
$header = $ec->getHeaderForModule('EcmStockDocCorrects');
|
||
|
|
$content = '';
|
||
|
|
if ($_REQUEST['pdf_type']=='lr') {
|
||
|
|
include_once ("modules/EcmStockOperations/PdfTemplate/content.php");
|
||
|
|
$content = getDocOperations('EcmStockDocCorrects', $record);
|
||
|
|
} else
|
||
|
|
include_once ("modules/EcmStockDocCorrects/PDFTemplate/content.php");
|
||
|
|
$p->SetHTMLHeader($header);
|
||
|
|
$p->WriteHTML($content);
|
||
|
|
$p->SetHTMLFooter($footer);
|
||
|
|
$p->Output();
|