forked from science-ation/science-ation
prepare pdf-manager setup
This commit is contained in:
parent
890d8a23ff
commit
0ac2969c66
29
admin/helper_functions.inc.php
Normal file
29
admin/helper_functions.inc.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?
|
||||||
|
function generate_pdf($template_id=1, $inputs=[]){
|
||||||
|
|
||||||
|
$inputs = array($inputs);
|
||||||
|
|
||||||
|
|
||||||
|
$data = array(
|
||||||
|
'template_id' => $template_id,
|
||||||
|
'inputs' => $inputs
|
||||||
|
);
|
||||||
|
$postfields_json = json_encode($data);
|
||||||
|
|
||||||
|
$ch = curl_init();
|
||||||
|
error_log($postfields_json);
|
||||||
|
curl_setopt($ch, CURLOPT_URL,"http://10.15.183.210:3000/api/generate_pdf");
|
||||||
|
curl_setopt($ch, CURLOPT_POST, true);
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields_json);
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
||||||
|
'Content-Type: application/json',
|
||||||
|
'Connection: Keep-Alive'
|
||||||
|
));
|
||||||
|
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
|
||||||
|
$server_output = curl_exec($ch);
|
||||||
|
|
||||||
|
curl_close($ch);
|
||||||
|
}
|
||||||
|
?>
|
@ -67,7 +67,7 @@ echo " </tr>\n";
|
|||||||
echo ' <tr>';
|
echo ' <tr>';
|
||||||
echo ' <td><a href="reports.php">' . theme_icon('print/export_reports') . '<br />' . i18n('Print / Export Reports') . '</a></td>';
|
echo ' <td><a href="reports.php">' . theme_icon('print/export_reports') . '<br />' . i18n('Print / Export Reports') . '</a></td>';
|
||||||
echo ' <td><a href="reports_ceremony.php">' . theme_icon('print_awards_ceremony_scripts') . '<br />' . i18n('Print Award Ceremony Scripts') . '</a></td>';
|
echo ' <td><a href="reports_ceremony.php">' . theme_icon('print_awards_ceremony_scripts') . '<br />' . i18n('Print Award Ceremony Scripts') . '</a></td>';
|
||||||
//echo ' <td><a href="reports_editor.php">' . theme_icon('report_management') . '<br />' . i18n('Report Management') . '</a></td>';
|
echo ' <td><a href="reports_editor.php">' . theme_icon('report_management') . '<br />' . i18n('Report Management') . '</a></td>';
|
||||||
//echo ' <td><a href="translations.php">' . theme_icon('translations_management') . '<br />' . i18n('Translations Management') . '</a></td>';
|
//echo ' <td><a href="translations.php">' . theme_icon('translations_management') . '<br />' . i18n('Translations Management') . '</a></td>';
|
||||||
|
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
require_once("reports_tours.inc.php");
|
require_once("reports_tours.inc.php");
|
||||||
require_once("reports_fairs.inc.php");
|
require_once("reports_fairs.inc.php");
|
||||||
require_once("reports_fundraising.inc.php");
|
require_once("reports_fundraising.inc.php");
|
||||||
|
require_once("helper_functions.inc.php");
|
||||||
|
|
||||||
//require_once('../lpdf.php');
|
//require_once('../lpdf.php');
|
||||||
require_once('../lcsv.php');
|
require_once('../lcsv.php');
|
||||||
@ -628,6 +629,12 @@ foreach($report['col'] as $v)
|
|||||||
break;
|
break;
|
||||||
case 'pdf': case '':
|
case 'pdf': case '':
|
||||||
/* FIXME: handle landscape pages in here */
|
/* FIXME: handle landscape pages in here */
|
||||||
|
$inputs = array(
|
||||||
|
"fairname" => i18n($config['fairname']),
|
||||||
|
);
|
||||||
|
|
||||||
|
generate_pdf($_GET['id'], $inputs);
|
||||||
|
|
||||||
$label_stock = $report_stock[$report['option']['stock']];
|
$label_stock = $report_stock[$report['option']['stock']];
|
||||||
$rep=new lpdf( i18n($config['fairname']),
|
$rep=new lpdf( i18n($config['fairname']),
|
||||||
i18n($report['name']),
|
i18n($report['name']),
|
||||||
|
@ -38,7 +38,7 @@ require_once ('reports_tours.inc.php');
|
|||||||
require_once ('reports_fairs.inc.php');
|
require_once ('reports_fairs.inc.php');
|
||||||
require_once ('reports_fundraising.inc.php');
|
require_once ('reports_fundraising.inc.php');
|
||||||
require_once ('reports.inc.php');
|
require_once ('reports.inc.php');
|
||||||
require_once ('../tcpdf.inc.php');
|
// require_once ('../tcpdf.inc.php');
|
||||||
|
|
||||||
$fields = array();
|
$fields = array();
|
||||||
$locs = array('X' => 'x', 'Y' => 'y', 'W' => 'w', 'H' => 'h', 'Lines' => 'lines');
|
$locs = array('X' => 'x', 'Y' => 'y', 'W' => 'w', 'H' => 'h', 'Lines' => 'lines');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user