foreach ($PDFdata['table'][0]['data'] as $num => $rowElement) { foreach ($rowElement as $key => $cellValue) { $PDFdata['table'][0]['data'][$num][$key] = strip_tags($cellValue, $allowableTags); } } } } else { unset($PDFdata['table'][0]); } require_once ROOT_DIR . '/include/PdfClass.inc.php'; $pdf = new PdfClass('', $PDFdata['title']); $pdf->addHeader($PDFdata['title'], ROOT_DIR . '/layout/' . $userObj->template_family . '/img/header-logo.png')->addFooter(translateFN("Report") . " " . translateFN("generato") . " " . translateFN("il") . " " . date("d/m/Y") . " " . translateFN("alle") . " " . date("H:i:s")); /** * begin PDF body generation */ $pdf->ezText($PDFdata['block1'], $pdf->docFontSize); $pdf->ezText($PDFdata['block2'], $pdf->docFontSize, array('justification' => 'center')); $pdf->ezSetDy(-20); $pdf->ezImage(HTTP_ROOT_DIR . "/browsing/include/graph_pies.inc.php?nodes_percent=" . urlencode($nodes_percent), 5, 200, 'width'); $pdf->ezText($PDFdata['block3'], $pdf->docFontSize, array('justification' => 'center')); $pdf->ezSetDy(-20); if (is_array($PDFdata['table'])) { // tables output foreach ($PDFdata['table'] as $count => $PDFTable) { $pdf->ezTable($PDFTable['data'], $PDFTable['cols'], $PDFTable['title'], array('width' => $pdf->ez['pageWidth'] - $pdf->ez['leftMargin'] - $pdf->ez['rightMargin'])); if ($count < count($PDFdata['table']) - 1) { $pdf->ezSetDy(-20); } } } $pdf->saveAs($filename);