ColoredTable() public method

Print the table containing the detailed information.
public ColoredTable ( array $header, array $data )
$header array String with the column headers.
$data array Data to print.
Example #1
0
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 12);
// add a page
$pdf->AddPage();
//Column titles
$header = array('Country', 'Capital', 'Area (sq km)', 'Pop. (thousands)');
//Data loading
$data = $pdf->LoadData('../cache/table_data_demo.txt');
// print colored table
$pdf->ColoredTable($header, $data);
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_011.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
function pdfGen($group_name, $mode = NULL, $start_date, $end_date, $stats, $l, $title, $path_www)
{
    global $centreon_path;
    // create new PDF document
    $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    // set document information
    $pdf->SetCreator("PDF Reports Module");
    $pdf->SetAuthor(getGeneralOptInfo("pdfreports_report_author"));
    //$pdf->SetAuthor('Fully Automated Nagios');
    $pdfTitle = $title . " " . $group_name;
    //$pdfTitle = "Rapport de supervision du hostgroup ".$group_name;
    $pdf->SetTitle($pdfTitle);
    //$pdf->SetSubject('TCPDF Tutorial');
    //$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
    // define default header data
    $header = $title . " " . $group_name;
    //$header = "Rapport de supervision du hostgroup ".$group_name;
    //$ip = $_SERVER['HOSTNAME'];
    $startDate = date("d/m/Y", $start_date);
    $time = time();
    $endDate = date("d/m/Y", $time);
    $string = _("From") . " " . strftime("%A", $start_date) . " " . $startDate . " " . _("to") . " " . strftime("%A", $time) . " " . $endDate . "\n";
    // set default header data
    $pdf->SetHeaderData('../../../img/headers/' . getGeneralOptInfo("pdfreports_report_header_logo"), PDF_HEADER_LOGO_WIDTH, $header, $string);
    // set header and footer fonts
    $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
    $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
    // set default monospaced font
    $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
    //set margins
    $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
    $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
    $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
    //set auto page breaks
    $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
    //set image scale factor
    $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
    //set some language-dependent strings
    $pdf->setLanguageArray($l);
    // ---------------------------------------------------------
    // set font
    $pdf->SetFont('helvetica', '', 12);
    // add a page
    $pdf->AddPage();
    //Column titles
    $header = array('Status', 'Time', 'Total Time', 'Mean Time', 'Alert');
    // Pie chart Generation
    $piechart_img = pieGen($stats, $mode);
    //Data loading
    $data = $pdf->LoadData($stats);
    // print colored table
    //$pdf->ColoredTable($header, $data,$chart_img);
    if ($mode == "hgs") {
        // Hostgroup
        $pdf->ColoredTable($header, $data, $piechart_img, $path_www);
    } else {
        if ($mode == "sgs") {
            // Servicegroup
            $pdf->ServicesColoredTable($header, $data, $piechart_img, $path_www);
        }
    }
    // ---------------------------------------------------------
    //génération d'un nom de pdf
    $endDay = date("d", $time);
    $endYear = date("Y", $time);
    $endMonth = date("m", $time);
    $pdfDirName = getGeneralOptInfo("pdfreports_path_gen") . $endYear . $endMonth . $endDay . "/";
    $pdfFileName = $pdfDirName . $endYear . "-" . $endMonth . "-" . $endDay . "_" . $group_name . ".pdf";
    if (!is_dir($pdfDirName)) {
        mkdir($pdfDirName);
    }
    //Close and output PDF document
    $pdf->Output($pdfFileName, 'F');
    return $pdfFileName;
}
Example #3
0
 public function actionCreateAccount()
 {
     $params = self::accountCond();
     $select1 = "OrderSN as No,CreateTime,Payment,BuyerID,RealPrice as Price,BuyerName";
     $select2 = "ReturnNO as No,CreateTime,PayMethod as Payment,ServiceID as BuyerID,Price";
     if ($params['type'] == 1) {
         $seaCon1 = "select {$select1} from pap_order t where t.Status=9";
         $seaCon1 .= " and SellerID = {$params['OrganID']} and IsDelete = 0";
         $seaCon1 .= " and t.CreateTime>={$params['starttime']} and t.CreateTime<{$params['endtime']}";
         $seaCon1 .= " order by CreateTime DESC";
         $data1 = Yii::app()->papdb->createCommand($seaCon1)->queryAll();
         $count1 = Yii::app()->papdb->createCommand(str_replace($select1, 'sum(RealPrice)', $seaCon1))->queryScalar();
     } else {
         if ($params['type'] == 2) {
             $seaCon2 = "select {$select2} from pap_return_order t where t.Status in(4,14)";
             $seaCon2 .= " and DealerID = {$params['OrganID']}";
             $seaCon2 .= " and t.CreateTime>={$params['starttime']} and t.CreateTime<{$params['endtime']}";
             $seaCon2 .= " order by CreateTime DESC";
             $data2 = Yii::app()->papdb->createCommand($seaCon2)->queryAll();
             $count2 = Yii::app()->papdb->createCommand(str_replace($select2, 'sum(Price)', $seaCon2))->queryScalar();
         } else {
             $seaCon1 = "select {$select1} from pap_order t where t.Status=9";
             $seaCon1 .= " and SellerID = {$params['OrganID']} and IsDelete = 0";
             $seaCon1 .= " and t.CreateTime>={$params['starttime']} and t.CreateTime<{$params['endtime']}";
             $seaCon1 .= " order by CreateTime DESC";
             $data1 = Yii::app()->papdb->createCommand($seaCon1)->queryAll();
             $count1 = Yii::app()->papdb->createCommand(str_replace($select1, 'sum(RealPrice)', $seaCon1))->queryScalar();
             $seaCon2 = "select {$select2} from pap_return_order t where t.Status in(4,14)";
             $seaCon2 .= " and DealerID = {$params['OrganID']}";
             $seaCon2 .= " and t.CreateTime>={$params['starttime']} and t.CreateTime<{$params['endtime']}";
             $seaCon2 .= " order by CreateTime DESC";
             $data2 = Yii::app()->papdb->createCommand($seaCon2)->queryAll();
             $count2 = Yii::app()->papdb->createCommand(str_replace($select2, 'sum(Price)', $seaCon2))->queryScalar();
         }
     }
     $count1 = $count1 ? $count1 : 0;
     $count2 = $count2 ? $count2 : 0;
     $gain = $count1 - $count2;
     $day = date('t', $params['starttime']);
     $organ = Organ::model()->findByPk($params['OrganID'], array('select' => 'OrganName'))->attributes;
     $html = '<div style="height:24px; line-height:24px; background-color:#1f76c8">
             <div style="margin:0 auto; text-align:center">
             <span style="font-family:微软雅黑; font-size:24px; color:#fff; word-spacing:8px; letter-spacing: 1.5px;">' . $params['uyear'] . '年' . $params['umonth'] . '月对账单</span>
             </div>
         </div>
         <div style="font-size:16px; color:#343434; line-height:16px">
             <p style="margin:0px; ">亲爱的' . $organ['OrganName'] . ',您好!</p>
             <p style="margin:0px; ">感谢您使用由你配平台,以下是您' . $params['umonth'] . '月的平台交易明细:</p>
         </div>
         <div style="height:20px; line-height:18px; border-bottom:2px solid #c9c7c7; border-top:2px solid #c9c7c7; background-color:#f2f2f2; padding:0 30px">
             <div style="font-size:16px; font-weight:bold; color:#565656; line-height:18px;float:left">
                 本月净收益: <span style="color:#1f76c8">' . $gain . '</span> 元
             </div>
             <div style="font-size:16px; line-height:18px;float:right">
                 <p style="margin:0px; line-height:15px">
                 	本月总收入: <span style="color:#1f76c8;font-size:14px">' . $count1 . '</span>元
                    	&nbsp;&nbsp;
                    	本月总支出: <span style="color:#1f76c8;font-size:14px">' . $count2 . '</span>元</p>
                 <p style="margin:0px; line-height:15px">
                 	账单周期:' . $params['uyear'] . '年' . $params['umonth'] . '月01日—' . $params['uyear'] . '年' . $params['umonth'] . '月' . $day . '日
                 </p>
     </div>
     </div>';
     Yii::import('application.extensions.tcpdf.*');
     // create new PDF document
     $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // 设置文档信息
     $pdf->SetCreator('--');
     $pdf->SetAuthor('北京嘉配科技有限公司');
     $pdf->SetTitle('由你配 - 对账单');
     $pdf->SetSubject('TCPDF Tutorial');
     $pdf->SetKeywords('TCPDF, PDF, PHP');
     // 设置页眉和页脚信恿
     $pdf->SetHeaderData('', 30, '', '', array(0, 64, 255), array(0, 64, 128));
     $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
     // 设置页眉和页脚字使
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     // 设置默认等宽字体
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     // 设置间距
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     // 设置分页
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     // set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     // 设置字体
     $pdf->SetFont('stsongstdlight', '', 14, true);
     // 添加页面
     $pdf->AddPage();
     // Image example with resizing
     $pdf->Image(F::themeUrl() . '/images/jpd/logo_account.jpg', 20, 28, 30, 18, 'JPG', '', '', true, 150, '', false, false, 0, false, false, false);
     // 设置字体阴影
     //$pdf->setTextShadow(array('enabled'=>true, 'depth_w'=>0.2, 'depth_h'=>0.2, 'color'=>array(196,196,196), 'opacity'=>1, 'blend_mode'=>'Normal'));
     // 输出HTML内容
     $pdf->writeHTML($html, true, false, true, false, '');
     if (!empty($data1)) {
         $html = '<p style="color:#1f76c8">订单明细:</p>';
         $pdf->writeHTML($html, true, false, true, false, '');
         // 表格标题
         $header = array('时间', '交易类型', '修理厂名称', '订单编号', '收入(元)');
         // data loading
         $data = array();
         foreach ($data1 as $key => $val) {
             $data[$key][0] = date('Y-m-d', $val['CreateTime']);
             $data[$key][1] = $val['Payment'] == 2 ? '物流代收款' : '支付宝担保';
             if (!$val['BuyerName']) {
                 $val['BuyerName'] = Organ::model()->findByPk($val['BuyerID'], array('select' => 'OrganName'))->attributes['OrganName'];
             }
             $data[$key][2] = $val['BuyerName'];
             $data[$key][3] = $val['No'];
             $data[$key][4] = $val['Price'];
         }
         // 输出表格
         $pdf->ColoredTable($header, $data);
         //换行
         $pdf->Ln();
     }
     if (!empty($data2)) {
         $html = '<p style="color:#1f76c8;">退货明细:</p>';
         $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
         // 表格标题
         $header = array('时间', '退款方式', '修理厂名称', '退货单号', '支出(元)');
         // 导入数据
         $data = array();
         foreach ($data2 as $key => $val) {
             $data[$key][0] = date('Y-m-d', $val['CreateTime']);
             $data[$key][1] = $val['Payment'] == 1 ? '物流代收款' : '支付宝担保';
             $data[$key][2] = Organ::model()->findByPk($val['BuyerID'], array('select' => 'OrganName'))->attributes['OrganName'];
             $data[$key][3] = $val['No'];
             $data[$key][4] = $val['Price'];
         }
         // 输出表格
         $pdf->ColoredTable($header, $data);
     }
     $pdf->Output('Account.pdf', 'I');
 }
