Add php files
This commit is contained in:
44
modules/EcmPurchaseOrders/createPDF.php
Executable file
44
modules/EcmPurchaseOrders/createPDF.php
Executable file
@@ -0,0 +1,44 @@
|
||||
<?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 content
|
||||
$content = '';
|
||||
include_once("modules/EcmPurchaseOrders/PDFTemplate/content.php");
|
||||
include_once('modules/EcmSysInfos/EcmSysInfo.php');
|
||||
$ecmsysinfos = new EcmSysInfo();
|
||||
$header = $ecmsysinfos->getHeaderForModule('EcmPurchaseOrders');
|
||||
$footer = $ecmsysinfos->getFooterForModule('EcmPurchaseOrders');
|
||||
//$p->WriteHTML($style);
|
||||
|
||||
$p->SetHTMLHeader($header);
|
||||
$p->WriteHTML($content);
|
||||
$p->SetHTMLFooter($footer);
|
||||
|
||||
|
||||
echo 'aaa';
|
||||
//draw PDF
|
||||
$p->Output();
|
||||
|
||||
Reference in New Issue
Block a user