Add php files
This commit is contained in:
46
modules/EcmStockDocOuts/createPDF.php
Executable file
46
modules/EcmStockDocOuts/createPDF.php
Executable file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
if (!$_REQUEST ['record'] || $_REQUEST ['record'] == '') {
|
||||
die('Brak rekordu');
|
||||
} else {
|
||||
$record = $_REQUEST ['record'];
|
||||
}
|
||||
|
||||
include_once ("modules/EcmStockDocOuts/PDFTemplate/helper.php");
|
||||
|
||||
$focus = new EcmStockDocOut ();
|
||||
$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);
|
||||
$labels = return_module_language($focus->ecmlanguage, 'EcmStockDocOuts');
|
||||
$mpdf->mirrorMargins = 1;
|
||||
$db = $GLOBALS ['db'];
|
||||
$positions = formatPDFPositions22($focus->getPositionList(true), $focus);
|
||||
$quantity = getQuantity22($focus->getPositionList(true), $focus);
|
||||
$content = '';
|
||||
|
||||
if ($_REQUEST['pdf_type']=='lr') {
|
||||
include_once ("modules/EcmStockOperations/PdfTemplate/content.php");
|
||||
$content = getDocOperations('EcmStockDocOuts', $record);
|
||||
} else if ($_REQUEST['pdf_type']=='1') {
|
||||
include_once ("modules/EcmStockDocOuts/PDFTemplate/content.php");
|
||||
} else
|
||||
include_once ("modules/EcmStockDocOuts/PDFTemplate/content2.php");
|
||||
|
||||
$ec = new EcmSysInfo ();
|
||||
|
||||
$footer = $ec->getFooterForModule('EcmStockDocOuts');
|
||||
$header = $ec->getHeaderForModule('EcmStockDocOuts');
|
||||
$p->SetHTMLHeader($header);
|
||||
$p->SetHTMLFooter($footer);
|
||||
$p->WriteHTML($content);
|
||||
if ($_REQUEST['pdf_type']!='lr') {
|
||||
$p->Output('WZ_'.str_replace('/','',$focus->document_no).'.pdf','I');
|
||||
} else {
|
||||
$p->Output();
|
||||
}
|
||||
Reference in New Issue
Block a user