$pdf->SetAuthor($author);
$pdf->SetTitle($_SESSION['__classe__']->to_string());
// set default header data
$pdf->SetHeaderData("", 0, "Scuola Media Statale \"Arborea - Lamarmora\" - secondaria di primo grado", "Via Isonzo, 5 - Iglesias (CI)");
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', 8.0));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', 8.0));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 12);
// add a page
$pdf->AddPage("L");
//Column titles
$header = array('Ora', 'Lun', 'Mar', 'Mer');
// print colored table
$pdf->ColoredTable($header, $orario_classe, $materie, $classe, $_SESSION['__classe__']->isFullTime());
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('orario.pdf', 'D');
$pdf->SetSubject('Mastering Ext JS Book');
$pdf->SetHeaderData(PDF_HEADER_LOGO, 80, 'SYSLOG VIEWER', 'Relatório Gerado: ' . $date . ' usuário: ' . $_SESSION['username'], array(0, 64, 255), array(0, 64, 128));
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
//$pdf->SetMargins(PDF_MARGIN_LEFT, 10, PDF_MARGIN_RIGHT);
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(20);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 10);
// add a page
$pdf->AddPage();
//Column titles
$header = array('ID', 'DeviceReportedTime', 'SysLogTag', 'Priority', 'FromHost', 'Message');
// print colored table
$pdf->ColoredTable($header, $result);
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('log_pdf.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
Example #6
0
if (count($projects) > 0) {
    $label = $kga['lang']['project'] . ': ';
    $labelWidth = $pdf->GetStringWidth($label);
    $pdf->cell($labelWidth, 6, $label);
    $pdf->cell($labelWidth, 6, implode(', ', $projects));
    $pdf->ln();
}
$firstRun = true;
foreach ($orderedExportData as $customer) {
    // process each customer in first dimension
    if ($firstRun) {
        $firstRun = false;
    } else {
        if (isset($_REQUEST['customer_new_page'])) {
            $pdf->AddPage();
        }
    }
    $pdf->ln();
    $pdf->WriteHtml('<h3>' . $kga['lang']['export_extension']['full_list'] . '</h3>');
    $pdf->ln();
    $project_ids = array_keys($customer);
    foreach ($project_ids as $project_id) {
        // process each project in second dimension
        $pdf->ColoredTable(array($kga['lang']['datum'], $kga['lang']['activity'], $kga['lang']['export_extension']['duration'], $kga['lang']['export_extension']['costs']), $customer[$project_id]);
        $pdf->ln();
        $pdf->ln();
        $pdf->ln();
    }
}
$pdf->Output('invoice_' . date('Y-m-d_H-i-s', $pdf->print_time) . '.pdf', isset($_REQUEST['download_pdf']) ? 'D' : 'I');
// D=Download I=Eingebunden
 public function generarMYPDF($atributosReceta, $labelCabecera, $labelDetalle, $labelPie, $datosCabecera, $datosDetalle, $datosPie, $modo, $nombreReceta, $parametros)
 {
     /* =======================================        Obs       ============================================ */
     // width->0, height->1, top->2, left->3, color->4 TipoLetra=>5 EstiloLetra=>6 TamañoLetra=>6
     /* ===================================================================================================== */
     $lblCabecera = array();
     $lblDetalle = array();
     $lblPie = array();
     $styleCL = array();
     $styleCD = array();
     $styleDL = array();
     $styleDD = array();
     $stylePL = array();
     $stylePD = array();
     $o_classGeneral = new classGeneral();
     $o_classGeneral->setLabelCabecera($labelCabecera, $atributosReceta);
     $styleCL = $o_classGeneral->getStyleCL();
     $styleCD = $o_classGeneral->getStyleCD();
     $lblCabecera = $o_classGeneral->getLblCabecera();
     $o_classGeneral->setLabelDetalle($labelDetalle, $atributosReceta);
     $styleDL = $o_classGeneral->getStyleDL();
     $styleDD = $o_classGeneral->getStyleDD();
     $lblDetalle = $o_classGeneral->getLblDetalle();
     $o_classGeneral->setLabelPie($labelPie, $atributosReceta);
     $stylePL = $o_classGeneral->getStylePL();
     $stylePD = $o_classGeneral->getStylePD();
     $lblPie = $o_classGeneral->getLblPie();
     /* ====================================================================================================== */
     // create new PDF document  //PDF_PAGE_ORIENTATION(P,L)
     $pdf = new MYPDF($parametros["PDF_PAGE_ORIENTATION"], PDF_UNIT, $parametros["PDF_PAGE_FORMAT"], true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Juan Carlos Ludeña Montesinos');
     $pdf->SetTitle('Generardor de Reportes');
     $pdf->SetSubject('Generardor de Reportes');
     //$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
     // set default header data
     //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 011', PDF_HEADER_STRING);
     // set header and footer fonts
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     // remove default header/footer
     $pdf->setPrintHeader($parametros["PRINT_HEADER"]);
     $pdf->setPrintFooter($parametros["PRINT_FOOTER"]);
     //set margins
     $pdf->SetMargins($parametros["PDF_MARGIN_LEFT"], $parametros["PDF_MARGIN_TOP"], $parametros["PDF_MARGIN_RIGHT"]);
     $pdf->SetHeaderMargin($parametros["PDF_MARGIN_HEADER"]);
     $pdf->SetFooterMargin($parametros["PDF_MARGIN_FOOTER"]);
     //set auto page breaks
     $pdf->SetAutoPageBreak($parametros["AUTO_PAGE_BREAK"], $parametros["PDF_MARGIN_BOTTOM"]);
     //set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     //set some language-dependent strings
     //$pdf->setLanguageArray($l);
     // ---------------------------------------------------------
     // set font
     $pdf->SetFont('helvetica', '', 6);
     // add a page
     $pdf->AddPage();
     //Data loading
     // print colored table
     $pdf->ColoredTable($lblCabecera, $lblDetalle, $lblPie, $datosCabecera, $datosDetalle, $datosPie, $styleCL, $styleDL, $stylePL, $styleCD, $styleDD, $stylePD, $modo);
     $pdf->lastPage();
     // ---------------------------------------------------------
     //Close and output PDF document
     $pdf->Output($nombreReceta, 'I');
     //$pdf->extractCSSproperties();
     //============================================================+
     // END OF FILE
     //============================================================+
 }
$pdf->SetAuthor($author);
$pdf->SetTitle('Orario personale');
// set default header data
$pdf->SetHeaderData("", 0, "Scuola Media Statale \"Arborea - Lamarmora\" - secondaria di primo grado", "Via Isonzo, 5 - Iglesias (CI)");
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', 8.0));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', 8.0));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 12);
// add a page
$pdf->AddPage("L");
//Column titles
$header = array('Ora', 'Lun', 'Mar', 'Mer');
// print colored table
$pdf->ColoredTable($header, $schedule, $classi);
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('orario.pdf', 'D');
Example #9
0
$projects = array();
foreach ($filterPct as $pct_id) {
    $project_info = pct_get_data($pct_id);
    $projects[] = $project_info['pct_name'];
}
if (count($projects) > 0) {
    $pdf->cell(20, 6, $kga['lang']['pct'] . ':');
    $pdf->cell(20, 6, implode(', ', $projects));
    $pdf->ln();
}
if (isset($_REQUEST['customer_new_page'])) {
    $firstRun = true;
    foreach ($knd_arr_data as $arr_data) {
        if ($firstRun) {
            $firstRun = false;
        } else {
            $pdf->AddPage();
        }
        $pdf->ln();
        $pdf->WriteHtml('<h3>' . $kga['lang']['xp_ext']['full_list'] . '</h3>');
        $pdf->ln();
        $pdf->ColoredTable(array($kga['lang']['datum'], $kga['lang']['evt'], $kga['lang']['xp_ext']['duration'], $kga['lang']['xp_ext']['costs']), $arr_data);
    }
} else {
    $pdf->ln();
    $pdf->WriteHtml('<h3>' . $kga['lang']['xp_ext']['full_list'] . '</h3>');
    $pdf->ln();
    $pdf->ColoredTable(array($kga['lang']['datum'], $kga['lang']['evt'], $kga['lang']['xp_ext']['duration'], $kga['lang']['xp_ext']['costs']), $arr_data);
}
$pdf->Output('invoice_' . date('Y-m-d_H-i-s', $pdf->print_time) . '.pdf', isset($_REQUEST['download_pdf']) ? 'D' : 'I');
// D=Download I=Eingebunden