/** * PDF Setup - WT_Report_PDF */ function setup() { parent::setup(); // Setup the PDF class with custom size pages because WT supports more page sizes. If WT sends an unknown size name then the default would be A4 $this->pdf = new PDF($this->orientation, parent::unit, array($this->pagew, $this->pageh), self::unicode, "UTF-8", self::diskcache); // Setup the PDF margins $this->pdf->setMargins($this->leftmargin, $this->topmargin, $this->rightmargin); $this->pdf->SetHeaderMargin($this->headermargin); $this->pdf->SetFooterMargin($this->footermargin); //Set auto page breaks $this->pdf->SetAutoPageBreak(true, $this->bottommargin); // Set font subsetting $this->pdf->setFontSubsetting(self::subsetting); // Setup PDF compression $this->pdf->SetCompression(self::compression); // Setup RTL support $this->pdf->setRTL($this->rtl); // Set the document information // Only admin should see the version number $appversion = WT_WEBTREES; if (Auth::isAdmin()) { $appversion .= " " . WT_VERSION; } $this->pdf->SetCreator($appversion . " (" . parent::wt_url . ")"); // Not implemented yet - WT_Report_Base::setup() $this->pdf->SetAuthor($this->rauthor); $this->pdf->SetTitle($this->title); $this->pdf->SetSubject($this->rsubject); $this->pdf->SetKeywords($this->rkeywords); $this->pdf->setReport($this); if ($this->showGenText) { // The default style name for Generated by.... is 'genby' $element = new CellPDF(0, 10, 0, "C", "", "genby", 1, ".", ".", 0, 0, "", "", true); $element->addText($this->generatedby); $element->setUrl(parent::wt_url); $this->pdf->addFooter($element); } }
public static function saveDocument($dataObject, $path, $fileName) { if (file_exists($path . $fileName)) { unlink($path . $fileName); } try { /*Document*/ $data = Builder::buildDocument($dataObject); if ($data == null) { throw new Exception("Can't build document based on " . get_class($dataObject)); } if ($data->metadata != null) { /*Property*/ $pageSizeProperty = $data->metadata->getPropertyByName(Property::$PAGE_FORMAT); if ($pageSizeProperty != null) { if ($pageSizeProperty->value == Property::$PAGE_FORMAT_A4) { $data->width = Document::$pageFormats['a4'][0]; $data->height = Document::$pageFormats['a4'][1]; } else { if ($pageSizeProperty->value == Property::$PAGE_FORMAT_A4_ALBUM) { $data->width = Document::$pageFormats['a4'][1]; $data->height = Document::$pageFormats['a4'][0]; } } } } $pdfwr = null; Log::log(LoggingConstants::MYDEBUG, "PDF: create file"); if (!is_numeric($data->width)) { $pdfwr = new PDF("P", "pt", $data->width); } else { $pdfwr = new PDF("P", "pt", array($data->width, $data->height)); } $pdfwr->SetAutoPageBreak(false); //, abs($data->marginBottom)); $data->write($pdfwr); Log::log(LoggingConstants::MYDEBUG, "WRITE FINISHED"); $pdfwr->Output($path . $fileName, "F"); } catch (Exception $exception) { Log::log(LoggingConstants::MYDEBUG, $exception->getMessage() . "\n" . $exception->getTrace()); throw $exception; } // fwrite($fileHandler, $buf); // fclose($fileHandler); }
protected function initPDF() { $pdf = new PDF('P', 'mm', 'A4', _CHARSET_ == 'UTF-8', _CHARSET_, false); $pdf->AddPage(); $pdf->SetAutoPageBreak(FALSE); $pdf->footerLeft = $this->senderAddressLine; $pdf->footerCenter = $this->senderContactInfo; $pdf->footerRight = $this->senderData['www'] . "\n" . $this->senderData['email']; $this->pdf = $pdf; }
private function printHeader($format, $printFields, $startDate, $endDate) { if ($format == 'pdf' || $format == 'pdfl') { ob_end_clean(); $pdf = new PDF($format == 'pdf' ? 'P' : 'L', 'mm', 'A4', _CHARSET_ == 'UTF-8', _CHARSET_, false); $pdf->setTopMargin(20); $pdf->headerRight = $GLOBALS['locReportPage']; $pdf->printHeaderOnFirstPage = true; $pdf->AddPage(); $pdf->SetAutoPageBreak(TRUE, 15); $pdf->setY(10); $pdf->SetFont('Helvetica', 'B', 12); $pdf->Cell(100, 15, $GLOBALS['locInvoiceReport'], 0, 1, 'L'); if ($startDate || $endDate) { $pdf->SetFont('Helvetica', '', 8); $pdf->Cell(25, 15, $GLOBALS['locDateInterval'], 0, 0, 'L'); $pdf->Cell(50, 15, dateConvDBDate2Date($startDate) . ' - ' . dateConvDBDate2Date($endDate), 0, 1, 'L'); } $pdf->SetFont('Helvetica', 'B', 8); if (in_array('invoice_no', $printFields)) { $pdf->Cell(18, 4, $GLOBALS['locInvoiceNumber'], 0, 0, 'L'); } if (in_array('invoice_date', $printFields)) { $pdf->Cell(20, 4, $GLOBALS['locInvDate'], 0, 0, 'L'); } if (in_array('due_date', $printFields)) { $pdf->Cell(20, 4, $GLOBALS['locDueDate'], 0, 0, 'L'); } if (in_array('payment_date', $printFields)) { $pdf->Cell(20, 4, $GLOBALS['locPaymentDate'], 0, 0, 'L'); } if (in_array('company_name', $printFields)) { $pdf->Cell(45, 4, $GLOBALS['locPayer'], 0, 0, 'L'); } if (in_array('status', $printFields)) { $pdf->Cell(20, 4, $GLOBALS['locInvoiceState'], 0, 0, 'L'); } if (in_array('ref_number', $printFields)) { $pdf->Cell(25, 4, $GLOBALS['locReferenceNumber'], 0, 0, 'L'); } if (in_array('sums', $printFields)) { $pdf->Cell(25, 4, $GLOBALS['locVATLess'], 0, 0, 'R'); $pdf->Cell(25, 4, $GLOBALS['locVATPart'], 0, 0, 'R'); $pdf->Cell(25, 4, $GLOBALS['locWithVAT'], 0, 1, 'R'); } $this->pdf = $pdf; return; } ?> <div class="report"> <table> <tr> <?php if (in_array('invoice_no', $printFields)) { ?> <th class="label"> <?php echo $GLOBALS['locInvoiceNumber']; ?> </th> <?php } if (in_array('invoice_date', $printFields)) { ?> <th class="label"> <?php echo $GLOBALS['locInvDate']; ?> </th> <?php } if (in_array('due_date', $printFields)) { ?> <th class="label"> <?php echo $GLOBALS['locDueDate']; ?> </th> <?php } if (in_array('payment_date', $printFields)) { ?> <th class="label"> <?php echo $GLOBALS['locPaymentDate']; ?> </th> <?php } if (in_array('company_name', $printFields)) { ?> <th class="label"> <?php echo $GLOBALS['locPayer']; ?> </th> <?php } if (in_array('status', $printFields)) { ?> <th class="label"> <?php echo $GLOBALS['locInvoiceState']; ?> </th> <?php } if (in_array('ref_number', $printFields)) { ?> <th class="label"> <?php echo $GLOBALS['locReferenceNumber']; ?> </th> <?php } if (in_array('sums', $printFields)) { ?> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locVATLess']; ?> </th> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locVATPart']; ?> </th> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locWithVAT']; ?> </th> <?php } ?> </tr> <?php }
protected function printHeader($format) { if ($format == 'pdf') { ob_end_clean(); $pdf = new PDF('P', 'mm', 'A4', _CHARSET_ == 'UTF-8', _CHARSET_, false); $pdf->setTopMargin(20); $pdf->headerRight = $GLOBALS['locReportPage']; $pdf->printHeaderOnFirstPage = true; $pdf->AddPage(); $pdf->SetAutoPageBreak(TRUE, 15); $pdf->setY(10); $pdf->SetFont('Helvetica', 'B', 12); $pdf->Cell(100, 5, $GLOBALS['locProductStockReport'], 0, 1, 'L'); $pdf->SetFont('Helvetica', 'B', 8); $pdf->Cell(50, 10, date($GLOBALS['locDateFormat']), 0, 1, 'L'); $pdf->Cell(15, 4, $GLOBALS['locCode'], 0, 0, 'L'); $pdf->Cell(40, 4, $GLOBALS['locProduct'], 0, 0, 'L'); $pdf->Cell(25, 4, $GLOBALS['locUnitPrice'], 0, 0, 'R'); $pdf->Cell(25, 4, $GLOBALS['locPurchasePrice'], 0, 0, 'R'); $pdf->Cell(25, 4, $GLOBALS['locStockBalance'], 0, 0, 'R'); $pdf->Cell(25, 4, $GLOBALS['locStockValue'], 0, 1, 'R'); $this->pdf = $pdf; return; } ?> <div class="report"> <table> <tr> <th class="label"> <?php echo $GLOBALS['locCode']; ?> </th> <th class="label"> <?php echo $GLOBALS['locProduct']; ?> </th> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locUnitPrice']; ?> </th> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locPurchasePrice']; ?> </th> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locStockBalance']; ?> </th> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locStockValue']; ?> </th> </tr> <?php }
/** * Show header of page for PDF generation * * @param PDF $pdf Object PDF * @param Translate $outputlangs Object lang for output * @param int $page_height Height of page * @return void */ function pdf_pagehead(&$pdf, $outputlangs, $page_height) { global $conf; // Add a background image on document if (!empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF)) { $pdf->SetAutoPageBreak(0, 0); // Disable auto pagebreak before adding image $pdf->Image($conf->mycompany->dir_output . '/logos/' . $conf->global->MAIN_USE_BACKGROUND_ON_PDF, isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_X) ? $conf->global->MAIN_USE_BACKGROUND_ON_PDF_X : 0, isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y) ? $conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y : 0, 0, $page_height); $pdf->SetAutoPageBreak(1, 0); // Restore pagebreak } }
for ($x = 1; $x < $this->label_per_width; $x++) { $xpos = $x * $this->label_width; $this->Line($xpos, $ystart, $xpos, $yend); } } //Page footer function Footer() { } } $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('J&G Package Labels'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('k-Auto Generated PDF'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(false, 1); $pdf->left_margin = 2; $pdf->top_margin = 2; $pdf->page_width = 210; $pdf->page_height = 297; $pdf->label_per_width = 1; $pdf->label_width = ($pdf->page_width - 2 * $pdf->left_margin) / $pdf->label_per_width; $pdf->label_per_height = 5; $pdf->label_height = ($pdf->page_height - 2 * $pdf->top_margin) / $pdf->label_per_height; $pdf->label_per_page = $pdf->label_per_width * $pdf->label_per_height; $order_counter = 0; //$labelpad = 4; $labelxpad = 55; $labelypad = 4; $labelxpos = 1; $labelypos = 1;
$top = 28; $c1x = 13; $c2x = $c1x + $w; $c3x = $c2x + $w; $c4x = $c3x + $w; $c1h = 170; $c2h = $c1h / 2; $c3h = $c2h / 2; $c4h = $c3h / 2; $bottom = $top + $c1h; $pdf = new PDF('L', 'mm', 'Letter'); $pdf->Open(); $pdf->SetTopMargin(13); $pdf->SetLeftMargin(13); $pdf->SetRightMargin(10); $pdf->SetAutoPageBreak(True, 13); $pdf->AddPage(); $pdf->SetCreator($_SERVER["PHP_SELF"]); $pdf->SetAuthor("Keith Morrison, keithm@infused.org"); $pdf->SetTitle(sprintf(gtc("Pedigree for %s"), $o->full_name())); $pdf->SetSubject(gtc("Genealogy")); # Person 1 $pdf->SetY($top); $pdf->SetX($c1x); $pdf->Cell($w, $c1h, '', 1, 0, 'L'); $pdf->SetY($top + $c1h / 2 - 6); $pdf->SetX($c1x); $pdf->SetFont($font, 'B', 10); $pdf->MultiCell($w, 4, isset($g_node_strings[1][0]) ? $g_node_strings[1][0] : '', 0, 'L'); $pdf->SetFont($font, '', 10); $pdf->Cell($w, 4, isset($g_node_strings[1][1]) ? $g_node_strings[1][1] : '', 0, 2, 'L');
//$this->Image('assets/images/logo.jpg', 30, 5,80,11.2); $this->Ln(7); $this->SetFont('Arial', 'B', 17); $this->Cell(128, 7, 'KARTU ORDER', 0, 0, 'C'); $this->Ln(7); } } require_once './assets/qrcode/qrcode.php'; // definisi class $pdf = new PDF('P', 'mm', 'A5'); // A% = 148 x 210 // variable awal date_default_timezone_set('Asia/Jakarta'); $pdf->SetMargins(10, 5, 10); //$pdf->AliasNbPages(); $pdf->SetAutoPageBreak('on', 0); //margin bottom set to 0 //$pdf->SetLineWidth(0.5); function tgl($date) { setlocale(LC_TIME, 'INDONESIAN'); $st = strftime("%d/%m/%Y", strtotime($date)); //return strtoupper($st); return $st; } function baking($data) { if ($data == 1) { return 'BAKING'; } }
$ln .= $per->getDisplayName(); //add spouse $ln .= get_spouse_string($per); // -------------------------------------------------- // echo "<br>\n"; //$albero=$ln; $albero = make_Descendants($per); // viewarray($albero); // echo $albero[131]; // exit; set_time_limit(0); $pdf = new PDF(); $pdf->Open(); $pdf->Title = $strDescendants . " {$strOf} " . $per->getDisplayName(); $pdf->aliasNbPages(); $pdf->SetAutoPageBreak('true', '10'); $pdf->AddPage(); $pdf->SetFont('Arial', 'B', 15); // Move to the right $pdf->Cell(80); // Title $pdf->Cell(30, 10, $pdf->Title, 0, 0, 'C'); // Line break $pdf->Ln(2); $pdf->SetY(10 + $pdf->tMargin); $pdf->SetX($pdf->lMargin); // $pdf->SetY($pdf->tMargin); // $pdf->SetX($pdf->lMargin); $pdf->SetFont('Arial', '', 10); $vspacing = 1; if (is_array($albero)) {
function exportDo($scope, $query, $pid) { session_cache_limiter('private'); session_start(); if (!t3lib_extMgm::isLoaded('fpdf')) { return "fpdf library not loaded!"; } $i = 0; $ii = 0; $i = 0; $p = 1; $x = 0; $y = 0; $z = 0; $zz = 0; $keyArray = array(); $submittedfieldsArray = array(); $resultArray = array(); $screen = t3lib_div::_GP("screen"); $fields = t3lib_div::_GP("fields"); $choices = t3lib_div::_GP("choices"); $lextra = t3lib_div::_GP("lextra"); //echo $choices; $chosenFieldsArray = explode(",", $fields); array_unshift($chosenFieldsArray, 'date'); array_unshift($chosenFieldsArray, 'ok'); //if($type=="mailformplus") { if ($pidList) { $where = " WHERE pid IN({$pidList})"; } else { $where = " WHERE pid=" . intval($pageId); } // $res = $GLOBALS["TYPO3_DB"]->exec_SELECTquery("uid, submittedfields", "tx_thmailformplus_log", $where, "", "", "") or die("723: ".mysql_error()); $sql = "SELECT uid, params, 'formhandler' AS log_type, FROM_UNIXTIME(crdate,'%Y-%m-%d') AS logdate, ok "; $sql .= "FROM tx_formhandler_log {$where}"; $sql .= " UNION "; $sql .= "SELECT uid, submittedfields AS params, 'mailformplus' AS log_type, FROM_UNIXTIME(logdate,'%Y-%m-%d'), ok "; $sql .= "FROM tx_thmailformplus_log {$where}"; $sql .= " ORDER BY logdate DESC"; //die($sql); $res = $GLOBALS['TYPO3_DB']->sql_query($sql); while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $log_type = $row["log_type"]; $logdate = $row["logdate"]; $params = $row["params"]; $uid = $row["uid"]; $ok = $row["ok"]; if ($log_type == "mailformplus") { $params = $this->convert_mailformplusdata($params); } $paramsArray = unserialize($params); /*print "<pre>"; print_r($paramsArray); print "</pre>";*/ unset($paramsArray['randomID']); unset($paramsArray['removeFile']); unset($paramsArray['removeFileField']); unset($paramsArray['step-2-next']); unset($paramsArray['submitField']); unset($paramsArray['submitted']); unset($paramsArray['id']); unset($paramsArray['submitted']); unset($paramsArray['L']); //Add date // $paramsArray['date'] = $logdate; //array_unshift( $paramsArray, '[date]=>'.$logdate ); $paramsArray = array_merge(array("date" => $logdate), $paramsArray); $paramsArray = array_merge(array("ok" => $ok), $paramsArray); array_push($resultArray, $paramsArray); } /* print '<pre>'; print_r($resultArray); print '</pre>'; die();*/ /* while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $i=0; $uid = $row["uid"]; $pid = $row["pid"]; $submittedfields = $row["submittedfields"]; $submittedfields = preg_replace("/~/", ";~", $submittedfields, 1); $logdate = $row["logdate"]; $downloaded = $row["downloaded"]; $submittedfields = str_replace("\ntest;", "", $submittedfields); $submittedfields = str_replace("test;", "", $submittedfields); $submittedfields = str_replace("~", "", $submittedfields); $submittedfieldsArray = explode(";", $submittedfields); $addVar = count($submittedfieldsArray) / 2; for($i == 0; $i < $addVar; $i++) { $myArray[$ii][$submittedfieldsArray[$i]] = $submittedfieldsArray[$i+$addVar]; } $ii++; } } else { $res = $GLOBALS["TYPO3_DB"]->exec_SELECTquery("field_name, field_value, email_uid", "tx_pksaveformmail_fields", "pid=" . intval($pageId), "", "", "") or die("884: ".mysql_error()); while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $uid = $row["uid"]; $pid = $row["pid"]; $crdate = $row["crdate"]; $email_uid = $row["email_uid"]; $field_name = $row["field_name"]; $field_value = $row["field_value"]; $myArray[$email_uid][$field_name] = $field_value; } }*/ $GLOBALS["TYPO3_DB"]->sql_free_result($res); switch ($choices) { case "cblPdfList": $pdf = new PDF(); $pdf->AddPage("L", "A4"); $pdf->SetAutoPageBreak(false); if ($lextra) { $pdf->SetFont('Helvetica', 'B', 14); $pdf->Cell(300, 10, $lextra, 0, 1, C, 0); $pdf->Ln(2); } $pdf->SetMargins(10, 10); $pdf->SetFont('Helvetica', '', 9); break; case "cblLabels": $pdf = new PDF(); $pdf->AddPage("P", "A4"); $pdf->SetMargins(0, 0); $pdf->SetAutoPageBreak(false); $pdf->SetFont('Helvetica', '', 9); break; } $antalPoster = count($resultArray); /*print "<pre>"; print_r($resultArray); print "</pre>"; die();*/ ksort($resultArray); ksort($chosenFieldsArray); foreach ($resultArray as $key => $value) { $zz++; foreach ($chosenFieldsArray as $key1 => $value1) { switch ($choices) { case "cblPdfList": $pdf->SetMargins(10, 10); //Ny rad if ($key != $old_key and $z > 0) { $pdf->Ln(6); $y++; //rubriker } elseif ($z == 0) { foreach ($chosenFieldsArray as $key2 => $value2) { $pdf->SetFont('Helvetica', 'B', 10); if ($key2 == 'date') { $pdf->Cell(20, 6, $value2, 1, 0, L, 0); } else { $pdf->Cell(50, 6, $value2, 1, 0, L, 0); } } $pdf->Ln(6); $y++; $pdf->SetFont('Helvetica', '', 9); } //Ny sida if ($y == 28) { $pdf->Cell(300, 20, $p, 0, 1, C, 0); $pdf->AddPage("L", "A4"); if ($lextra) { $pdf->SetFont('Helvetica', 'B', 14); $pdf->Cell(300, 15, $lextra, 0, 1, C, 0); $pdf->Ln(2); } $y = 0; $p++; } //L�gg in v�rdet if ($key1 == 'date') { $pdf->Cell(20, 6, utf8_decode($value[$value1]), 1, 0, L, 0); } else { $pdf->Cell(50, 6, utf8_decode($value[$value1]), 1, 0, L, 0); } break; case "cblTabSep": if ($z == 0) { foreach ($chosenFieldsArray as $key2 => $value2) { if ($s) { $s .= "\t"; } $s .= '"' . $value2 . '"'; } $s .= "\r\n"; $expContent .= $s; $s = ""; } //if($z==0) $s .= if ($s) { $s .= "\t"; } $s .= '"' . utf8_decode($value[$value1]) . '"'; break; case "cblKommaSep": if ($z == 0) { foreach ($chosenFieldsArray as $key2 => $value2) { if ($s) { $s .= ","; } $s .= '"' . $value2 . '"'; } $s .= "\r\n"; $expContent .= $s; $s = ""; } if ($s) { $s .= ","; } $s .= '"' . utf8_decode($value[$value1]) . '"'; break; case "cblCsv": if ($z == 0) { $s .= $this->getHeaders($chosenFieldsArray, ';'); $s .= "\r\n"; } if ($s) { $s .= ";"; } $s .= '"' . utf8_decode($value[$value1]) . '"'; //preg_replace('/\n/', ';', $params, 1); break; case "cblLabels": if ($s) { $s .= "\n"; } $s .= $value[$value1]; break; } $old_key = $key; $z++; } //Ny rad switch ($choices) { case "cblTabSep": if (substr($s, -2) == "\t") { $s = substr($s, 0, strlen($s) - 2); } $s .= "\r\n"; $expContent .= $s; $s = ""; break; case "cblKommaSep": if (substr($s, -1) == ",") { $s = substr($s, 0, strlen($s) - 1); } $s .= "\r\n"; $expContent .= $s; $s = ""; break; case "cblCsv": if (substr($s, -1) == ";") { $s = substr($s, 0, strlen($s) - 1); } $s .= "\r\n"; $expContent .= $s; $s = ""; break; case "cblLabels": //Ny etikett if ($lextra) { $s .= "{$lextra}\n"; } if (substr($s, -2) == "\n") { $s = substr($s, 0, strlen($s) - 2); } $this->Avery7160($x, $y, $pdf, $s); $x++; //$y++; if ($x == 3) { $x = 0; $y++; } if ($y == 7) { $y = 0; $pdf->AddPage(); } $s = ""; break; } } ////////////////// switch ($choices) { case "cblPdfList": $i++; $pdf->SetY(-15); $pdf->Cell(300, 15, $p, 0, 1, C, 0); $pdf->Output(); break; case "cblTabSep": header("Cache-Control: pre-check=0, post-check=0, max-age=0"); header("Content-type: text/plain;"); header("Content-disposition: attachment; filename=mailform_" . time() . ".txt"); print $expContent; break; case "cblKommaSep": header("Cache-Control: pre-check=0, post-check=0, max-age=0"); header("Content-type: text/plain;"); header("Content-disposition: attachment; filename=mailform_" . time() . ".txt"); print $expContent; break; case "cblCsv": header("Cache-Control: pre-check=0, post-check=0, max-age=0"); header("Content-type: application/vnd.ms-excel; "); header("Content-disposition: attachment; filename=mailform_" . time() . ".csv"); print $expContent; break; case "cblLabels": $pdf->Output(); break; } exit; }
$this->Cell($txtAncho, 5, utf8_decode($txt), $borde, 0, $align, $relleno); } function Fuente($tipo = "B", $tam = 10) { $this->SetFillColor(234, 234, 234); $this->SetFont("Arial", $tipo, $tam); } function CuadroCuerpoMulti($txtAncho, $txt, $relleno = 0, $align = "L", $borde = 1, $tam = 9, $tipo = "") { $this->Fuente($tipo, $tam); $this->MultiCell($txtAncho, 3.5, utf8_decode($txt), $borde, $align, $relleno); } } $borde = 0; $pdf = new PDF("P", "mm", array(298, 208)); $pdf->SetAutoPageBreak(0, 0); $pdf->Fuente(""); $pdf->AddPage(); $x = 0; $TipoDoc = "Archivo"; $pdf->SetXY($x + 25, 35); $pdf->CuadroCuerpo(30, $TipoDoc, 0, "L", $borde, 11); $pdf->SetXY($x + 70, 5); $pdf->CuadroCuerpo(60, "Dr(a). " . mayuscula($med['Nombres'] . " " . $med['Paterno'] . " " . $med['Materno']), 0, "L", $borde, 10); $pdf->SetXY($x + 80, 10); $pdf->CuadroCuerpo(60, $opt['CodOptica'] . " - " . $opt['NumeroBoleta'], 0, "C", $borde, 10); $pdf->SetXY($x + 108, 40); $pdf->CuadroCuerpo(30, fecha2Str($opt['FechaEmitido']), 0, "C", $borde, 11); $pdf->SetXY($x + 108, 43); $pdf->CuadroCuerpo(30, $opt['HoraEmitido'], 0, "C", $borde, 10); $pdf->SetXY($x + 25, 47);
function getBpartner($accounts_id) { global $xoopsDB, $defaultorganization_id, $tableaccounts, $tablebpartner; $retval = ""; $sql = "select * from {$tablebpartner} where accounts_id = {$accounts_id} "; $query = $xoopsDB->query($sql); if ($row = $xoopsDB->fetchArray($query)) { $retval = $row['bpartner_name']; } return $retval; } if (isset($_POST["submit"])) { $wherestr = ""; $pdf = new PDF('P', 'mm', 'A4'); $pdf->AliasNbPages(); $pdf->SetAutoPageBreak(true, 17); $pdf->datefrom = $_POST['datefrom']; $pdf->dateto = $_POST['dateto']; $pdf->accounts_codefrom = getAccountsID($_POST['accounts_codefrom']); $pdf->accounts_codeto = getAccountsID($_POST['accounts_codeto']); if ($pdf->datefrom == "") { $pdf->datefrom = "0000-00-00"; } if ($pdf->dateto == "") { $pdf->dateto = "9999-12-31"; } if ($pdf->accounts_codefrom == "") { $pdf->accounts_codefrom = "0000000"; } if ($pdf->accounts_codeto == "") { $pdf->accounts_codeto = "9999999";
function createPDF($ignoreStockStatusDepot = false, $output = 'D', $add_to_daily_statistic = false, $print_per_orders = true) { /* OUTPUT : D -> WILL PRODUCE ONE PDF FOR ALL ORDERS WITH ITEMS IN IT OUTPUT : F -> WILL PRODUCE MULTI PDF PER ORDER ITEMS */ global $class_jo, $class_o, $class_do; $pi_printed_jg = array(); $pi_printed_sp = array(); $pi_printed_dp = array(); if ($output == 'D') { //PRODUCE SINGLE PDF FILE $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('Production Instruction'); $pdf->SetAuthor('JULIE GRACE / Bonofactum'); $pdf->SetCreator('k-Auto Generated PDF'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(false); $pdf->AliasNbPages(); $pdf->SetFillColor(191, 191, 191); } $item_printed = 0; $oiid_last_printed = ''; /* Moved this on function constructPIContent and replace using below $print_per_orders, * so eventhough we use $output='F' we still could create pi which consists of collection of orders */ //foreach($this->orders as $order) { // $o = $order['detail']; // foreach($order['items'] as $oiid=>$i) { // if($i['status']<8) $this->pi_printed[strtolower($o['type'])][] = $oiid; // //if($i['status']<8) ${'pi_printed_'.strtolower($o['type'])}[] = $oiid; // $this->constructPIContent($pdf, $output, $order, $oiid, $ignoreStockStatusDepot, $print_per_orders); // $item_printed++; // $oiid_last_printed = $oiid; // } //} if ($print_per_orders) { foreach ($this->orders as $order) { $this->constructPIContent($pdf, $output, $order, $ignoreStockStatusDepot, true); $item_printed++; } } else { $this->constructPIContent($pdf, $output, $this->orders, $ignoreStockStatusDepot, false); } #PI Print Counter if (count($this->pi_printed['sp']) > 0) { $class_jo->printCountAdd($this->pi_printed['sp']); } if (count($this->pi_printed['jg']) > 0) { $class_o->printCountAdd($this->pi_printed['jg']); } if (count($this->pi_printed['dp']) > 0) { $class_do->printCountAdd($this->pi_printed['dp']); } /* D: Download; F: Save File on Server */ if ($output == 'D') { $infix = ''; //$infix = count($this->orders)>1 ? '' : strtoupper($o['type']).'O'.$o['id'].'-'; //if($item_printed==1) $infix = strtoupper($o['type']).'-'.$oiid_last_printed.'-'; if ($item_printed == 1) { $infix = array_keys($this->orders); $infix = $infix[0] . '-'; } $filename = 'PI-' . $infix . date('YmdHi'); $pdf->Output($filename . '.pdf', $output); //$pdf->Output($filename.'.pdf','D'); } if ($add_to_daily_statistic) { $pt = new production_target(); $timestamp = date('Y-m-d H:i:s'); if ($this->qty_total_first_printed > 0) { $pt->addDataToField($timestamp, 'start', $this->qty_total_first_printed); } } }
} function Footer() { $timestamp = date("d/m/y H:i:s", time()); //Position at 1.5 cm from bottom $this->SetY($this->pagefooterheight * -1); //Arial italic 8 $this->SetFont('courier', 'I', 8); $this->Cell(0, 5, 'Page ' . $this->PageNo() . '/{nb} Generated dated ' . $timestamp, 0, 0, 'C'); } } if (isset($_POST["submit"])) { $wherestr = ""; $pdf = new PDF('P', 'mm', 'A4'); $pdf->AliasNbPages(); $pdf->SetAutoPageBreak(true, $pdf->pagefooterheight + 1); $organization_id = $_REQUEST['organization_id']; $org->fetchOrganization($organization_id); $companyno = $org->companyno; $orgname = $org->organization_name; $organization_code = $org->organization_code; $pdf->datefrom = $_POST['datefrom']; $pdf->dateto = $_POST['dateto']; // $pdf->accounts_codefrom=getAccountsID($_POST['accounts_codefrom']); // $pdf->accounts_codeto=getAccountsID($_POST['accounts_codeto']); if ($pdf->datefrom == "") { $pdf->datefrom = "0000-00-00"; } if ($pdf->dateto == "") { $pdf->dateto = "9999-12-31"; }
function savePdf() { $meeting =& $this->meeting; $meetingAttendanceDao =& DAORegistry::getDAO("MeetingAttendanceDAO"); $meetingAttendances =& $meetingAttendanceDao->getMeetingAttendancesByMeetingId($meeting->getId()); $suppGuestNames = $this->getData("suppGuestName"); $suppGuestAffiliations = $this->getData("suppGuestAffiliation"); $meetingDateTime = date("d F Y g:ia", strtotime($meeting->getDate())); $meetingDate = date("d F Y", strtotime($meeting->getDate())); $details = Locale::translate('editor.meeting.attendanceReport.intro1') . ' ' . $this->getData("venue") . ' ' . Locale::translate('common.date.on') . ' ' . $meetingDateTime . ' ' . Locale::translate('editor.meeting.attendanceReport.intro2') . ' ' . $this->quorum . ' ' . Locale::translate('editor.meeting.attendanceReport.intro3') . ' ' . $this->getData('adjourned') . "."; $journal = Request::getJournal(); $user = Request::getUser(); import('classes.lib.tcpdf.pdf'); $pdf = new PDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor($user->getFullName()); $pdf->SetTitle($journal->getJournalTitle()); $pdf->SetSubject($meeting->getPublicId() . ' - ' . Locale::translate('editor.minutes.attendance')); // set default header data $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 020', 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); // set margins $pdf->SetMargins(PDF_MARGIN_LEFT, 58, 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); $pdf->AddPage(); $pdf->SetFont('dejavusans', 'B', 13); $sectionDao =& DAORegistry::getDAO("SectionDAO"); $erc =& $sectionDao->getSection($meeting->getUploader()); $pdf->SetFont('dejavusans', 'I', 13); $pdf->MultiCell(0, 6, $erc->getSectionTitle(), 0, 'C'); $pdf->MultiCell(0, 6, Locale::translate('editor.meeting.attendanceReport.meetingDate') . ' ' . $meetingDate, 0, 'C'); $pdf->ln(); $memberCount = 0; $pdf->SetFont('dejavusans', 'BU', 12); $pdf->MultiCell(0, 6, Locale::translate('editor.meeting.attendanceReport.membersPresent'), 0, 'L'); $pdf->ln(); $pdf->SetFont('dejavusans', '', 12); foreach ($meetingAttendances as $meetingAttendance) { if ($meetingAttendance->getWasPresent() == 1) { $member =& $meetingAttendance->getUser(); $pdf->MultiCell(0, 6, $member->getFullName(), 0, 'L'); $memberCount++; } } if ($memberCount == 0) { $pdf->MultiCell(0, 6, Locale::translate('common.none'), 0, 'L'); } $pdf->ln(); $memberCount = 0; $pdf->SetFont('dejavusans', 'BU', 12); $pdf->MultiCell(0, 6, Locale::translate('editor.meeting.attendanceReport.membersAbsent'), 0, 'L'); $pdf->ln(); $pdf->SetFont('dejavusans', '', 12); foreach ($meetingAttendances as $meetingAttendance) { if ($meetingAttendance->getWasPresent() == 2) { $member =& $meetingAttendance->getUser(); $pdf->MultiCell(0, 6, $member->getFullName() . ' (' . Locale::translate('editor.meeting.attendanceReport.reasonForAbsence') . ' ' . $meetingAttendance->getReasonForAbsence() . ')', 0, 'L'); $memberCount++; } } if ($memberCount == 0) { $pdf->MultiCell(0, 6, Locale::translate('common.none'), 0, 'L'); } $pdf->ln(); if (count($suppGuestNames) > 0) { $suppGuestCount = 0; foreach ($suppGuestNames as $key => $guest) { if ($guest != "" && $guest != null) { if ($suppGuestCount == 0) { $pdf->SetFont('dejavusans', 'BU', 12); $pdf->MultiCell(0, 6, Locale::translate('editor.meeting.attendanceReport.suppGuest'), 0, 'L'); $pdf->ln(); $pdf->SetFont('dejavusans', '', 12); } $pdf->MultiCell(0, 6, $guest . ' (' . $suppGuestAffiliations[$key] . ')', 0, 'L'); $suppGuestCount++; } } $pdf->ln(); } $pdf->MultiCell(0, 6, $details, 0, 'L'); $pdf->ln(); if ($this->getData("announcements")) { $pdf->SetFont('dejavusans', 'BU', 12); $pdf->MultiCell(0, 6, Locale::translate('editor.meeting.attendanceReport.announcements'), 0, 'L'); $pdf->ln(); $pdf->SetFont('dejavusans', '', 12); $pdf->MultiCell(0, 6, $this->getData("announcements"), 0, 'L'); $pdf->ln(); } $pdf->SetFont('dejavusans', 'BU', 12); $pdf->MultiCell(0, 6, Locale::translate('editor.meeting.attendanceReport.submittedBy'), 0, 'L'); $pdf->ln(); $pdf->SetFont('dejavusans', '', 12); $pdf->MultiCell(0, 6, $user->getFullName(), 0, 'L'); $pdf->ln(); import('classes.file.MinutesFileManager'); $minutesFileManager = new MinutesFileManager($meeting->getId()); $minutesFileManager->handleWrite($pdf, MINUTES_FILE_ATTENDANCE); }
private function printHeader($format, $startDate, $endDate) { if ($format == 'pdf') { ob_end_clean(); $pdf = new PDF('P', 'mm', 'A4', _CHARSET_ == 'UTF-8', _CHARSET_, false); $pdf->setTopMargin(20); $pdf->headerRight = $GLOBALS['locReportPage']; $pdf->printHeaderOnFirstPage = true; $pdf->AddPage(); $pdf->SetAutoPageBreak(TRUE, 15); $pdf->setY(10); $pdf->SetFont('Helvetica', 'B', 12); $pdf->Cell(100, 15, $GLOBALS['locProductReport'], 0, 1, 'L'); if ($startDate || $endDate) { $pdf->SetFont('Helvetica', '', 8); $pdf->Cell(25, 15, $GLOBALS['locDateInterval'], 0, 0, 'L'); $pdf->Cell(50, 15, dateConvDBDate2Date($startDate) . ' - ' . dateConvDBDate2Date($endDate), 0, 1, 'L'); } $pdf->SetFont('Helvetica', 'B', 8); $pdf->Cell(15, 4, $GLOBALS['locCode'], 0, 0, 'L'); $pdf->Cell(40, 4, $GLOBALS['locProduct'], 0, 0, 'L'); $pdf->Cell(25, 4, $GLOBALS['locPCS'], 0, 0, 'R'); $pdf->Cell(25, 4, $GLOBALS['locUnit'], 0, 0, 'R'); $pdf->Cell(25, 4, $GLOBALS['locVATLess'], 0, 0, 'R'); $pdf->Cell(15, 4, $GLOBALS['locVATPercent'], 0, 0, 'R'); $pdf->Cell(25, 4, $GLOBALS['locVATPart'], 0, 0, 'R'); $pdf->Cell(25, 4, $GLOBALS['locWithVAT'], 0, 1, 'R'); $this->pdf = $pdf; return; } ?> <div class="report"> <table> <tr> <th class="label"> <?php echo $GLOBALS['locCode']; ?> </th> <th class="label"> <?php echo $GLOBALS['locProduct']; ?> </th> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locPCS']; ?> </th> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locUnit']; ?> </th> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locVATLess']; ?> </th> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locVATPercent']; ?> </th> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locVATPart']; ?> </th> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locWithVAT']; ?> </th> </tr> <?php }
/** * Internal function to return the cover for publishing a research * @param $sectionEditorSubmission SectionEditorSubmission * @return string path to cover created */ function &_generateCover($sectionEditorSubmission) { $journal =& Request::getJournal(); import('classes.lib.tcpdf.pdf'); import('classes.lib.tcpdf.tcpdf'); Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_OJS_EDITOR, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_USER)); $pdf = new PDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // No header and footer for this document $pdf->SetPrintHeader(false); $pdf->SetPrintFooter(false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor($journal->getJournalTitle()); // set margins $pdf->SetMargins(PDF_MARGIN_LEFT, 20, PDF_MARGIN_RIGHT); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // Right now this cover page is only in english, but the english translation keys are ready $pdf->AddPage(); $pdf->SetFont('dejavusans', 'B', 14); $pdf->MultiCell(0, 6, 'Final Technical Report', 0, 'C'); // Locale::translate('editor.finalReport') $pdf->ln(); $pdf->ln(); $pdf->MultiCell(0, 6, 'for', 0, 'C'); // Locale::translate('editor.finalReport.for') $pdf->ln(); $pdf->ln(); $pdf->MultiCell(0, 6, 'Research Project', 0, 'C'); // Locale::translate('editor.finalReport.researchProject') $pdf->ln(); $pdf->ln(); $pdf->ln(); $pdf->ln(); $abstract = $sectionEditorSubmission->getAbstractByLocale('en_US'); // Right now, considering only the english language $pdf->SetFont('dejavusans', 'B', 16); $pdf->MultiCell(0, 6, $abstract->getScientificTitle(), 0, 'C'); $pdf->ln(); $authors = $sectionEditorSubmission->getAuthors(); $coInvestigatorsString = (string) ''; $pInvestigatorsString = (string) ''; foreach ($authors as $author) { if (!$author->getPrimaryContact()) { if ($coInvestigatorsString == '') { $coInvestigatorsString = $author->getFullName() . ' (' . $author->getAffiliation() . ')'; } else { $coInvestigatorsString = $coInvestigatorsString . ', ' . $author->getFullName() . ' (' . $author->getAffiliation() . ')'; } } else { $pInvestigatorsString = $author->getFullName() . ' (' . $author->getAffiliation() . ')'; } } $pdf->SetFont('dejavusans', '', 16); $pdf->MultiCell(0, 6, 'Principal Investigator: ' . $pInvestigatorsString, 0, 'C'); // Locale::translate('user.role.primaryInvestigator') if ($coInvestigatorsString != '') { $pdf->MultiCell(0, 6, 'Co-Investigator(s): ' . $coInvestigatorsString, 0, 'C'); // Locale::translate('user.role.coinvestigator') } $pdf->ln(); $pdf->ln(); $pdf->ln(); $pdf->ln(); $pdf->SetFont('dejavusans', 'B', 16); $pdf->MultiCell(0, 6, $sectionEditorSubmission->getProposalId(), 0, 'C'); $pdf->ln(); $pdf->ln(); $decision = $sectionEditorSubmission->getLastSectionDecision(); $pdf->MultiCell(0, 0, date("F Y", strtotime($decision->getDateDecided())), 0, 'L', 0, 1, '', 250, true); $pdf->Image("public/site/images/mainlogo.png", 'C', 230, 40, '', '', false, 'C', false, 300, 'R', false, false, 0, false, false, false); $pdf->AddPage(); $pdf->SetFont('dejavusans', 'B', 14); $pdf->MultiCell(0, 6, 'Final Technical Report', 0, 'C'); // Locale::translate('editor.finalReport') $pdf->ln(); $pdf->ln(); $pdf->SetFont('dejavusans', 'B', 12); $pdf->MultiCell(0, 6, 'Disclaimer', 0, 'C'); // Locale::translate('editor.finalReport.disclaimer') $pdf->ln(); $pdf->ln(); $pdf->SetFont('dejavusans', '', 11); $pdf->writeHTMLCell(0, 6, '', '', $journal->getSetting('reportDisclaimer'), 0, 0, false, true, 'J'); $filePath = Config::getVar('files', 'files_dir') . '/articles/' . $sectionEditorSubmission->getArticleId() . '/public/'; if (!FileManager::fileExists($filePath, 'dir')) { FileManager::mkdirtree($filePath); } $pdf->Output($filePath . 'tempCover.pdf', 'F'); return $filePath; }
$result = $db->query("SELECT id, lang, solution_id, thema, content, datum, author FROM " . SQLPREFIX . "faqdata WHERE id = " . $id . " AND lang = '" . $lang . "' AND active = 'yes'"); if ($db->num_rows($result) > 0) { while ($row = $db->fetch_object($result)) { $lang = $row->lang; $solution_id = $row->solution_id; $thema = $row->thema; $content = $row->content; $date = $row->datum; $author = $row->author; } } else { print "Error!"; } $pdf = new PDF($currentCategory, $thema, $tree->categoryName, $orientation = "P", $unit = "mm", $format = "A4"); $pdf->Open(); $pdf->SetAutoPageBreak(true, 2 * (40 / $pdf->k)); $pdf->SetTitle($thema); $pdf->SetCreator($PMF_CONF["title"]); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont("Arial", "", 12); $pdf->SetDisplayMode("real"); $pdf->WriteHTML(str_replace("../", "", $content)); $pdf->Ln(); $pdf->Ln(); $pdf->SetStyle('I', true); $pdf->Write(5, unhtmlentities($PMF_LANG['ad_entry_solution_id']) . ': #' . $solution_id); $pdf->SetAuthor($author); $pdf->Ln(); $pdf->Write(5, unhtmlentities($PMF_LANG["msgAuthor"]) . $author); $pdf->SetAuthor($author);
/** * * @global array $DIAMOND_BRAND_IDS * @global string $server * @global jng_sp $class_sp * @global products_minierp $class_pm * @global logger $logger * @global string $icon_diamond * @global string $icon_gold_585_w * @global string $icon_gold_585_g * @param string $timestamp * @param int $jng_sp_id * @return boolean */ function generateReports($timestamp, $jng_sp_id) { global $DIAMOND_BRAND_IDS, $server, $class_sp, $class_pm, $logger, $icon_diamond, $icon_gold_585_w, $icon_gold_585_g; $log_date = strtotime($timestamp); $sp_detail = $jng_sp_id > 0 ? $class_sp->retrieveDetail($jng_sp_id) : array('package_prefix' => 'JG.DE'); $filter_sold = 1; $filter_age = 56; $logger->write("GENERATING REPORT {$sp_detail['package_prefix']}"); /* * Query get new products which: * 1) age <= 8 weeks (56 days) * 2) total sold >= 1 */ $q = "SELECT p.products_id, p.products_model, p.products_image, p.products_price, p.material_expenses, p.stars "; $q .= " , ptc.categories_id AS catid, cd.categories_name"; $q .= " , IFNULL(plps.sold_monthly_1, 0) AS sold_monthly_1, IFNULL(plps.sold_monthly_2, 0) AS sold_monthly_2"; if ($jng_sp_id > 0) { $q .= " , ((jc.total_returned / jc.total_sold) * 100) AS returned_rate, jc.active_age"; } else { $q .= " , 'N/A' AS returned_rate, DATEDIFF(NOW(), p.products_date_added) AS active_age"; } $q .= " FROM products p"; if ($jng_sp_id > 0) { $q .= " INNER JOIN jng_sp_catalog jc ON jc.jng_sp_id = {$jng_sp_id} AND jc.products_id = p.products_id"; } else { $q .= " INNER JOIN orders_products op ON op.products_id = p.products_id"; } $q .= " LEFT JOIN products_log_per_sp plps ON plps.products_id = p.products_id AND plps.jng_sp_id = {$jng_sp_id}"; $q .= " LEFT JOIN products_to_categories ptc ON ptc.products_id = p.products_id"; $q .= " LEFT JOIN categories_description cd ON cd.categories_id = ptc.categories_id AND cd.language_id = 1"; $q .= " WHERE"; if ($jng_sp_id > 0) { $q .= " jc.active_age <= {$filter_age}"; $q .= " AND jc.active_status = 1"; $q .= " AND total_sold >= {$filter_sold}"; } else { //$q .= " p.products_date_added >= '2013-01-01 00:00:00'"; $q .= " DATEDIFF(NOW(), p.products_date_added) <= {$filter_age}"; $q .= " AND p.products_status = 1"; $q .= " AND op.status NOT IN (10, 12)"; $q .= " GROUP BY p.products_id"; $q .= " HAVING SUM(op.products_quantity) >= {$filter_sold}"; } //$q .= " LIMIT 5"; $dbq = tep_db_query($q); $products = array(); while ($row = tep_db_fetch_array($dbq)) { $row['margin'] = $class_pm->calculateMargin($row['products_price'], $row['material_expenses'], 1); $products[$row['catid']][$row['products_id']] = $row; } if (count($products) == 0) { $logger->write("NO DATA RETRIEVED"); return false; } //Start Creating PDF Reports $margin = 20; $ypos = 10; $col_width = 48; $col_height = 77; $line_height = 5; $cell_text_width = $col_width - 3; $no = 0; $row = 1; $icon_w = 4; $icon_h = 4; $first_page = true; $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('New Comer Report'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('Manobo PDF Generator'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(true, 25); $pdf->AliasNbPages(); $pdf->AddPage('L'); $pdf->setXY($margin, $ypos); $pdf->setFont('Arial', 'B', '14'); $pdf->cell(240, 5, 'SALES REPORT NEWCOMER PRODUCT ' . $sp_detail['package_prefix'] . ' (' . date('d.m.Y', $log_date) . ')', 0, 0, 'C'); $pdf->setFont('Arial', '', '10'); $ypos += 15; $pdf->setXY($margin, $ypos); $catids = load_config('products-categories-sorting'); foreach ($catids as $catid) { $xpos = $margin; if (is_array($products[$catid])) { foreach ($products[$catid] as $pid => $p) { $obj_product = new product($pid); $no++; if ($ypos >= 150 || $no == 1 && !$first_page) { //Reset vars to new page state $xpos = $margin; $ypos = 25; $row = 1; $pdf->AddPage('L'); $pdf->setXY($margin, $ypos); } //Draw product box $pdf->Cell($col_width, $col_height, '', 1, 0); //Start drawing contents $pdf->drawProductsImage($xpos + 10, $ypos + 1, $p['products_image']); if (is_object($obj_product) && in_array($obj_product->brand_id, $DIAMOND_BRAND_IDS)) { $ypos_icon = $ypos + 3; $pdf->drawIcon($icon_diamond, $xpos + 39.5, $ypos_icon, $icon_w, $icon_h); } if (is_object($obj_product) && ($obj_product->metal_stamp_code > 0 && $obj_product->metal_stamp_code != 925)) { $icon_gold_selected = "icon_gold_" . $obj_product->metal_stamp_code . '_' . strtolower(substr($obj_product->metal_stamp_info, 0, 1)); $icon_gold = ${$icon_gold_selected}; $ypos_icon += $icon_h; //gold icon dimension is 21 x 16 $icon_gold_w = 21 / 16 * $icon_h; $pdf->drawIcon($icon_gold, $xpos + 38, $ypos_icon, $icon_gold_w, $icon_h); } $pdf->setXY($xpos + 2, $ypos + 3); $pdf->setFont('Arial', 'B', '10'); $pdf->Cell($col_width, $line_height, $no . ". " . ($no == 1 ? $p['categories_name'] : '')); $pdf->setFont('Arial', '', '10'); $pdf->drawStar($p['stars'], $xpos + 15, $ypos + 29); $pdf->setXY($xpos + 2, $ypos + 35); $link = "http://{$server}/?open=product-detail&products_id=" . $pid; $pdf->SetFont('Arial', 'U'); $pdf->SetTextColor(0, 0, 255); $pdf->Cell($cell_text_width, $line_height, $pid . ' / ' . $p['products_model'], 0, 0, 'C', 0, $link); $pdf->SetFont('Arial', ''); $pdf->SetTextColor(0, 0, 0); $pdf->setXY($xpos + 2, $ypos + 40); $pdf->Cell($cell_text_width, $line_height, 'Price: ' . displayCurrency('EUR', $p['products_price'], false) . ' EUR', 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 45); $pdf->Cell($cell_text_width, $line_height, 'Margin: ' . number_format($p['margin'], 1) . '%', 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 50); $pdf->Cell($cell_text_width, $line_height, 'Return Rate: ' . ($jng_sp_id > 0 ? number_format($p['returned_rate'], 1) . '%' : $p['returned_rate']), 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 60); $pdf->Cell($cell_text_width, $line_height, 'Age in ' . ($jng_sp_id > 0 ? 'SP' : 'JG') . ': ' . $p['active_age'] . ' days', 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 65); $pdf->Cell($cell_text_width, $line_height, 'Sold L30D in ' . ($jng_sp_id > 0 ? 'SP' : 'JG') . ': ' . $p['sold_monthly_1'], 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 70); $pdf->Cell($cell_text_width, $line_height, 'Sold L60D in ' . ($jng_sp_id > 0 ? 'SP' : 'JG') . ': ' . $p['sold_monthly_2'], 0, 0, 'C'); if ($no % 5 == 0) { $row++; $xpos = $margin; $ypos += $col_height * ($row - 1) + 5; } else { $xpos += $col_width + 5; } $pdf->setXY($xpos, $ypos); } $first_page = false; } $no = 0; } $filepath = 'sales-report-newcomer-products/'; $yeardir = $filepath . date('Y/', $log_date); if (!file_exists(DIR_FS_ARCHIVES . $yeardir) || !is_dir(DIR_FS_ARCHIVES . $yeardir)) { mkdir(DIR_FS_ARCHIVES . $yeardir); } $monthdir = $yeardir . date('m/', $log_date); if (!file_exists(DIR_FS_ARCHIVES . $monthdir) || !is_dir(DIR_FS_ARCHIVES . $monthdir)) { mkdir(DIR_FS_ARCHIVES . $monthdir); } $path_location = DIR_FS_ARCHIVES . $monthdir; $filename = date('YmdHi', strtotime($timestamp)) . '-sales-report-newcomer-products-' . $sp_detail['package_prefix'] . '.pdf'; $pdf->Output($path_location . $filename, 'F'); $logger->write("PDF CREATED: {$filename}"); //$pdf->Output($filename, 'D'); return true; }
} function Footer() { global $pagefooterheight; $this->SetY($pagefooterheight * -1); //Arial italic 8 $this->SetFont('courier', 'I', 8); $this->Cell(0, 5, 'Page ' . $this->PageNo() . '/{nb} Generated dated ' . $timestamp, 0, 0, 'C'); } } if (isset($_POST["submit"])) { // $pdf=new PDF('P','mm',$papertype[$statementpapersource]); //0=A4,1=Letter $pdf = new PDF('P', 'mm', "A4"); //0=A4,1=Letter $pdf->AliasNbPages(); $pdf->SetAutoPageBreak(true, 40 + 1); $org->fetchOrganization($defaultorganization_id); $companyno = $org->companyno; $orgname = $org->organization_name; $orgstreet1 = $org->street1; $orgstreet2 = $org->street2; $orgstreet3 = $org->street3; $orgcity = $org->city; $orgstate = $org->state; $orgcountry_name = $org->country_name; $orgemail = $org->email; $orgurl = $org->url; $orgtel1 = $org->tel_1; $orgtel2 = $org->tel_2; $orgfax = $org->fax; $periodfrom_id = $_POST['periodfrom_id'];
} public function drawPackageBarcode($barcode, $barcode_xpos, $barcode_ypos, $barcode_width) { $this->drawBarcode($barcode, 'CODE128', 'AMVDBOX', $barcode_xpos, $barcode_ypos, $barcode_width); } public function drawOrderBarcode($barcode, $barcode_xpos, $barcode_ypos, $barcode_width) { $this->drawBarcode($barcode, 'CODE39', 'AMVDPO', $barcode_xpos, $barcode_ypos, $barcode_width); } } $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('Amazon Packing Slip'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('k-Auto Generated PDF'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(false); $pdf->AliasNbPages(); //$pdf->AddPage(); $margin = 10; $ypos = $margin; $box_width = 190; $box_shipping_width = 80; $box_billing_width = $box_width - $box_shipping_width; $gap_between_boxes = 5; $box1_height = 20; $box2_height = 24; $box3_height = 14; $box4_height = 48; $boxes_tab = 15; $counter_size = 10; $barcode_width = 60;
<?php $name = $_POST['name']; $characteristics = $_POST['characteristics']; $image = $_POST['image']; $clues = explode(',', $_POST['clues']); require 'MultiCellBlt2.php'; //Create pdf $pdf = new PDF(); $pdf->AddPage(); //set document properties $pdf->SetAuthor('Anon'); $pdf->SetTitle($name); // Set the page break to 'true' and the bottom margin height $pdf->SetAutoPageBreak(1, 10); //set font for the entire document $pdf->SetFont('Helvetica', 'B', 20); $pdf->SetTextColor(50, 60, 100); //insert Collage logo $pdf->Image('logo.png', 10, 10, 33, 0); //display the title without a border around it $pdf->SetXY(50, 15); $pdf->SetDrawColor(50, 60, 100); $pdf->Cell(100, 10, $name, 0, 0, 'C', 0); // Insert a dynamic image from a URL $pdf->Image($image, 11, 30, 0, 50); //Set x and y position for the main text, reduce font size and write content $pdf->SetXY(65, 30); $pdf->SetLeftMargin(65); $pdf->SetFontSize(10); $pdf->Write(5, $characteristics);
function automaticSummaryInPDF($submission) { $countryDao =& DAORegistry::getDAO('CountryDAO'); $articleDrugInfoDao =& DAORegistry::getDAO('ArticleDrugInfoDAO'); $extraFieldDAO =& DAORegistry::getDAO('ExtraFieldDAO'); $journal =& Request::getJournal(); $submitter =& $submission->getUser(); $title = $journal->getJournalTitle(); $articleTexts = $submission->getArticleTexts(); $articleTextLocales = $journal->getSupportedLocaleNames(); $secIds = $submission->getArticleSecIds(); $details = $submission->getArticleDetails(); $purposes = $submission->getArticlePurposes(); $articlePrimaryOutcomes = $submission->getArticleOutcomesByType(ARTICLE_OUTCOME_PRIMARY); $articleSecondaryOutcomes = $submission->getArticleOutcomesByType(ARTICLE_OUTCOME_SECONDARY); $coutryList = $countryDao->getCountries(); $articleDrugs = $submission->getArticleDrugs(); $pharmaClasses = $articleDrugInfoDao->getPharmaClasses(); $drugStudyClasses = $articleDrugInfoDao->getClassKeysMap(); $articleSites = $submission->getArticleSites(); $expertisesList = $extraFieldDAO->getExtraFieldsList(EXTRA_FIELD_THERAPEUTIC_AREA, EXTRA_FIELD_ACTIVE); $fundingSources = $submission->getArticleFundingSources(); $pSponsor = $submission->getArticlePrimarySponsor(); $sSponsors = $submission->getArticleSecondarySponsors(); $CROs = $submission->getArticleCROs(); $contact = $submission->getArticleContact(); Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_OJS_EDITOR, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_USER)); import('classes.lib.tcpdf.pdf'); import('classes.lib.tcpdf.tcpdf'); $pdf = new PDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor($submitter->getFullName()); $pdf->SetTitle($title); $subject = $submission->getProposalId() . ' - ' . Locale::translate('submission.summary'); $pdf->SetSubject($subject); $cell_width = 45; $cell_height = 6; // set default header data $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 020', 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); // set margins $pdf->SetMargins(PDF_MARGIN_LEFT, 58, 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); $pdf->AddPage(); // Title $pdf->SetFont('Times', 'B', 15); $w = $pdf->GetStringWidth($title) + 6; $pdf->SetX((210 - $w) / 2); $pdf->Cell($w, 9, $title, 0, 1, 'C'); // sub-title $pdf->SetFont('Times', 'BI', 14); $w2 = $pdf->GetStringWidth($subject) + 6; $pdf->SetX((210 - $w2) / 2); $pdf->Cell($w2, 9, $subject, 0, 1, 'C'); // Line break $pdf->Ln(10); // Main Info $pdf->SetFont('Times', '', 12); $pdf->MultiRow(50, Locale::translate("common.proposalId"), $submission->getProposalId(), 'L'); $pdf->MultiRow(50, Locale::translate("article.title"), $submission->getScientificTitle(), 'L'); $pdf->MultiRow(50, Locale::translate("submission.submitter"), $submitter->getFullName(), 'L'); $pdf->MultiRow(50, Locale::translate("common.dateSubmitted"), $submission->getDateSubmitted(), 'L'); // Line break $pdf->Ln(10); //CT Information $pdf->SetFont('Times', 'B', 14); $pdf->Cell(190, 9, 'I' . Locale::translate('common.queue.long.articleDetails', array('id' => '')), 0, 1, 'L'); $pdf->Ln(5); $pdf->SetFont('Times', '', 12); $scientificTitle = null; foreach ($articleTexts as $atKey => $articleText) { if (!$scientificTitle) { $pdf->MultiRow(50, Locale::translate("proposal.scientificTitle"), $articleText->getScientificTitle() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); $scientificTitle = true; } else { $pdf->MultiRow(50, '', $articleText->getScientificTitle() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); } } $publicTitle = null; foreach ($articleTexts as $atKey => $articleText) { if (!$publicTitle) { $pdf->MultiRow(50, Locale::translate("proposal.publicTitle"), $articleText->getPublicTitle() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); $publicTitle = true; } else { $pdf->MultiRow(50, '', $articleText->getPublicTitle() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); } } $pdf->Ln(3); $firstSecId = null; foreach ($secIds as $secId) { if (!$firstSecId) { $pdf->MultiRow(50, Locale::translate("proposal.articleSecId"), $secId->getSecId() . ' (' . Locale::translate($secId->getTypeKey()) . ')', 'L'); $firstSecId = true; } else { $pdf->MultiRow(50, '', $secId->getSecId() . ' (' . Locale::translate($secId->getTypeKey()) . ')', 'L'); } } $pdf->Ln(3); $pdf->MultiRow(50, Locale::translate("proposal.protocolVersion"), $details->getProtocolVersion(), 'L'); $pdf->Ln(3); $pdf->MultiRow(50, Locale::translate("proposal.therapeuticArea"), $details->getRightTherapeuticAreaDisplay(), 'L'); $pdf->Ln(3); $firstICD10 = null; foreach ($details->getHealthCondDiseaseArrayToDisplay() as $healthCond) { $code = $healthCond['code']; $exactCode = $healthCond['exactCode']; if ($exactCode != '') { $code = $code . ' (' . $exactCode . ')'; } if (!$firstICD10) { $pdf->MultiRow(50, Locale::translate("proposal.icd10s"), $code, 'L'); $firstICD10 = true; } else { $pdf->MultiRow(50, '', $code, 'L'); } } $pdf->Ln(3); $firstPurpose = null; foreach ($purposes as $purpose) { if (!$firstPurpose) { $purposeTitle = Locale::translate("proposal.purposes"); $firstPurpose = true; } else { $purposeTitle = ''; } if ($purpose->getType() == ARTICLE_PURPOSE_TYPE_OBS) { $pdf->MultiRow(50, $purposeTitle, Locale::translate($purpose->getTypeKey()), 'L'); } else { $pdf->MultiRow(50, $purposeTitle, Locale::translate('proposal.purpose.type.int'), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.purposes.type') . ': ' . Locale::translate($purpose->getTypeKey()), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.purposes.ctPhase') . ': ' . Locale::translate($purpose->getCTPhaseKey()), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.purposes.studyDesign') . ', ' . Locale::translate('proposal.purposes.allocation') . ': ' . Locale::translate($purpose->getAllocationKey()), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.purposes.masking') . ': ' . Locale::translate($purpose->getMaskingKey()), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.purposes.control') . ': ' . Locale::translate($purpose->getControlKey()), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.purposes.assignment') . ': ' . Locale::translate($purpose->getAssignmentKey()), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.purposes.endpoint') . ': ' . Locale::translate($purpose->getEndpointKey()), 'L'); } } $pdf->Ln(3); $description = null; foreach ($articleTexts as $atKey => $articleText) { if (!$description) { $pdf->MultiRow(50, Locale::translate("proposal.description"), $articleText->getDescription() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); $description = true; } else { $pdf->MultiRow(50, '', $articleText->getDescription() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); } } $pdf->Ln(3); $kic = null; foreach ($articleTexts as $atKey => $articleText) { if (!$kic) { $pdf->MultiRow(50, Locale::translate("proposal.keyInclusionCriteria"), $articleText->getKeyInclusionCriteria() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); $kic = true; } else { $pdf->MultiRow(50, '', $articleText->getKeyInclusionCriteria() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); } } $pdf->Ln(3); $kec = null; foreach ($articleTexts as $atKey => $articleText) { if (!$kec) { $pdf->MultiRow(50, Locale::translate("proposal.keyExclusionCriteria"), $articleText->getKeyExclusionCriteria() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); $kec = true; } else { $pdf->MultiRow(50, '', $articleText->getKeyExclusionCriteria() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); } } $pdf->Ln(3); $firstPOutcome = null; foreach ($articlePrimaryOutcomes as $articleOutcomeLocales) { foreach ($articleOutcomeLocales as $key => $articleOutcome) { if (!$firstPOutcome) { $outcomeTitle = Locale::translate("proposal.primaryOutcomes"); $firstPOutcome = true; } else { $outcomeTitle = ''; } $pdf->MultiRow(50, $outcomeTitle, $articleOutcome->getName() . ' (' . $articleTextLocales[$key] . ')', 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.primaryOutcome.measurement') . ': ' . $articleOutcome->getMeasurement(), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.primaryOutcome.timepoint') . ': ' . $articleOutcome->getTimepoint(), 'L'); $pdf->Ln(3); } } $firstSOutcome = null; foreach ($articleSecondaryOutcomes as $articleOutcomeLocales) { foreach ($articleOutcomeLocales as $key => $articleOutcome) { if (!$firstSOutcome) { $sOutcomeTitle = Locale::translate("proposal.secondaryOutcomes"); $firstSOutcome = true; } else { $sOutcomeTitle = ''; } $pdf->MultiRow(50, $sOutcomeTitle, $articleOutcome->getName() . ' (' . $articleTextLocales[$key] . ')', 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.primaryOutcome.measurement') . ': ' . $articleOutcome->getMeasurement(), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.primaryOutcome.timepoint') . ': ' . $articleOutcome->getTimepoint(), 'L'); $pdf->Ln(3); } } $pdf->MultiRow(50, Locale::translate("proposal.age.minimum"), $details->getMinAgeNum() . ' ' . Locale::translate($details->getMinAgeUnitKey()), 'L'); $pdf->MultiRow(50, Locale::translate("proposal.age.maximum"), $details->getMaxAgeNum() . ' ' . Locale::translate($details->getMaxAgeUnitKey()), 'L'); $pdf->MultiRow(50, Locale::translate("proposal.sex"), Locale::translate($details->getSexKey()), 'L'); $pdf->MultiRow(50, Locale::translate("proposal.healthy"), Locale::translate($details->getYesNoKey($details->getHealthy())), 'L'); $pdf->Ln(3); $pdf->MultiRow(50, Locale::translate("proposal.localeSampleSize"), $details->getLocaleSampleSize(), 'L'); $pdf->MultiRow(50, Locale::translate("proposal.multinational") . ' ' . $journal->getLocalizedSetting('location'), Locale::translate($details->getYesNoKey($details->getMultinational())), 'L'); if ($details->getMultinational() == ARTICLE_DETAIL_YES) { foreach ($details->getIntSampleSizeArray() as $countryAndNumberArray) { $country = $countryAndNumberArray['country']; $pdf->MultiRow(50, '', ' ' . $coutryList[$country] . ': ' . $countryAndNumberArray['number'], 'L'); } } $pdf->Ln(3); $pdf->MultiRow(50, Locale::translate("proposal.expectedDate"), Locale::translate('proposal.startDate') . ': ' . $details->getStartDate() . ', ' . Locale::translate('proposal.endDate') . ': ' . $details->getEndDate(), 'L'); $pdf->Ln(3); $pdf->MultiRow(50, Locale::translate("proposal.recruitment"), Locale::translate("proposal.recruitment.status") . ': ' . Locale::translate($details->getRecruitmentStatusKey()), 'L'); $rssi = null; foreach ($articleTexts as $atKey => $articleText) { if ($articleText->getRecruitmentInfo() != '') { if (!$rssi) { $pdf->MultiRow(50, '', Locale::translate("proposal.recruitment.info") . ': ' . $articleText->getRecruitmentInfo() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); $rssi = true; } else { $pdf->MultiRow(50, '', $articleText->getRecruitmentInfo() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); } } } $pdf->MultiRow(50, '', Locale::translate("proposal.recruitment.adScheme") . ': ' . Locale::translate($details->getYesNoKey($details->getAdvertisingScheme())), 'L'); // Line break $pdf->Ln(10); //Drug products $pdf->SetFont('Times', 'B', 14); $pdf->Cell(190, 9, 'II' . Locale::translate('common.queue.long.articleDrugs', array('id' => '')), 0, 1, 'L'); $pdf->Ln(5); foreach ($articleDrugs as $articleDrug) { $pdf->SetFont('Times', 'BU', 12); $pdf->Cell(190, 9, $articleDrug->getName(), 0, 1, 'L'); $pdf->SetFont('Times', '', 12); $pdf->Ln(3); $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.type"), Locale::translate($articleDrug->getTypeKey()), 'L'); $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.name"), $articleDrug->getName(), 'L'); $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.brandName"), $articleDrug->getBrandName(), 'L'); if ($articleDrug->getOtherAdministration() == 'NA') { $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.administration"), Locale::translate($articleDrug->getAdministrationKey()), 'L'); } else { $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.administration"), $articleDrug->getOtherAdministration(), 'L'); } if ($articleDrug->getOtherForm() == 'NA') { $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.form"), Locale::translate($articleDrug->getFormKey()), 'L'); } else { $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.form"), $articleDrug->getOtherForm(), 'L'); } $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.strength"), $articleDrug->getStrength(), 'L'); $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.storage"), Locale::translate($articleDrug->getStorageKey()), 'L'); $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.pharmaClass"), $pharmaClasses[$articleDrug->getPharmaClass()], 'L'); $firstClass = false; $classIIIOrIV = false; $classesToDisplay = ''; foreach ($articleDrug->getClassesArray() as $class) { if ($class == ARTICLE_DRUG_INFO_CLASS_III || $class == ARTICLE_DRUG_INFO_CLASS_IV) { $classIIIOrIV = true; } if (!$firstClass) { $classesToDisplay = Locale::translate($drugStudyClasses[$class]); } else { $classesToDisplay = $classesToDisplay . ', ' . Locale::translate($drugStudyClasses[$class]); } $firstClass = true; } $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.studyClasses"), $classesToDisplay, 'L'); if ($classIIIOrIV) { $countriesToDisplay = ''; $firstCountry = false; foreach ($articleDrug->getCountriesArray() as $country) { if (!$firstCountry) { $countriesToDisplay = $coutryList[$country]; } else { $countriesToDisplay = $countriesToDisplay . ', ' . $coutryList[$country]; } $firstCountry = true; } $pdf->MultiRow(50, '', Locale::translate("proposal.drugInfo.countries") . ': ' . $countriesToDisplay, 'L'); $pdf->MultiRow(50, '', Locale::translate("proposal.drugInfo.conditionsOfUse") . ': ' . Locale::translate($articleDrug->getDifferentConditionsOfUseKey()), 'L'); } $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.cpr"), Locale::translate($articleDrug->getCPRKey()), 'L'); if ($articleDrug->getCPR() == ARTICLE_DRUG_INFO_YES) { $pdf->MultiRow(50, '', Locale::translate("proposal.drugInfo.drugRegistrationNumber") . ': ' . $articleDrug->getDrugRegistrationNumber(), 'L'); } if ($articleDrug->getImportedQuantity() != '') { $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.importedQuantity"), $articleDrug->getImportedQuantity(), 'L'); } $firstManufacturer = false; foreach ($articleDrug->getManufacturers() as $manufacturer) { $manufacturerTitle = ''; if (!$firstManufacturer) { $manufacturerTitle = Locale::translate('proposal.drugInfo.manufacturers'); } $pdf->MultiRow(50, $manufacturerTitle, $manufacturer->getName(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.drugInfo.manufacturer.address') . ': ' . $manufacturer->getAddress(), 'L'); $firstManufacturer = true; $pdf->Ln(2); } $pdf->Ln(3); } // Line break $pdf->Ln(10); // Trial Site(s) $pdf->SetFont('Times', 'B', 14); $pdf->Cell(190, 9, 'III' . Locale::translate('common.queue.long.articleSites', array('id' => '')), 0, 1, 'L'); $pdf->Ln(5); foreach ($articleSites as $articleSite) { $trialSiteObject = $articleSite->getTrialSiteObject(); $pdf->SetFont('Times', 'BU', 12); $pdf->Cell(190, 9, $trialSiteObject->getName(), 0, 1, 'L'); $pdf->SetFont('Times', '', 12); $pdf->Ln(3); $pdf->MultiRow(50, Locale::translate("proposal.articleSite.site"), $trialSiteObject->getName(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteAddress') . ': ' . $trialSiteObject->getAddress(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteCity') . ': ' . $trialSiteObject->getCity(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteRegion') . ': ' . $trialSiteObject->getRegionText(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteLicensure') . ': ' . $trialSiteObject->getLicensure(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteAccreditation') . ': ' . $trialSiteObject->getAccreditation(), 'L'); $pdf->Ln(2); $pdf->MultiRow(50, Locale::translate("proposal.articleSite.erc"), $articleSite->getERCName(), 'L'); $pdf->Ln(2); $pdf->MultiRow(50, Locale::translate("proposal.articleSite.authority"), $articleSite->getAuthority(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.primaryPhone') . ': ' . $articleSite->getPrimaryPhone(), 'L'); if ($articleSite->getSecondaryPhone()) { $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.secondaryPhone') . ': ' . $articleSite->getSecondaryPhone(), 'L'); } if ($articleSite->getFax()) { $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.fax') . ': ' . $articleSite->getFax(), 'L'); } $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.email') . ': ' . $articleSite->getEmail(), 'L'); $pdf->Ln(2); $pdf->MultiRow(50, Locale::translate("proposal.articleSite.subjectsNumber"), $articleSite->getSubjectsNumber(), 'L'); $pdf->Ln(2); $countInvestigators = 1; foreach ($articleSite->getInvestigators() as $investigator) { $investigatorTitle = ""; if ($countInvestigators == 1) { $investigatorTitle = Locale::translate('user.role.primaryInvestigator'); } elseif ($countInvestigators == 2) { $investigatorTitle = Locale::translate('user.role.coinvestigator'); } $pdf->MultiRow(50, $investigatorTitle, $investigator->getFullName(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.expertise') . ': ' . $expertisesList[$investigator->getExpertise()], 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.iPrimaryPhone') . ': ' . $investigator->getPrimaryPhoneNumber(), 'L'); if ($investigator->getSecondaryPhoneNumber()) { $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.iSecondaryPhone') . ': ' . $investigator->getSecondaryPhoneNumber(), 'L'); } if ($investigator->getFaxNumber()) { $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.iFax') . ': ' . $investigator->getFaxNumber(), 'L'); } $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.iEmail') . ': ' . $investigator->getEmail(), 'L'); $countInvestigators++; } $pdf->Ln(3); } // Line break $pdf->Ln(10); // Sponsors $pdf->SetFont('Times', 'B', 14); $pdf->Cell(190, 9, 'IV' . Locale::translate('common.queue.long.articleSponsors', array('id' => '')), 0, 1, 'L'); $pdf->Ln(5); $pdf->SetFont('Times', '', 12); $firstFSource = false; foreach ($fundingSources as $fundingSource) { $fSourceTitle = ''; if (!$firstFSource) { $fSourceTitle = Locale::translate('proposal.articleSponsor.fundingSources'); } $institution = $fundingSource->getInstitutionObject(); $pdf->MultiRow(50, $fSourceTitle, $institution->getInstitutionName(), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.acronym') . ': ' . $institution->getInstitutionAcronym(), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.type') . ': ' . Locale::translate($institution->getInstitutionTypeKey()), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.location') . ': ' . $institution->getInstitutionInternationalText(), 'L'); if ($institution->getInstitutionInternational() == INSTITUTION_INTERNATIONAL) { $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.locationInternational') . ': ' . $institution->getInstitutionLocationText(), 'L'); } else { $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.locationCountry') . ': ' . $institution->getInstitutionLocationText(), 'L'); } $pdf->Ln(2); $firstFSource = true; } $pdf->Ln(1); $institution = $pSponsor->getInstitutionObject(); $pdf->MultiRow(50, Locale::translate("proposal.articleSponsor.primarySponsor"), $institution->getInstitutionName(), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.acronym') . ': ' . $institution->getInstitutionAcronym(), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.type') . ': ' . Locale::translate($institution->getInstitutionTypeKey()), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.location') . ': ' . $institution->getInstitutionInternationalText(), 'L'); if ($institution->getInstitutionInternational() == INSTITUTION_INTERNATIONAL) { $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.locationInternational') . ': ' . $institution->getInstitutionLocationText(), 'L'); } else { $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.locationCountry') . ': ' . $institution->getInstitutionLocationText(), 'L'); } $pdf->Ln(3); $firstSSponsor = false; foreach ($sSponsors as $sSponsor) { $SSponsorTitle = ''; if (!$firstSSponsor) { $SSponsorTitle = Locale::translate('proposal.articleSponsor.secondarySponsors'); } $institution = $sSponsor->getInstitutionObject(); $pdf->MultiRow(50, $SSponsorTitle, $institution->getInstitutionName(), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.acronym') . ': ' . $institution->getInstitutionAcronym(), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.type') . ': ' . Locale::translate($institution->getInstitutionTypeKey()), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.location') . ': ' . $institution->getInstitutionInternationalText(), 'L'); if ($institution->getInstitutionInternational() == INSTITUTION_INTERNATIONAL) { $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.locationInternational') . ': ' . $institution->getInstitutionLocationText(), 'L'); } else { $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.locationCountry') . ': ' . $institution->getInstitutionLocationText(), 'L'); } $pdf->Ln(2); $firstSSponsor = true; } $pdf->Ln(1); $pdf->MultiRow(50, Locale::translate("proposal.articleSponsor.croInvolved"), Locale::translate($details->getYesNoKey($details->getCROInvolved())), 'L'); foreach ($CROs as $CRO) { $pdf->MultiRow(50, '', $CRO->getName(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.location') . ': ' . $CRO->getInternationalText(), 'L'); if ($CRO->getInternational() == CRO_INTERNATIONAL) { $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.locationInternational') . ': ' . $CRO->getLocationText(), 'L'); } else { $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.locationCountry') . ': ' . $CRO->getLocationText(), 'L'); } $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.city') . ': ' . $CRO->getCity(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.address') . ': ' . $CRO->getAddress(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.primaryPhone') . ': ' . $CRO->getPrimaryPhone(), 'L'); if ($CRO->getSecondaryPhone()) { $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.secondaryPhone') . ': ' . $CRO->getSecondaryPhone(), 'L'); } if ($CRO->getFax()) { $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.fax') . ': ' . $CRO->getFax(), 'L'); } $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.email') . ': ' . $CRO->getEmail(), 'L'); $pdf->Ln(2); } $pdf->Ln(1); // Line break $pdf->Ln(10); // Contact Information $pdf->SetFont('Times', 'B', 14); $pdf->Cell(190, 9, 'V' . Locale::translate('common.queue.long.articleContact', array('id' => '')), 0, 1, 'L'); $pdf->Ln(5); $pdf->SetFont('Times', '', 12); $pdf->MultiRow(50, Locale::translate("proposal.articleContact.pq"), $contact->getPQName(), 'L'); $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.affiliation") . ': ' . $contact->getPQAffiliation(), 'L'); $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.address") . ': ' . $contact->getPQAddress(), 'L'); $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.country") . ': ' . $coutryList[$contact->getPQCountry()], 'L'); $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.phone") . ': ' . $contact->getPQPhone(), 'L'); if ($contact->getPQFax() != '') { $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.fax") . ': ' . $contact->getPQFax(), 'L'); } $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.email") . ': ' . $contact->getPQEmail(), 'L'); $pdf->Ln(3); $pdf->MultiRow(50, Locale::translate("proposal.articleContact.sq"), $contact->getSQName(), 'L'); $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.affiliation") . ': ' . $contact->getSQAffiliation(), 'L'); $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.address") . ': ' . $contact->getSQAddress(), 'L'); $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.country") . ': ' . $coutryList[$contact->getSQCountry()], 'L'); $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.phone") . ': ' . $contact->getSQPhone(), 'L'); if ($contact->getPQFax() != '') { $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.fax") . ': ' . $contact->getSQFax(), 'L'); } $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.email") . ': ' . $contact->getSQEmail(), 'L'); $pdf->Output($submission->getProposalId() . '-' . Locale::translate('submission.summary') . '.pdf', "D"); }
include_once "../db.mysql.php"; include_once "../connectdb.php"; include_once "../parameter.php"; include_once "../cekparam.php"; include_once "../header_pdf.php"; // *** Parameters *** $TahunID = GetSetVar('TahunID'); $ProdiID = GetSetVar('ProdiID'); $ProgramID = GetSetVar('ProgramID'); $HariID = GetSetVar('HariID'); $JadwalID = $_REQUEST['JadwalID'] + 0; $lbr = 190; // Init $pdf = new PDF('P', 'mm', 'A4'); $pdf->SetTitle("Laporan Kehadiran Kuliah Mhsw - {$TahunID}"); $pdf->SetAutoPageBreak(true, 5); // *** Main *** if ($JadwalID == 0) { $whr_prodi = empty($ProdiID) ? "" : "and ProdiID = '{$ProdiID}'"; $whr_tahun = empty($TahunID) ? "" : "and TahunID = '{$TahunID}'"; $s = "select JadwalID\r\n from jadwal\r\n where KodeID = '" . KodeID . "'\r\n {$whr_prodi}\r\n\t {$whr_tahun}\r\n order by HariID, JamMulai, JamSelesai"; $r = _query($s); while ($w = _fetch_array($r)) { CetakPresensiMhsw($w['JadwalID'], $pdf); } } else { CetakPresensiMhsw($JadwalID, $pdf); } $pdf->Output(); // *** Functions *** function CetakPresensiMhsw($id, $p)
/** * Main * * @param object $order Order * @param string $mode Download or display (optional) */ public static function invoice($order, $mode = 'D', $multiple = false, &$pdf = NULL, $slip = false, $delivery = false) { global $cookie, $ecotax; if (!Validate::isLoadedObject($order) or !$cookie->id_employee and (!OrderState::invoiceAvailable($order->getCurrentState()) and !$order->invoice_number)) { die('Invalid order or invalid order state'); } self::$order = $order; self::$orderSlip = $slip; self::$delivery = $delivery; self::$_iso = strtoupper(Language::getIsoById(intval(self::$order->id_lang))); if ((self::$_priceDisplayMethod = $order->getTaxCalculationMethod()) === false) { die(self::l('No price display method defined for the customer group')); } if (!$multiple) { $pdf = new PDF('P', 'mm', 'A4'); } $pdf->SetAutoPageBreak(true, 35); $pdf->StartPageGroup(); self::$currency = Currency::getCurrencyInstance(intval(self::$order->id_currency)); $pdf->AliasNbPages(); $pdf->AddPage(); /* Display address information */ $invoice_address = new Address(intval($order->id_address_invoice)); $invoiceState = $invoice_address->id_state ? new State($invoice_address->id_state) : false; $delivery_address = new Address(intval($order->id_address_delivery)); $deliveryState = $delivery_address->id_state ? new State($delivery_address->id_state) : false; $shop_country = Configuration::get('PS_SHOP_COUNTRY'); $invoice_customer = new Customer(intval($invoice_address->id_customer)); $width = 100; $pdf->SetX(10); $pdf->SetY(25); $pdf->SetFont(self::fontname(), '', 12); $pdf->Cell($width, 10, self::l('Delivery'), 0, 'L'); $pdf->Cell($width, 10, self::l('Invoicing'), 0, 'L'); $pdf->Ln(5); $pdf->SetFont(self::fontname(), '', 9); if (!empty($delivery_address->company) or !empty($invoice_address->company)) { $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->company), 0, 'L'); $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $invoice_address->company), 0, 'L'); $pdf->Ln(5); } $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->firstname) . ' ' . Tools::iconv('utf-8', self::encoding(), $delivery_address->lastname), 0, 'L'); $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $invoice_address->firstname) . ' ' . Tools::iconv('utf-8', self::encoding(), $invoice_address->lastname), 0, 'L'); $pdf->Ln(5); $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->address1), 0, 'L'); $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $invoice_address->address1), 0, 'L'); $pdf->Ln(5); if (!empty($invoice_address->address2) or !empty($delivery_address->address2)) { $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->address2), 0, 'L'); $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $invoice_address->address2), 0, 'L'); $pdf->Ln(5); } $pdf->Cell($width, 10, $delivery_address->postcode . ' ' . Tools::iconv('utf-8', self::encoding(), $delivery_address->city), 0, 'L'); $pdf->Cell($width, 10, $invoice_address->postcode . ' ' . Tools::iconv('utf-8', self::encoding(), $invoice_address->city), 0, 'L'); $pdf->Ln(5); $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->country . ($deliveryState ? ' - ' . $deliveryState->name : '')), 0, 'L'); $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $invoice_address->country . ($invoiceState ? ' - ' . $invoiceState->name : '')), 0, 'L'); $pdf->Ln(5); $pdf->Cell($width, 10, $delivery_address->phone, 0, 'L'); if ($invoice_customer->dni != NULL) { $pdf->Cell($width, 10, self::l('Tax ID number:') . ' ' . Tools::iconv('utf-8', self::encoding(), $invoice_customer->dni), 0, 'L'); } if (!empty($delivery_address->phone_mobile)) { $pdf->Ln(5); $pdf->Cell($width, 10, $delivery_address->phone_mobile, 0, 'L'); } /* * display order information */ $carrier = new Carrier(self::$order->id_carrier); if ($carrier->name == '0') { $carrier->name = Configuration::get('PS_SHOP_NAME'); } $history = self::$order->getHistory(self::$order->id_lang); foreach ($history as $h) { if ($h['id_order_state'] == _PS_OS_SHIPPING_) { $shipping_date = $h['date_add']; } } $pdf->Ln(12); $pdf->SetFillColor(240, 240, 240); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont(self::fontname(), '', 9); if (self::$orderSlip) { $pdf->Cell(0, 6, self::l('SLIP #') . sprintf('%06d', self::$orderSlip->id) . ' ' . self::l('from') . ' ' . Tools::displayDate(self::$orderSlip->date_upd, self::$order->id_lang), 1, 2, 'L', 1); } elseif (self::$delivery) { $pdf->Cell(0, 6, self::l('DELIVERY SLIP #') . Configuration::get('PS_DELIVERY_PREFIX', intval($cookie->id_lang)) . sprintf('%06d', self::$delivery) . ' ' . self::l('from') . ' ' . Tools::displayDate(self::$order->delivery_date, self::$order->id_lang), 1, 2, 'L', 1); } else { $pdf->Cell(0, 6, self::l('INVOICE #') . Configuration::get('PS_INVOICE_PREFIX', intval($cookie->id_lang)) . sprintf('%06d', self::$order->invoice_number) . ' ' . self::l('from') . ' ' . Tools::displayDate(self::$order->invoice_date, self::$order->id_lang), 1, 2, 'L', 1); } $pdf->Cell(55, 6, self::l('Order #') . sprintf('%06d', self::$order->id), 'L', 0); $pdf->Cell(70, 6, self::l('Carrier:') . ($order->gift ? ' ' . Tools::iconv('utf-8', self::encoding(), $carrier->name) : ''), 'L'); $pdf->Cell(0, 6, self::l('Payment method:'), 'LR'); $pdf->Ln(5); $pdf->Cell(55, 6, isset($shipping_date) ? self::l('Shipping date:') . ' ' . Tools::displayDate($shipping_date, self::$order->id_lang) : ' ', 'LB', 0); $pdf->Cell(70, 6, $order->gift ? self::l('Gift-wrapped order') : Tools::iconv('utf-8', self::encoding(), $carrier->name), 'LRB'); $pdf->Cell(0, 6, Tools::iconv('utf-8', self::encoding(), $order->payment), 'LRB'); $pdf->Ln(15); $pdf->ProdTab(self::$delivery ? true : ''); /* Exit if delivery */ if (!self::$delivery) { if (!self::$orderSlip) { $pdf->DiscTab(); } $priceBreakDown = array(); $pdf->priceBreakDownCalculation($priceBreakDown); if (!self::$orderSlip or self::$orderSlip and self::$orderSlip->shipping_cost) { $priceBreakDown['totalWithoutTax'] += Tools::ps_round($priceBreakDown['shippingCostWithoutTax'], 2) + Tools::ps_round($priceBreakDown['wrappingCostWithoutTax'], 2); $priceBreakDown['totalWithTax'] += self::$order->total_shipping + self::$order->total_wrapping; } if (!self::$orderSlip) { $taxDiscount = self::$order->getTaxesAverageUsed(); if ($taxDiscount != 0) { $priceBreakDown['totalWithoutTax'] -= Tools::ps_round(self::$order->total_discounts / (1 + self::$order->getTaxesAverageUsed() * 0.01), 2); } else { $priceBreakDown['totalWithoutTax'] -= self::$order->total_discounts; } $priceBreakDown['totalWithTax'] -= self::$order->total_discounts; } /* * Display price summation */ if (Configuration::get('PS_TAX') or $order->total_products_wt != $order->total_products) { $pdf->Ln(5); $pdf->SetFont(self::fontname(), 'B', 8); $width = 165; $pdf->Cell($width, 0, self::l('Total products (tax excl.)') . ' : ', 0, 0, 'R'); $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice($priceBreakDown['totalProductsWithoutTax'], self::$currency, true, false)), 0, 0, 'R'); $pdf->Ln(4); $pdf->SetFont(self::fontname(), 'B', 8); $width = 165; $pdf->Cell($width, 0, self::l('Total products (tax incl.)') . ' : ', 0, 0, 'R'); $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice($priceBreakDown['totalProductsWithTax'], self::$currency, true, false)), 0, 0, 'R'); $pdf->Ln(4); } else { $pdf->Ln(5); $pdf->SetFont(self::fontname(), 'B', 8); $width = 165; $pdf->Cell($width, 0, self::l('Total products ') . ' : ', 0, 0, 'R'); $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice($priceBreakDown['totalProductsWithoutTax'], self::$currency, true, false)), 0, 0, 'R'); $pdf->Ln(4); } if (!self::$orderSlip and self::$order->total_discounts != '0.00') { $pdf->Cell($width, 0, self::l('Total discounts (tax incl.)') . ' : ', 0, 0, 'R'); $pdf->Cell(0, 0, (!self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice(self::$order->total_discounts, self::$currency, true, false)), 0, 0, 'R'); $pdf->Ln(4); } if (isset(self::$order->total_wrapping) and floatval(self::$order->total_wrapping) > 0) { $pdf->Cell($width, 0, self::l('Total wrapping') . ' : ', 0, 0, 'R'); if (self::$_priceDisplayMethod == PS_TAX_EXC) { $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice($priceBreakDown['wrappingCostWithoutTax'], self::$currency, true, false)), 0, 0, 'R'); } else { $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice(self::$order->total_wrapping, self::$currency, true, false)), 0, 0, 'R'); } $pdf->Ln(4); } if (self::$order->total_shipping != '0.00' and (!self::$orderSlip or self::$orderSlip and self::$orderSlip->shipping_cost)) { $pdf->Cell($width, 0, self::l('Total shipping') . ' : ', 0, 0, 'R'); if (self::$_priceDisplayMethod == PS_TAX_EXC) { $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice(Tools::ps_round($priceBreakDown['shippingCostWithoutTax'], 2), self::$currency, true, false)), 0, 0, 'R'); } else { $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice(self::$order->total_shipping, self::$currency, true, false)), 0, 0, 'R'); } $pdf->Ln(4); } if (Configuration::get('PS_TAX') or $order->total_products_wt != $order->total_products) { $pdf->Cell($width, 0, self::l('Total') . ' ' . (self::$_priceDisplayMethod == PS_TAX_EXC ? self::l(' (tax incl.)') : self::l(' (tax excl.)')) . ' : ', 0, 0, 'R'); $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice(self::$_priceDisplayMethod == PS_TAX_EXC ? $priceBreakDown['totalWithTax'] : $priceBreakDown['totalWithoutTax'], self::$currency, true, false)), 0, 0, 'R'); $pdf->Ln(4); $pdf->Cell($width, 0, self::l('Total') . ' ' . (self::$_priceDisplayMethod == PS_TAX_EXC ? self::l(' (tax excl.)') : self::l(' (tax incl.)')) . ' : ', 0, 0, 'R'); $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice(self::$_priceDisplayMethod == PS_TAX_EXC ? $priceBreakDown['totalWithoutTax'] : $priceBreakDown['totalWithTax'], self::$currency, true, false)), 0, 0, 'R'); $pdf->Ln(4); } else { $pdf->Cell($width, 0, self::l('Total') . ' : ', 0, 0, 'R'); $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice($priceBreakDown['totalWithoutTax'], self::$currency, true, false)), 0, 0, 'R'); $pdf->Ln(4); } if ($ecotax != '0.00' and !self::$orderSlip) { $pdf->Cell($width, 0, self::l('Eco-participation') . ' : ', 0, 0, 'R'); $pdf->Cell(0, 0, self::convertSign(Tools::displayPrice($ecotax, self::$currency, true, false)), 0, 0, 'R'); $pdf->Ln(5); } $pdf->TaxTab($priceBreakDown); } Hook::PDFInvoice($pdf, self::$order->id); if (!$multiple) { return $pdf->Output(sprintf('%06d', self::$order->id) . '.pdf', $mode); } }
public function basket() { $this->start = $this->input->get('start'); $this->end = $this->input->get('end'); $this->view = ""; if (isset($_GET['view']) && $_GET['view'] != "") { $this->view = pnp::clean($_GET['view']); } $this->data->getTimeRange($this->start, $this->end, $this->view); $basket = $this->session->get("basket"); if (is_array($basket) && sizeof($basket) > 0) { foreach ($basket as $item) { # explode host::service::source $slices = explode("::", $item); if (sizeof($slices) == 2) { $this->data->buildDataStruct($slices[0], $slices[1], $this->view); } if (sizeof($slices) == 3) { $this->data->buildDataStruct($slices[0], $slices[1], $this->view, $slices[2]); } } } //echo Kohana::debug($this->data->STRUCT); /* * PDF Output */ $pdf = new PDF(); $pdf->AliasNbPages(); $pdf->SetAutoPageBreak('off'); $pdf->SetMargins(17.5, 30, 10); $pdf->AddPage(); if ($this->use_bg) { $pdf->setSourceFile($this->config->conf['background_pdf']); $tplIdx = $pdf->importPage(1, '/MediaBox'); $pdf->useTemplate($tplIdx); } $pdf->SetCreator('Created with PNP'); $pdf->SetFont('Arial', '', 10); // Title foreach ($this->data->STRUCT as $data) { if ($pdf->GetY() > 200) { $pdf->AddPage(); if ($this->use_bg) { $pdf->useTemplate($tplIdx); } } if ($data['LEVEL'] == 0) { $pdf->SetFont('Arial', '', 12); $pdf->CELL(120, 10, $data['MACRO']['DISP_HOSTNAME'] . " -- " . $data['MACRO']['DISP_SERVICEDESC'], 0, 1); $pdf->SetFont('Arial', '', 10); $pdf->CELL(120, 5, $data['TIMERANGE']['title'] . " (" . $data['TIMERANGE']['f_start'] . " - " . $data['TIMERANGE']['f_end'] . ")", 0, 1); $pdf->SetFont('Arial', '', 8); $pdf->CELL(120, 5, "Datasource " . $data["ds_name"], 0, 1); } else { $pdf->SetFont('Arial', '', 8); $pdf->CELL(120, 5, "Datasource " . $data["ds_name"], 0, 1); } $image = $this->rrdtool->doImage($data['RRD_CALL'], $out = 'PDF'); $img = $this->rrdtool->saveImage($image); $Y = $pdf->GetY(); $cell_height = $img['height'] * 0.23; $cell_width = $img['width'] * 0.23; $pdf->Image($img['file'], 17.5, $Y, $cell_width, $cell_height, 'PNG'); $pdf->CELL(120, $cell_height, '', 0, 1); unlink($img['file']); } $pdf->Output("pnp4nagios.pdf", "I"); }
/** * Main * * @param object $order Order * @param string $mode Download or display (optional) */ public static function invoice($order, $mode = 'D', $multiple = false, &$pdf = NULL, $slip = false, $delivery = false) { global $cookie; if (!Validate::isLoadedObject($order) or !$cookie->id_employee and (!OrderState::invoiceAvailable($order->getCurrentState()) and !$order->invoice_number)) { die('Invalid order or invalid order state'); } self::$order = $order; self::$orderSlip = $slip; self::$delivery = $delivery; self::$_iso = strtoupper(Language::getIsoById((int) self::$order->id_lang)); if ((self::$_priceDisplayMethod = $order->getTaxCalculationMethod()) === false) { die(self::l('No price display method defined for the customer group')); } if (!$multiple) { $pdf = new PDF('P', 'mm', 'A4'); } $pdf->SetAutoPageBreak(true, 35); $pdf->StartPageGroup(); self::$currency = Currency::getCurrencyInstance((int) self::$order->id_currency); $pdf->AliasNbPages(); $pdf->AddPage(); $width = 100; $pdf->SetX(10); $pdf->SetY(25); $pdf->SetFont(self::fontname(), '', 12); $pdf->Cell($width, 10, self::l('Delivery'), 0, 'L'); $pdf->Cell($width, 10, self::l('Invoicing'), 0, 'L'); $pdf->Ln(5); $pdf->SetFont(self::fontname(), '', 9); $addressType = array('delivery' => array(), 'invoice' => array()); $patternRules = array('optional' => array('address2', 'company'), 'avoid' => array('State:iso_code')); $addressType = self::generateHeaderAddresses($pdf, $order, $addressType, $patternRules, $width); if (Configuration::get('VATNUMBER_MANAGEMENT') and !empty($addressType['invoice']['addressObject']->vat_number)) { $vat_delivery = ''; if ($addressType['invoice']['addressObject']->id != $addressType['delivery']['addressObject']->id) { $vat_delivery = $addressType['delivery']['addressObject']->vat_number; } $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $vat_delivery), 0, 'L'); $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $addressType['invoice']['addressObject']->vat_number), 0, 'L'); $pdf->Ln(5); } if ($addressType['invoice']['addressObject']->dni != NULL) { $pdf->Cell($width, 10, self::l('Tax ID number:') . ' ' . Tools::iconv('utf-8', self::encoding(), $addressType['invoice']['addressObject']->dni), 0, 'L'); } /* * display order information */ $carrier = new Carrier(self::$order->id_carrier); if ($carrier->name == '0') { $carrier->name = Configuration::get('PS_SHOP_NAME'); } $history = self::$order->getHistory(self::$order->id_lang); foreach ($history as $h) { if ($h['id_order_state'] == Configuration::get('PS_OS_SHIPPING')) { $shipping_date = $h['date_add']; } } $pdf->Ln(12); $pdf->SetFillColor(240, 240, 240); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont(self::fontname(), '', 9); if (self::$orderSlip) { $pdf->Cell(0, 6, self::l('SLIP #') . ' ' . sprintf('%06d', self::$orderSlip->id) . ' ' . self::l('from') . ' ' . Tools::displayDate(self::$orderSlip->date_upd, self::$order->id_lang), 1, 2, 'L', 1); } elseif (self::$delivery) { $pdf->Cell(0, 6, self::l('DELIVERY SLIP #') . Tools::iconv('utf-8', self::encoding(), Configuration::get('PS_DELIVERY_PREFIX', (int) $cookie->id_lang)) . sprintf('%06d', self::$delivery) . ' ' . self::l('from') . ' ' . Tools::displayDate(self::$order->delivery_date, self::$order->id_lang), 1, 2, 'L', 1); } elseif ((int) self::$order->invoice_date) { $pdf->Cell(0, 6, self::l('INVOICE #') . ' ' . Tools::iconv('utf-8', self::encoding(), Configuration::get('PS_INVOICE_PREFIX', (int) $cookie->id_lang)) . sprintf('%06d', self::$order->invoice_number) . ' ' . self::l('from') . ' ' . Tools::displayDate(self::$order->invoice_date, self::$order->id_lang), 1, 2, 'L', 1); } else { $pdf->Cell(0, 6, self::l('Invoice draft'), 1, 2, 'L', 1); } $pdf->Cell(55, 6, self::l('Order #') . ' ' . sprintf('%06d', self::$order->id), 'L', 0); $pdf->Cell(70, 6, self::l('Carrier:') . ($order->gift ? ' ' . Tools::iconv('utf-8', self::encoding(), $carrier->name) : ''), 'L'); $pdf->Cell(0, 6, self::l('Payment method:'), 'LR'); $pdf->Ln(5); $pdf->Cell(55, 6, isset($shipping_date) ? self::l('Shipping date:') . ' ' . Tools::displayDate($shipping_date, self::$order->id_lang) : ' ', 'LB', 0); $pdf->Cell(70, 6, $order->gift ? self::l('Gift-wrapped order') : Tools::iconv('utf-8', self::encoding(), $carrier->name), 'LRB'); $pdf->Cell(0, 6, Tools::iconv('utf-8', self::encoding(), $order->payment), 'LRB'); $pdf->Ln(15); $pdf->ProdTab(self::$delivery ? true : ''); /* Canada */ $taxable_address = new Address((int) self::$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); if (!self::$delivery && strtoupper(Country::getIsoById((int) $taxable_address->id_country)) == 'CA') { $pdf->Ln(15); $taxToDisplay = Db::getInstance()->ExecuteS('SELECT * FROM ' . _DB_PREFIX_ . 'order_tax WHERE id_order = ' . (int) self::$order->id); foreach ($taxToDisplay as $t) { $pdf->Cell(0, 6, utf8_decode($t['tax_name']) . ' (' . number_format($t['tax_rate'], 2, '.', '') . '%) ' . self::convertSign(Tools::displayPrice($t['amount'], self::$currency, true)), 0, 0, 'R'); $pdf->Ln(5); } } /* End */ /* Exit if delivery */ if (!self::$delivery) { if (!self::$orderSlip) { $pdf->DiscTab(); } $priceBreakDown = array(); $pdf->priceBreakDownCalculation($priceBreakDown); if (!self::$orderSlip or self::$orderSlip and self::$orderSlip->shipping_cost) { $priceBreakDown['totalWithoutTax'] += Tools::ps_round($priceBreakDown['shippingCostWithoutTax'], 2) + Tools::ps_round($priceBreakDown['wrappingCostWithoutTax'], 2); $priceBreakDown['totalWithTax'] += self::$order->total_shipping + self::$order->total_wrapping; } if (!self::$orderSlip) { $taxDiscount = self::$order->getTaxesAverageUsed(); if ($taxDiscount != 0) { $priceBreakDown['totalWithoutTax'] -= Tools::ps_round(self::$order->total_discounts / (1 + self::$order->getTaxesAverageUsed() * 0.01), 2); } else { $priceBreakDown['totalWithoutTax'] -= self::$order->total_discounts; } $priceBreakDown['totalWithTax'] -= self::$order->total_discounts; } /* * Display price summation */ if (Configuration::get('PS_TAX') or $order->total_products_wt != $order->total_products) { $pdf->Ln(5); $pdf->SetFont(self::fontname(), 'B', 8); $width = 165; $pdf->Cell($width, 0, self::l('Total products (tax excl.)') . ' : ', 0, 0, 'R'); $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice($priceBreakDown['totalProductsWithoutTax'], self::$currency, true)), 0, 0, 'R'); $pdf->Ln(4); $pdf->SetFont(self::fontname(), 'B', 8); $width = 165; $pdf->Cell($width, 0, self::l('Total products (tax incl.)') . ' : ', 0, 0, 'R'); $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice($priceBreakDown['totalProductsWithTax'], self::$currency, true)), 0, 0, 'R'); $pdf->Ln(4); } else { $pdf->Ln(5); $pdf->SetFont(self::fontname(), 'B', 8); $width = 165; $pdf->Cell($width, 0, self::l('Total products ') . ' : ', 0, 0, 'R'); $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice($priceBreakDown['totalProductsWithoutTax'], self::$currency, true)), 0, 0, 'R'); $pdf->Ln(4); } if (!self::$orderSlip and self::$order->total_discounts != '0.00') { $pdf->Cell($width, 0, self::l('Total discounts (tax incl.)') . ' : ', 0, 0, 'R'); $pdf->Cell(0, 0, (!self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice(self::$order->total_discounts, self::$currency, true)), 0, 0, 'R'); $pdf->Ln(4); } if (isset(self::$order->total_wrapping) and (double) self::$order->total_wrapping > 0) { $pdf->Cell($width, 0, self::l('Total gift-wrapping') . ' : ', 0, 0, 'R'); if (self::$_priceDisplayMethod == PS_TAX_EXC) { $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice($priceBreakDown['wrappingCostWithoutTax'], self::$currency, true)), 0, 0, 'R'); } else { $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice(self::$order->total_wrapping, self::$currency, true)), 0, 0, 'R'); } $pdf->Ln(4); } if (self::$order->total_shipping != '0.00' and (!self::$orderSlip or self::$orderSlip and self::$orderSlip->shipping_cost)) { if (self::$_priceDisplayMethod == PS_TAX_EXC) { $pdf->Cell($width, 0, self::l('Total shipping (tax excl.)') . ' : ', 0, 0, 'R'); $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice(Tools::ps_round($priceBreakDown['shippingCostWithoutTax'], 2), self::$currency, true)), 0, 0, 'R'); } else { $pdf->Cell($width, 0, self::l('Total shipping (tax incl.)') . ' : ', 0, 0, 'R'); $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice(self::$order->total_shipping, self::$currency, true)), 0, 0, 'R'); } $pdf->Ln(4); } if (Configuration::get('PS_TAX') or $order->total_products_wt != $order->total_products) { $pdf->Cell($width, 0, self::l('Total') . ' ' . (self::$_priceDisplayMethod == PS_TAX_EXC ? self::l(' (tax incl.)') : self::l(' (tax excl.)')) . ' : ', 0, 0, 'R'); $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice(self::$_priceDisplayMethod == PS_TAX_EXC ? $priceBreakDown['totalWithTax'] : $priceBreakDown['totalWithoutTax'], self::$currency, true)), 0, 0, 'R'); $pdf->Ln(4); $pdf->Cell($width, 0, self::l('Total') . ' ' . (self::$_priceDisplayMethod == PS_TAX_EXC ? self::l(' (tax excl.)') : self::l(' (tax incl.)')) . ' : ', 0, 0, 'R'); $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice(self::$_priceDisplayMethod == PS_TAX_EXC ? $priceBreakDown['totalWithoutTax'] : $priceBreakDown['totalWithTax'], self::$currency, true)), 0, 0, 'R'); $pdf->Ln(4); } else { $pdf->Cell($width, 0, self::l('Total') . ' : ', 0, 0, 'R'); $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '') . self::convertSign(Tools::displayPrice($priceBreakDown['totalWithoutTax'], self::$currency, true)), 0, 0, 'R'); $pdf->Ln(4); } $pdf->TaxTab($priceBreakDown); } Hook::PDFInvoice($pdf, self::$order->id); if (!$multiple) { return $pdf->Output(sprintf('%06d', self::$order->id) . '.pdf', $mode); } }
$footer_text ="Please pay upon receipt (within 7 days) to avoid late payment charge. 2% Interest charge on late payments. $25 Administration fee for NSF cheques"; $this->Write(5,$footer_text); } } // Instanciation of inherited class $header = array('Ord Date','Ord ID','Service','Pickup Company Name','Shipping Company Name','Ord Value'); $printtotal = 1005; $pdf = new PDF(); $pdf->SetAutoPageBreak(true, 28); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('Times','',12); //$pdf->Write( 4,"To, \n$address1\n$address2\n$address3$ln$city - $pin."); //$address = getAddressBookPermanetn($_POST['cus_already_bill']); $noaddress = false; $stnoname = "Street name"; $prov = "Prov"; $postal = "600110";
$order_str = 'alliance_honor DESC'; } elseif ($order == 'points_avg') { $order_str = 'alliance_rank_points_avg ASC'; } $listquery = $db->query('SELECT alliance_tag, alliance_name, alliance_member, alliance_planets, alliance_honor, alliance_points FROM alliance ORDER BY ' . $order_str); $anfang = '<table><tr><td width="75">' . $place . '</td><td width="100">Tag:</td><td width="250">' . $name . '</td><td width="100">' . $members . '</td><td width="100">' . $planets . '</td><td width="85">' . $honor . '</td><td width="85">' . $points . '</td><td width="85">' . $pointsavg . '</td></tr>'; $ende = '</table>'; $pdf = new PDF(); //$pdf->SetAuthor($game->player['user_name']); $pdf->SetAuthor('http://www.stfc.it'); $pdf->SetTitle($config['site_url']); $pdf->AddPage(L); $pdf->SetFont('arial', '', 16); $pdf->SetTextColor(250, 0, 0); $pdf->Cell(0, 10, $allyrank, 'B', 1); $pdf->Ln(0.15); $pdf->SetFont('Arial', 'I', 8); $pdf->SetTextColor(0, 0, 0); $pdf->MultiCell(0, 7, $created . date('d.m.y H:i', time()) . '', 0, 'R'); $pdf->SetAutoPageBreak(true, 15.0); $pdf->SetFont('Arial', '', 12); $pdf->WriteHTML($anfang); while (($alliance = $db->fetchrow($listquery)) != false) { $gen = '<tr><td>' . $rang_alliance . '.</td><td>' . $alliance['alliance_tag'] . '</td><td>' . $alliance['alliance_name'] . '</td><td>' . $alliance['alliance_member'] . '</td><td>' . $alliance['alliance_planets'] . '</td><td>' . ($alliance['alliance_honor'] < 1 ? '-' : '' . $user['alliance_honor'] . '') . '</td><td>' . $alliance['alliance_points'] . '</td><td>' . round($alliance['alliance_points'] / $alliance['alliance_member']) . '</td></tr>'; $pdf->WriteHTML($gen); $rang_alliance++; } $pdf->WriteHTML($ende); $pdf->Output(); } }