public function save_table($options) { if (!$this->table_header) { foreach (array_keys($this->table_rows[0]) as $k) { $this->table_header[$k] = ''; } } $this->pdf->ezTable($this->table_rows, $this->table_header, '', $options); }
/** * Genera una tabla para impresion en pdf * * @param array $datos arreglo asociativo el cual contiene: * 'datos_tabla' => arreglo estilo recordset, donde cada elemento del mismo es un arreglo asociativo 'nombre_columna' => 'valor' * 'titulo_tabla' => texto con el titulo de la tabla * 'titulos_columnas' => arreglo asociativo 'nombre_columna' => 'descripcion_columna' * @param boolean $ver_titulos_col indica si se imprimiran los titulos de las columnas, por defecto no * @param integer $tamanio tamaño de la letra de la tabla * @param array $opciones arreglo asociativo con estilos de la tabla */ function tabla($datos, $ver_titulos_col = false, $tamanio = 8, $opciones = array()) { $ver_tit_col = $ver_titulos_col ? 1 : 0; $texto_tit_col = isset($datos['titulos_columnas']) ? $datos['titulos_columnas'] : ''; $texto_titulo_tabla = isset($datos['titulo_tabla']) ? $datos['titulo_tabla'] : ''; $opciones_def = array('splitRows' => 0, 'rowGap' => 1, 'showHeadings' => $ver_tit_col, 'titleFontSize' => 9, 'fontSize' => $tamanio, 'shadeCol' => array(0.9, 0.9, 0.9), 'outerLineThickness' => 0.7, 'innerLineThickness' => 0.7, 'xOrientation' => 'center', 'maxWidth' => $this->get_ancho(100)); $opciones = array_merge($opciones_def, $opciones); $this->pdf->ezTable($datos['datos_tabla'], $texto_tit_col, $texto_titulo_tabla, $opciones); }
function generar_pdf() { require_once toba_dir() . '/php/3ros/ezpdf/class.ezpdf.php'; $pdf = new Cezpdf(); $pdf->selectFont(toba_dir() . '/php/3ros/ezpdf/fonts/Helvetica.afm'); $pdf->ezText('Ejemplo Firma Digital. Tiene dos attachments XML', 14); //-- Cuadro con datos $opciones = array('splitRows' => 0, 'rowGap' => 1, 'showHeadings' => true, 'titleFontSize' => 9, 'fontSize' => 10, 'shadeCol' => array(0.9, 0.9, 0.9), 'outerLineThickness' => 0.7, 'innerLineThickness' => 0.7, 'xOrientation' => 'center', 'width' => 500); $this->s__datos_juegos = toba::db()->consultar("SELECT * from ref_juegos"); $pdf->ezTable($this->s__datos_juegos, '', 'Juegos', $opciones); $this->s__datos_deportes = toba::db()->consultar("SELECT * from ref_deportes"); $pdf->ezTable($this->s__datos_deportes, '', 'Deportes', $opciones); $tmp = $pdf->ezOutput(0); $this->s__pdf = array(); $sesion = get_firmador()->generar_sesion(); $this->s__pdf['path'] = toba::proyecto()->get_path_temp() . "/doc{$sesion}_sinfirma.pdf"; if (!file_put_contents($this->s__pdf['path'], $tmp)) { throw new toba_error("Imposible escribir en '{$this->s__pdf['path']}'. Chequee permisos"); } }
public function bukti($a) { $pdfku = new Cezpdf("A5", 'landscape'); //595.28,841.29 $pdfku->addInfo('Title', 'List Barang'); $pdfku->ezSetCmMargins("3", "3", "3", "3"); $barang = $this->barang->detail_peminjaman($a); $pdfku->ezSetY(100); $pdfku->ezSetDy(230); //$pdfku->addJpegFromFile("icon.jpg",20,300,-1); $pdfku->addText(120, $pdfku->y + 30, 18, "Bukti Peminjaman Inventaris Laboratorium"); $pdfku->addText(160, $pdfku->y + 10, 15, "Komputasi Berbasis Jaringan (KBJ)"); $cols_db = array('id_barang' => 'ID Barang', 'nama_barang' => 'Nama Barang'); $option_db = array('showHeadings' => 2, 'shaded' => 0, 'xPos' => 'center', 'xOrientation' => 'center', 'fontSize' => 12, 'cols' => array('id_barang' => array('justification' => 'center', 'width' => '120'), 'nama_barang' => array('justification' => 'center', 'width' => '120'))); $pdfku->ezTable($barang, $cols_db, '', $option_db); $pdfku->addText(100, $pdfku->y - 40, 12, "Mengetahui "); $pdfku->addText(90, $pdfku->y - 60, 12, "Administrator Lab"); $pdfku->addText(400, $pdfku->y - 60, 12, "Kepala Laboratorium"); $pdfku->addText(80, $pdfku->y - 130, 10, "__________________"); $pdfku->addText(400, $pdfku->y - 130, 10, "__________________"); $pdfku->ezStream(); }
$pdf->ezSetCmMargins(1.5, 1, 2, 3); $pdf->addJpegFromFile("../img/o.jpg", 50, 750, 100); $folio = trim($_GET['folio']); $result = mysql_query("select folio,fecha,c.nombre_contacto,total,\n\tconcat(nombre,' ',e.apellido_paterno,' ',e.apellido_materno) as nombre \n\tfrom ventas v inner join clientes c on c.matricula = v.cliente \n\tinner join empleados e on e.matricula = v.empleado \n\twhere v.status = 'PAGADA' and folio = '" . $folio . "' "); while ($datatmp = mysql_fetch_array($result)) { $datos = $datatmp['nombre_contacto']; $total = $datatmp['total']; $emp = $datatmp['nombre']; $data[] = array_merge($datatmp, array('folio')); } $options = array('shadeHeadingCol' => array(0.6, 0.6, 0.5), 'shadeCol' => array(0.9, 0.9, 0.9), 'xOrientation' => 'right', 'width' => 70, 'fontSize' => 8, 'xPos' => 480); $titlef = array('folio' => '<b>Folio</b>'); $titles = array('fecha' => '<b>Fecha</b>'); $titlet = array('total' => '<b>Total</b>'); $pdf->ezText("\n", 10); $pdf->ezTable($data, $titlef, '', $options); $pdf->ezText("\n", 10); $pdf->ezTable($data, $titles, '', $options); $pdf->ezText("\n", 10); $pdf->addText(50, 700, 12, "<b>Atendio: </b>\n"); $pdf->addText(100, 700, 12, $emp); $pdf->addText(50, 680, 12, "<b>Cliente: </b>\n"); $pdf->addText(100, 680, 12, $datos); //RECUPERANDO DETALLE DE VENTA $sql = mysql_query("select dv.cantidad,p.nombre,dv.precio,dv.subtotal \n \t\tfrom detalle_venta dv\n \t\tinner join platillos p on p.id_platillo = dv.clave_producto \n \t\twhere folio = '" . $folio . "' "); while ($row = mysql_fetch_array($sql)) { $dat[] = array_merge($row); } $optionsdv = array('shadeHeadingCol' => array(0.6, 0.6, 0.5), 'shadeCol' => array(0.9, 0.9, 0.9), 'xOrientation' => 'center', 'width' => 500, 'fontSize' => 10, 'xPos' => 'center', 'cols' => array('cantidad' => array('justification' => 'center'), 'nombre' => array('justification' => 'center'), 'precio' => array('justification' => 'center'), 'subtotal' => array('justification' => 'center'))); $titledv = array('cantidad' => '<b>Cantidad</b>', 'nombre' => '<b>Descripción</b>', 'precio' => '<b>Precio</b>', 'subtotal' => '<b>SubTotal</b>'); $pdf->ezTable($dat, $titledv, '', $optionsdv);
if (@$_REQUEST['action'] == "getpdf") { mysql_connect("localhost", "root", ""); mysql_select_db("cdcol"); include 'Cezpdf.php'; $pdf = new Cezpdf(); $pdf->selectFont('/Applications/XAMPP/xamppfiles/lib/php/fonts/Helvetica.afm'); $pdf->ezText('CD Collection', 14); $pdf->ezText('Copyright 2002-2013 Kai Seidler, oswald@apachefriends.org, GPL', 10); $pdf->ezText('', 12); $result = mysql_query("SELECT id,titel,interpret,jahr FROM cds ORDER BY interpret;"); $i = 0; while ($row = mysql_fetch_array($result)) { $data[$i] = array('interpret' => $row['interpret'], 'titel' => $row['titel'], 'jahr' => $row['jahr']); $i++; } $pdf->ezTable($data, "", "", array('width' => 500)); $pdf->ezStream(); exit; } include "langsettings.php"; ?> <html> <head> <title>apachefriends.org cd collection</title> <link href="xampp.css" rel="stylesheet" type="text/css"> </head> <body> <p> <h1><?php
$pdf->selectFont($font_dir . '/Helvetica.afm'); $pdf->ezText(w2PgetConfig('company_name'), 12); if ($log_all) { $date = new w2p_Utilities_Date(); $pdf->ezText("\nAll hours as of " . $date->format($df), 8); } else { $sdate = new w2p_Utilities_Date($log_start_date); $edate = new w2p_Utilities_Date($log_end_date); $pdf->ezText("\nHours from " . $sdate->format($df) . ' to ' . $edate->format($df), 8); } $pdf->selectFont($font_dir . '/Helvetica-Bold.afm'); $pdf->ezText("\n" . $AppUI->_('Overall Report'), 12); foreach ($allpdfdata as $company => $data) { $title = $company; $options = array('showLines' => 1, 'showHeadings' => 0, 'fontSize' => 8, 'rowGap' => 2, 'colGap' => 5, 'xPos' => 50, 'xOrientation' => 'right', 'width' => '500', 'cols' => array(0 => array('justification' => 'left', 'width' => 250), 1 => array('justification' => 'right', 'width' => 120))); $pdf->ezTable($data, null, $title, $options); } $w2pReport = new CReport(); if ($fp = fopen($temp_dir . '/' . $w2pReport->getFilename() . '.pdf', 'wb')) { fwrite($fp, $pdf->ezOutput()); fclose($fp); echo '<a href="' . W2P_BASE_URL . '/files/temp/' . $w2pReport->getFilename() . '.pdf" target="pdf">'; echo $AppUI->_('View PDF File'); echo '</a>'; } else { echo 'Could not open file to save PDF. '; if (!is_writable($temp_dir)) { 'The files/temp directory is not writable. Check your file system permissions.'; } } }
$data = array_merge($data, array(array('RESULTADO' => "NO SE ESPECIFICÓ EL GRUPO A RECUPERAR"))); } $retirados = ""; $orientIzq = array("left" => 0); $justCentro = array("justification" => "center"); $estilo1 = array("justification" => "left", "leading" => 8); $estilo2 = array("left" => 0, "leading" => 12); $estilo3 = array("left" => 0, "leading" => 15); $pdf = new Cezpdf("LETTER", "landscape"); $pdf->selectFont("{$ruta_raiz}/include/pdf/fonts/Times-Roman.afm"); $pdf->ezText("RECUPERACION DE LISTADO \n\n", 15, $justCentro); $pdf->ezText("Dependencia: {$dependencia} \n", 12, $estilo1); $pdf->ezText("Usuario Responsable: " . $objUsuario->get_usua_nomb() . " \n", 12, $estilo1); $pdf->ezText("Fecha: {$fechaRadGrupo} \n", 12, $estilo1); $pdf->ezText("\n\n\n ", 6, $estilo1); $pdf->ezTable($data, '', '', array('fontSize' => 6, 'width' => 700)); //Var para almacenar la hora con formato $hora = date("H") . "_" . date("i") . "_" . date("s"); // var que almacena el dia de la fecha $ddate = date('d'); // var que almacena el mes de la fecha $mdate = date('m'); // var que almacena el año de la fecha $adate = date('Y'); // var que almacena la fecha formateada $fecha = $adate . "_" . $mdate . "_" . $ddate; //guarda el path del archivo generado $archivo = "{$ruta_raiz}/bodega/masiva/tmp_{$usua_doc}" . "_{$fecha}" . "_{$hora}.pdf"; //Referencia el PDF a generar $pdfcode = $pdf->ezOutput(); $fp = fopen($archivo, 'wb');
public function pdfObservations($result) { global $loggedUser, $dateformat, $instDir, $objObservation, $objObserver, $objInstrument, $objLocation, $objPresentations, $objObject, $objFilter, $objEyepiece, $objLens; $result = $this->sortResult($result); $pdf = new Cezpdf('a4', 'portrait'); $pdf->ezStartPageNumbers(300, 30, 10); $pdf->selectFont($instDir . 'lib/fonts/Helvetica.afm'); $pdf->ezText(utf8_decode(html_entity_decode($_GET['pdfTitle'])) . "\n"); $i = 0; while (list($key, $value) = each($result)) { if ($i++ > 0) { $pdf->ezNewPage(); } $obs = $objObservation->getAllInfoDsObservation($value['observationid']); $object = $objObject->getAllInfoDsObject($obs['objectname']); if ($loggedUser && $objObserver->getObserverProperty($loggedUser, 'UT')) { $date = sscanf($obs["date"], "%4d%2d%2d"); } else { $date = sscanf($obs["localdate"], "%4d%2d%2d"); } if ($obs['seeing'] > -1) { $seeing = true; } else { $seeing = false; } $formattedDate = date($dateformat, mktime(0, 0, 0, $date[1], $date[2], $date[0])); $temp = array("Name" => html_entity_decode(LangPDFMessage1) . " : " . $obs['objectname'], "altname" => html_entity_decode(LangPDFMessage2) . " : " . $object["altname"], "type" => $GLOBALS[$object['type']] . html_entity_decode(LangPDFMessage12) . $GLOBALS[$object['con']], "visibility" => $obs['visibility'] ? html_entity_decode(LangViewObservationField22) . " : " . $GLOBALS['Visibility' . $obs['visibility']] : '', "seeing" => $seeing ? LangViewObservationField6 . " : " . $GLOBALS['Seeing' . $obs['seeing']] : '', "limmag" => $obs['limmag'] ? LangViewObservationField7 . " : " . $obs['limmag'] : '', "filter" => $obs['filterid'] ? LangViewObservationField31 . " : " . $objFilter->getFilterPropertyFromId($obs['filterid'], 'name') : '', "eyepiece" => $obs['eyepieceid'] ? LangViewObservationField30 . " : " . $objEyepiece->getEyepiecePropertyFromId($obs['eyepieceid'], 'name') : '', "lens" => $obs['lensid'] ? LangViewObservationField32 . " : " . $objLens->getLensPropertyFromId($obs['lensid'], 'name') : '', "observer" => html_entity_decode(LangPDFMessage13) . $objObserver->getObserverProperty($obs['observerid'], 'firstname') . " " . $objObserver->getObserverProperty($obs['observerid'], 'name') . html_entity_decode(LangPDFMessage14) . $formattedDate, "instrument" => html_entity_decode(LangPDFMessage11) . " : " . $objInstrument->getInstrumentPropertyFromId($obs['instrumentid'], 'name'), "location" => html_entity_decode(LangPDFMessage10) . " : " . $objLocation->getLocationPropertyFromId($obs['locationid'], 'name'), "description" => $objPresentations->br2nl(html_entity_decode($obs['description'])), "desc" => html_entity_decode(LangPDFMessage15)); $obs1[] = $temp; $nm = $obs['objectname']; if ($object["altname"]) { $nm = $nm . " (" . $object["altname"] . ")"; } $pdf->ezText($nm, "14"); $tmp = array(array("type" => $temp["type"])); $pdf->ezTable($tmp, array("type" => utf8_decode(html_entity_decode(LangPDFMessage5))), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); $tmp = array(array("location" => $temp["location"], "instrument" => $temp["instrument"])); $pdf->ezTable($tmp, array("location" => utf8_decode(html_entity_decode(LangPDFMessage1)), "instrument" => utf8_decode(html_entity_decode(LangPDFMessage2))), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); $tmp = array(array("eyepiece" => $temp["eyepiece"])); if ($obs['eyepieceid']) { $pdf->ezTable($tmp, array("eyepiece" => "test"), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); } $tmp = array(array("filter" => $temp["filter"])); if ($obs['filterid']) { $pdf->ezTable($tmp, array("filter" => "test"), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); } $tmp = array(array("lens" => $temp["lens"])); if ($obs['lensid']) { $pdf->ezTable($tmp, array("lens" => "test"), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); } $tmp = array(array("seeing" => $temp["seeing"])); if ($seeing) { $pdf->ezTable($tmp, array("seeing" => "test"), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); } $tmp = array(array("limmag" => $temp["limmag"])); if ($obs['limmag']) { $pdf->ezTable($tmp, array("limmag" => "test"), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); } $tmp = array(array("visibility" => $temp["visibility"])); if ($obs['visibility']) { $pdf->ezTable($tmp, array("visibility" => "test"), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); } $tmp = array(array("observer" => $temp["observer"])); $pdf->ezTable($tmp, array("observer" => utf8_decode(html_entity_decode(LangPDFMessage1))), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); $pdf->ezText(utf8_decode(LangPDFMessage15), "12"); $pdf->ezText(""); $tmp = array(array("description" => $temp["description"])); $pdf->ezTable($tmp, array("description" => utf8_decode(html_entity_decode(LangPDFMessage1))), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); if ($objObservation->getDsObservationProperty($value['observationid'], 'hasDrawing')) { $pdf->ezText(""); $pdf->ezImage($instDir . "deepsky/drawings/" . $value['observationid'] . ".jpg", 0, 500, "none", "left"); } $pdf->ezText(""); } $pdf->ezStream(); }
$pdf->closeObject(); // Tampilkan object di semua halaman $pdf->addObject($all, 'all'); // Baca input tanggal yang dikirimkan user $mulai = $_GET[tgl1]; $selesai = $_GET[tgl2]; // Koneksi ke database dan tampilkan datanya // Query untuk merelasikan kedua tabel di filter berdasarkan tanggal $sql = mysql_query("select kd_penj.tanggal,kd_penj.kd_pjl,penjualan.id_product,barang.nama,\n penjualan.harga,penjualan.jumlah,penjualan.subtotal\n from penjualan,kd_penj,barang\n where kd_penj.kd_pjl=penjualan.id_transaksi and barang.kode=penjualan.id_product and kd_penj.tanggal\n\t\t\t\t\t\t\t\t\t\t between '{$mulai}' and '{$selesai}'\n\t\t\t\t\t"); $sum = mysql_fetch_array(mysql_query("SELECT sum(total) as total from \n\t\tkd_penj where tanggal between '{$mulai}' and '{$selesai}'")); $jml = mysql_num_rows($sql); if ($jml > 0) { $i = 1; while ($r = mysql_fetch_array($sql)) { $hargarp = rp($r[4]); $subrp = rp($r[6]); $data[$i] = array('<b>No</b>' => $i, '<b>Tanggal</b>' => $r[0], '<b>Kode Transaksi</b>' => $r[1], '<b>Nama Barang</b>' => $r[3], '<b>Harga</b>' => $hargarp, '<b>Jumlah</b>' => $r[5], '<b>SubTotal</b>' => $subrp); $i++; } $pdf->ezTable($data, '', '', ''); $tot = rp($sum[total]); $pdf->ezText("\n\nTotal keseluruhan : Rp. {$tot}"); $pdf->ezText("Pencarian dari Tanggal {$mulai} s/d {$selesai}"); // Penomoran halaman $pdf->ezStartPageNumbers(320, 15, 8); $pdf->ezStream(); } else { $m = $_POST[tgl_1] . '-' . $_POST[bln_1] . '-' . $_POST[thn_1]; $s = $_POST[tgl_2] . '-' . $_POST[bln_2] . '-' . $_POST[thn_2]; echo "<script>window.alert('Tidak ada laporan Penjualan pada Tanggal {$m} s/d {$s}');\n window.location=('" . $uri . "/apotek/out.php')</script>"; }
} $round = $_SESSION["round" . $dist]; if ($aryCompo = $db->getCompetition($id)) { // $rsHeats = mysql_query("select * from tblRace where competitionId = '$id' and distance = '$dist' and type = '$round' order by number"); $pdf = new Cezpdf(); $pdf->selectFont('./fonts/Helvetica'); $roundname = _('Stafet'); $pdf->ezSetY(830); $pdf->ezText($aryCompo['name'] . " - " . date('d-m-Y', strtotime($aryCompo['date'])), 18, array('justification' => 'center')); $pdf->ezText($roundname . ' ' . gettext_dist($dist), 16, array('justification' => 'center')); $pdf->ezText('', 16, array('justification' => 'center')); $rsSwimmers = $db->teamList($id, $dist); $aryData = array(); $lane = 1; $startTime = 0; while ($arySwimmers = $db->fetch_array($rsSwimmers)) { if ($startTime == 0) { $startTime = $arySwimmers['time']; } $aryData[] = array('Bane' => $lane, 'Klub' => $arySwimmers['cname'], 'Starttal' => round($startTime - $arySwimmers['time'])); $teamSwimmers = $db->teamSwimmers($arySwimmers['id']); while ($swimmer = $db->fetch_array($teamSwimmers)) { $aryData[] = array('Bane' => '', 'Klub' => '- ' . $swimmer['name'], 'Starttal' => ''); } $lane++; } $pdf->ezTable($aryData, array('Bane' => _('Bane'), 'Klub' => _('Hold'), 'Starttal' => _('Starttal')), '', array('xPos' => 57, 'xOrientation' => 'right', 'width' => 481, 'fontSize' => 16, 'titleFontSize' => 18, 'cols' => array('Bane' => array('width' => 54, 'justification' => 'center'), 'Starttal' => array('justification' => 'right', 'width' => 68)))); header("Content-type: application/pdf"); $pdf->ezStream(); } $db->close();
static function imprimeAlumnosXcursada($anio, $carrera) { /* * q hace: genera un array ezTable() con todos los alumnos de una cursada y carrera * previamente seleccionado. * q devuelve: un objeto Cezpdf conteniendo un ezTable() que debe ser abierta por el controlador correspondiente * para generar un pdf en el navegador * */ $pdf = new Cezpdf('a4', 'landscape'); $pdf->selectFont('../librerias/ezPDF/fonts/Helvetica.afm'); $dato = Alumno::alumnosXcursada($anio, $carrera); $pdf->ezTable($dato); //$pdf->ezStream(); esta linea va en el controlador alumno.php en el 'case print:' return $pdf; }
/** * Print generic footer * * @param $type display type (0=HTML, 1=Sylk,2=PDF,3=CSV) * @param $title title of file : used for PDF (default '') * * @return string to display **/ static function showFooter($type, $title = "") { $out = ""; switch ($type) { case self::PDF_OUTPUT_LANDSCAPE: //pdf global $PDF_HEADER, $PDF_ARRAY; $pdf = new Cezpdf('a4', 'landscape'); $pdf->selectFont(GLPI_ROOT . "/lib/ezpdf/fonts/Helvetica.afm"); $nb = count($PDF_ARRAY); $tmptxt = sprintf(_n('%s item', '%s items', $nb), $nb); $pdf->ezStartPageNumbers(750, 10, 10, 'left', "GLPI PDF export - " . Html::convDate(date("Y-m-d")) . " - " . Toolbox::decodeFromUtf8($tmptxt, 'windows-1252') . " - {PAGENUM}/{TOTALPAGENUM}"); $options = array('fontSize' => 8, 'colGap' => 2, 'maxWidth' => 800, 'titleFontSize' => 8); $pdf->ezTable($PDF_ARRAY, $PDF_HEADER, Toolbox::decodeFromUtf8($title, 'windows-1252'), $options); $pdf->ezStream(); break; case self::PDF_OUTPUT_PORTRAIT: //pdf global $PDF_HEADER, $PDF_ARRAY; $pdf = new Cezpdf('a4', 'portrait'); $pdf->selectFont(GLPI_ROOT . "/lib/ezpdf/fonts/Helvetica.afm"); $nb = count($PDF_ARRAY); $tmptxt = sprintf(_n('%s item', '%s items', $nb), $nb); $pdf->ezStartPageNumbers(550, 10, 10, 'left', "GLPI PDF export - " . Html::convDate(date("Y-m-d")) . " - " . Toolbox::decodeFromUtf8($tmptxt, 'windows-1252') . " - {PAGENUM}/{TOTALPAGENUM}"); $options = array('fontSize' => 8, 'colGap' => 2, 'maxWidth' => 565, 'titleFontSize' => 8); $pdf->ezTable($PDF_ARRAY, $PDF_HEADER, Toolbox::decodeFromUtf8($title, 'windows-1252'), $options); $pdf->ezStream(); break; case self::SYLK_OUTPUT: //sylk global $SYLK_HEADER, $SYLK_ARRAY, $SYLK_SIZE; // largeurs des colonnes foreach ($SYLK_SIZE as $num => $val) { $out .= "F;W" . $num . " " . $num . " " . min(50, $val) . "\n"; } $out .= "\n"; // Header foreach ($SYLK_HEADER as $num => $val) { $out .= "F;SDM4;FG0C;" . ($num == 1 ? "Y1;" : "") . "X{$num}\n"; $out .= "C;N;K\"" . self::sylk_clean($val) . "\"\n"; $out .= "\n"; } // Datas foreach ($SYLK_ARRAY as $row => $tab) { foreach ($tab as $num => $val) { $out .= "F;P3;FG0L;" . ($num == 1 ? "Y" . $row . ";" : "") . "X{$num}\n"; $out .= "C;N;K\"" . self::sylk_clean($val) . "\"\n"; } } $out .= "E\n"; break; case self::CSV_OUTPUT: //csv break; default: $out = "</table></div>\n"; } return $out; }
$pdf->addPngFromFile($pathvars["fileroot"] . "/images/net/kleines-wappen.png", 30, 780, 46); $pdf->addPngFromFile($pathvars["fileroot"] . "/images/net/auge.png", 300, 780, 70); // eine linie $pdf->line(20, 770, 560, 770); $pdf->addText(120, 790, '20', '<b>Vermessungsamt</b>'); $pdf->addText(380, 790, '20', '<i>Friedberg</i>'); // seiten nummern $pdf->ezStartPageNumbers(300, 20, 12, '', '', 1); // hier geht es los $pdf->ezSetDy(-60); // spaltenweise ausgabe an $pdf->ezColumnsStart(array("num" => 2, "gap" => 20)); // wichtig: damit der die ausgabe am spaltenbeginn steht #$pdf->ezSetDy(10); // Textblock #$pdf->ezText($text,10,array( "justification" => "full" )); // "leading"=>20, "spacing"=>1 // Tabellen $data = array(array('num' => 1, 'name' => 'gandalf', 'type' => 'wizard'), array('num' => 2, 'name' => 'bilbo', 'type' => 'hobbit', 'url' => 'http://www.ros.co. nz/pdf/'), array('num' => 3, 'name' => 'frodo', 'type' => 'hobbit'), array('num' => 4, 'name' => 'saruman', 'type' => 'bad dude', 'url' => 'http://sourceforge.net/projects/pdf-php'), array('num' => 5, 'name' => 'sauron', 'type' => 'really bad dude')); for ($i = 0; $i <= 20; $i++) { $pdf->ezTable($data, '', '', array("fontSize" => 9, "width" => 260)); } // umbruch $pdf->ezSetDy(-10); // Textblock #$pdf->ezText($text,10,array( "justification" => "full" )); // "leading"=>20, "spacing"=>1 // spaltenweise ausgabe aus $pdf->ezColumnsStop(); // ausgabe $pdf->ezStream(); } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/** * Creates a PDF document and sends this pricelist to the client * * Unfortunately, ezpdf does not return anything after printing the * document, so there's no way to tell whether it has succeeded. * Thus, you should not rely on the return value, except when it is * false -- in that case, loading of some data failed. * @return boolean False on failure, true on supposed success */ function send_as_pdf() { global $objInit, $_ARRAYLANG; if (!$this->load()) { return \Message::error($_ARRAYLANG['TXT_SHOP_PRICELIST_ERROR_LOADING']); } $objPdf = new \Cezpdf('A4'); $objPdf->setEncryption('', '', array('print')); $objPdf->selectFont(\Cx\Core\Core\Controller\Cx::instanciate()->getCodeBaseLibraryPath() . '/ezpdf/fonts/' . $this->font); $objPdf->ezSetMargins(0, 0, 0, 0); // Reset margins $objPdf->setLineStyle(0.5); $marginTop = 30; $biggerCountTop = $biggerCountBottom = 0; $arrHeaderLeft = $arrHeaderRight = $arrFooterLeft = $arrFooterRight = array(); if ($this->header) { // header should be shown $arrHeaderLeft = explode("\n", $this->header_left); $arrHeaderRight = explode("\n", $this->header_right); $countLeft = count($arrHeaderLeft); $countRight = count($arrHeaderRight); $biggerCountTop = $countLeft > $countRight ? $countLeft : $countRight; $marginTop = $biggerCountTop * 14 + 36; } // Bottom margin $marginBottom = 20; $arrFooterRight = array(); if ($this->footer) { // footer should be shown // Old, obsolete: $this->footer_left = str_replace('<--DATE-->', date(ASCMS_DATE_FORMAT_DATE, time()), $this->footer_left); $this->footer_right = str_replace('<--DATE-->', date(ASCMS_DATE_FORMAT_DATE, time()), $this->footer_right); // New: $this->footer_left = str_replace('[DATE]', date(ASCMS_DATE_FORMAT_DATE, time()), $this->footer_left); $this->footer_right = str_replace('[DATE]', date(ASCMS_DATE_FORMAT_DATE, time()), $this->footer_right); $arrFooterLeft = explode("\n", $this->footer_left); $arrFooterRight = explode("\n", $this->footer_right); $countLeft = count($arrFooterLeft); $countRight = count($arrFooterRight); $biggerCountBottom = $countLeft > $countRight ? $countLeft : $countRight; $marginBottom = $biggerCountBottom * 20 + 20; } // Borders if ($this->border) { $linesForAllPages = $objPdf->openObject(); $objPdf->saveState(); $objPdf->setStrokeColor(0, 0, 0, 1); $objPdf->rectangle(10, 10, 575.28, 821.89); $objPdf->restoreState(); $objPdf->closeObject(); $objPdf->addObject($linesForAllPages, 'all'); } // Header $headerArray = array(); $startpointY = 0; if ($this->header) { $objPdf->ezSetY(830); $headerForAllPages = $objPdf->openObject(); $objPdf->saveState(); for ($i = 0; $i < $biggerCountTop; ++$i) { $headerArray[$i] = array('left' => isset($arrHeaderLeft[$i]) ? $arrHeaderLeft[$i] : '', 'right' => isset($arrHeaderRight[$i]) ? $arrHeaderRight[$i] : ''); } $tempY = $objPdf->ezTable($headerArray, '', '', array('showHeadings' => 0, 'fontSize' => $this->font_size_header, 'shaded' => 0, 'width' => 540, 'showLines' => 0, 'xPos' => 'center', 'xOrientation' => 'center', 'cols' => array('right' => array('justification' => 'right')))); $tempY -= 5; if ($this->border) { $objPdf->setStrokeColor(0, 0, 0); $objPdf->line(10, $tempY, 585.28, $tempY); } $startpointY = $tempY - 5; $objPdf->restoreState(); $objPdf->closeObject(); $objPdf->addObject($headerForAllPages, 'all'); } // Footer $pageNumbersX = $pageNumbersY = $pageNumbersFont = 0; if ($this->footer) { $footerForAllPages = $objPdf->openObject(); $objPdf->saveState(); $tempY = $marginBottom - 5; if ($this->border) { $objPdf->setStrokeColor(0, 0, 0); $objPdf->line(10, $tempY, 585.28, $tempY); } // length of the longest word $longestWord = 0; foreach ($arrFooterRight as $line) { if ($longestWord < strlen($line)) { $longestWord = strlen($line); } } for ($i = $biggerCountBottom - 1; $i >= 0; --$i) { if (empty($arrFooterLeft[$i])) { $arrFooterLeft[$i] = ''; } if (empty($arrFooterRight[$i])) { $arrFooterRight[$i] = ''; } if ($arrFooterLeft[$i] == '<--PAGENUMBER-->' || $arrFooterLeft[$i] == '[PAGENUMBER]') { $pageNumbersX = 65; $pageNumbersY = $tempY - 18 - $i * $this->font_size_footer; $pageNumbersFont = $this->font_size_list; } else { $objPdf->addText(25, $tempY - 18 - $i * $this->font_size_footer, $this->font_size_footer, $arrFooterLeft[$i]); } if ($arrFooterRight[$i] == '<--PAGENUMBER-->' || $arrFooterRight[$i] == '[PAGENUMBER]') { $pageNumbersX = 595.28 - 25; $pageNumbersY = $tempY - 18 - $i * $this->font_size_footer; $pageNumbersFont = $this->font_size_list; } else { // Properly align right $width = $objPdf->getTextWidth($this->font_size_footer, $arrFooterRight[$i]); $objPdf->addText(595.28 - $width - 25, $tempY - 18 - $i * $this->font_size_footer, $this->font_size_footer, $arrFooterRight[$i]); } } $objPdf->restoreState(); $objPdf->closeObject(); $objPdf->addObject($footerForAllPages, 'all'); } // Page numbers if (isset($pageNumbersX)) { $objPdf->ezStartPageNumbers($pageNumbersX, $pageNumbersY, $pageNumbersFont, '', $_ARRAYLANG['TXT_SHOP_PRICELIST_FORMAT_PAGENUMBER'], 1); } // Margins $objPdf->ezSetMargins($marginTop, $marginBottom, 30, 30); // Product table if (isset($startpointY)) { $objPdf->ezSetY($startpointY); } $objInit->backendLangId = $this->lang_id; $_ARRAYLANG = $objInit->loadLanguageData('Shop'); Currency::setActiveCurrencyId($this->currency_id); $currency_symbol = Currency::getActiveCurrencySymbol(); $category_ids = $this->category_ids(); if ($category_ids == '*') { $category_ids = null; } $count = 1000; // Be sensible! // Pattern is "%" because all-empty parameters will result in an // empty array! $arrProduct = Products::getByShopParams($count, 0, null, $category_ids, null, '%', null, null, '`category_id` ASC, `name` ASC'); $arrCategoryName = ShopCategories::getNameArray(); $arrOutput = array(); foreach ($arrProduct as $product_id => $objProduct) { $categoryIds = explode(',', $objProduct->category_id()); $arrCategoryNames = array(); foreach ($categoryIds as $categoryId) { $arrCategoryNames[] = $arrCategoryName[$categoryId]; } //$objProduct = new Product(); $arrOutput[$product_id] = array('product_name' => self::decode($objProduct->name()), 'category_name' => self::decode(implode(', ', $arrCategoryNames)), 'product_code' => self::decode($objProduct->code()), 'product_id' => self::decode($objProduct->id()), 'price' => ($objProduct->discount_active() ? "S " . Currency::formatPrice($objProduct->discountprice()) : Currency::formatPrice($objProduct->price())) . ' ' . $currency_symbol); } $objPdf->ezTable($arrOutput, array('product_name' => '<b>' . self::decode($_ARRAYLANG['TXT_SHOP_PRODUCT_NAME']) . '</b>', 'category_name' => '<b>' . self::decode($_ARRAYLANG['TXT_SHOP_CATEGORY_NAME']) . '</b>', 'product_code' => '<b>' . self::decode($_ARRAYLANG['TXT_SHOP_PRODUCT_CODE']) . '</b>', 'product_id' => '<b>' . self::decode($_ARRAYLANG['TXT_ID']) . '</b>', 'price' => '<b>' . self::decode($_ARRAYLANG['TXT_SHOP_PRICE']) . '</b>'), '', array('showHeadings' => 1, 'fontSize' => $this->font_size_list, 'width' => 530, 'innerLineThickness' => 0.5, 'outerLineThickness' => 0.5, 'shaded' => 2, 'shadeCol' => array(hexdec(substr($this->row_color_1, 0, 2)) / 255, hexdec(substr($this->row_color_1, 2, 2)) / 255, hexdec(substr($this->row_color_1, 4, 2)) / 255), 'shadeCol2' => array(hexdec(substr($this->row_color_2, 0, 2)) / 255, hexdec(substr($this->row_color_2, 2, 2)) / 255, hexdec(substr($this->row_color_2, 4, 2)) / 255), 'cols' => array('product_name' => array('width' => 255), 'category_name' => array('width' => 130), 'product_code' => array('width' => 50), 'product_id' => array('width' => 40, 'justification' => 'right'), 'price' => array('width' => 55, 'justification' => 'right')))); $objPdf->ezStream(); // Never reached return true; }
} $q->clear(); $q->addQuery('a.*, b.resource_name'); $q->addTable('resource_tasks', 'a'); $q->addJoin('resources', 'b', 'a.resource_id = b.resource_id', 'inner'); $q->addWhere('a.task_id IN (' . implode(',', $task_list) . ')'); $res = $q->exec(); if (!$res) { $AppUI->setMsg(db_error(), UI_MSG_ERROR); $q->clear(); $AppUI->redirect(); } while ($row = db_fetch_assoc($res)) { $resources[$row['task_id']][$row['resource_id']] = $row['resource_name'] . ' [' . $row['percent_allocated'] . '%]'; } $q->clear(); } // Build the data columns foreach ($tasks as $task_id => $detail) { $row =& $pdfdata[]; $row[] = $detail['task_name']; $row[] = $detail['user_username']; $row[] = implode("\n", $assigned_users[$task_id]); if ($hasResources) { $row[] = implode("\n", $resources[$task_id]); } $end_date = new CDate($detail['task_end_date']); $row[] = $end_date->format($df); } $pdf->ezTable($pdfdata, $columns, $title, $options); $pdf->ezStream();
function alle_eingezogenen_pdf($jahr, $monat) { include_once 'classes/class_kautionen.php'; // include_once('pdfclass/class.ezpdf.php'); $pdf = new Cezpdf('a4', 'portrait'); $bpdf = new b_pdf(); // $bpdf->b_header($pdf, 'Partner', $_SESSION['partner_id'], 'portrait', 'Helvetica.afm', 5); // $pdf->ezStopPageNumbers(); //seitennummerirung beenden $pdf->addInfo('Author', $_SESSION[username]); $monat_name = monat2name($monat); $auszug_arr = $this->alle_eingezogene_mieter_arr($jahr, $monat); // print_r($auszug_arr); // die(); $pdf->selectFont($text_schrift); $pdf->ezSetCmMargins(1.0, 2.0, 2.0, 1.0); $pdf->ezText("<b>Einzüge {$monat_name} {$jahr}</b> inkl. Kautionshöhe", 11); $pdf->ezSetDy(-20); if (is_array($auszug_arr)) { $anzahl_auszuege = count($auszug_arr); $e = new einheit(); $m = new mietvertrag(); $ka = new kautionen(); // echo "<table class=\"tabelle_haus\" border=\"0\">"; // echo "<tr class=\"feldernamen\"><td>Auzug</td><td>Einheit</td><td>Mieter</td><td>Kautionsbetrag</td></tr>"; for ($a = 0; $a < $anzahl_auszuege; $a++) { $einheit_id = $auszug_arr[$a]['EINHEIT_ID']; $mv_id = $auszug_arr[$a]['MIETVERTRAG_ID']; $einzug = date_mysql2german($auszug_arr[$a]['MIETVERTRAG_VON']); $auszug = date_mysql2german($auszug_arr[$a]['MIETVERTRAG_BIS']); $e->get_einheit_info($einheit_id); $personen_arr = $m->get_personen_ids_mietvertrag($mv_id); $personen_string = $this->mv_personen_als_string($personen_arr); $personen_string = str_replace("\n", " ", htmlspecialchars($personen_string)); $ka->get_kautionsbetrag($mv_id); // echo "<tr class=\"zeile2\"><td>$auszug</td><td>$e->einheit_kurzname</td><td>$personen_string</td><td> $ka->kautions_betrag</td></tr>"; // echo "<h3>$auszug $e->einheit_kurzname $personen_string Kautionsbetrag:$ka->kautions_betrag</h3>"; $det = new detail(); $abnahme_termin = bereinige_string($det->finde_detail_inhalt('MIETVERTRAG', $mv_id, 'Abnahmetermin')); // $pdf->ezText("$auszug",10); // $pdf->ezSetDy(10); // $pdf->ezSetCmMargins(1.0,2.0,4.0,1.0); // $pdf->ezText("$e->einheit_kurzname",10, array('justification'=>'left')); // $pdf->ezSetDy(10); // $pdf->ezSetCmMargins(2.0,2.0,7.0,3.0); // $pdf->ezText("$personen_string",10, array('justification'=>'left')); // $pdf->ezSetDy(10); // $pdf->ezText("$ka->kautions_betrag",10, array('justification'=>'right')); // $pdf->ezSetCmMargins(1.0,2.0,2.0,1.0); $pdf_tab[$a]['EINHEIT'] = $e->einheit_kurzname; $pdf_tab[$a]['MIETER'] = $personen_string; $pdf_tab[$a]['EINZUG'] = $einzug; $pdf_tab[$a]['AUSZUG'] = $auszug; $pdf_tab[$a]['KAUTION'] = $ka->kautions_betrag; $pdf_tab[$a]['ABNAHME'] = $abnahme_termin; unset($personen_string); } // echo "</table>"; // $pdf->ezTable($pdf_tab); $cols = array('EINHEIT' => "EINHEIT", 'MIETER' => "MIETER", 'EINZUG' => "EINZUG", 'ABNAHME' => "ABNAHME", 'KAUTION' => "KAUTION"); $pdf->ezTable($pdf_tab, $cols, "Auszüge {$monat_name} {$jahr}", array('rowGap' => 1.5, 'showLines' => 1, 'showHeadings' => 1, 'shaded' => 1, 'shadeCol' => array(0.9, 0.9, 0.9), 'titleFontSize' => 9, 'fontSize' => 7, 'xPos' => 30, 'xOrientation' => 'right', 'width' => 550, 'cols' => array('EINHEIT' => array('justification' => 'right', 'width' => 50), 'AUSZUG' => array('justification' => 'right', 'width' => 50)))); } else { hinweis_ausgeben("Keine Auszüge im {$monat}/{$jahr}"); } ob_clean(); // ausgabepuffer leeren // header("Content-type: application/pdf"); // wird von MSIE ignoriert $dateiname = $monat . "_" . $jahr . "_Einzüge.pdf"; $pdf_opt['Content-Disposition'] = $dateiname; $pdf->ezStream($pdf_opt); // $pdf->ezStream(); }
$pdf->ezText(dPgetConfig('company_name'), 12); // $pdf->ezText(dPgetConfig('company_name').' :: '.$AppUI->getConfig('page_title'), 12); if ($log_all) { $date = new CDate(); $pdf->ezText("\nAll hours as of " . $date->format($df), 8); } else { $sdate = new CDate($log_start_date); $edate = new CDate($log_end_date); $pdf->ezText("\nHours from " . $sdate->format($df) . " to " . $edate->format($df), 8); } $pdf->selectFont("{$font_dir}/Helvetica-Bold.afm"); $pdf->ezText("\n" . safe_utf8_decode($AppUI->_('Overall Report')), 12); foreach ($allpdfdata as $company => $data) { $title = safe_utf8_decode($company); $options = array('showLines' => 1, 'showHeadings' => 0, 'fontSize' => 8, 'rowGap' => 2, 'colGap' => 5, 'xPos' => 50, 'xOrientation' => 'right', 'width' => '500'); $pdf->ezTable($data, NULL, $title, $options); } if ($fp = fopen($temp_dir . '/temp' . $AppUI->user_id . '.pdf', 'wb')) { fwrite($fp, $pdf->ezOutput()); fclose($fp); echo '<a href="' . DP_BASE_URL . '/files/temp/temp' . $AppUI->user_id . '.pdf" target="pdf">'; echo $AppUI->_("View PDF File"); echo "</a>"; } else { echo "Could not open file to save PDF. "; if (!is_writable($temp_dir)) { "The files/temp directory is not writable. Check your file system permissions."; } } } }
$da[] = ''; $da[] = ''; $da[] = "\$ " . number_format($tflete, 2, ".", ","); $da[] = "\$ " . number_format($tcantidaddescuento, 2, ".", ","); $da[] = "\$ " . number_format($texcedente, 2, ".", ","); $da[] = "\$ " . number_format($tcostoead, 2, ".", ","); $da[] = "\$ " . number_format($tcostorecoleccion, 2, ".", ","); $da[] = "\$ " . number_format($tcostoseguro, 2, ".", ","); $da[] = "\$ " . number_format($tcostocombustible, 2, ".", ","); $da[] = "\$ " . number_format($totros, 2, ".", ","); $da[] = "\$ " . number_format($tsubtotal, 2, ".", ","); $da[] = "\$ " . number_format($tiva, 2, ".", ","); $da[] = "\$ " . number_format($tivaretenido, 2, ".", ","); $da[] = "\$ " . number_format($ttotal, 2, ".", ","); $data[] = $da; $pdf->ezTable($data, $col, '', $est); $pdf->ezText("", 10, array('justification' => 'left')); } $s = "SELECT * FROM facturadetalleguias WHERE factura = {$_GET['folio']}"; $rx = mysql_query($s, $l) or die($s); if (mysql_num_rows($rx) > 0) { //detallado de excedente y valor declarado $pdf->setColor(0.79, 0.67, 0.11); $pdf->ezText("<b>DETALLADO DE FACTURA, EXCEDENTE Y VALOR DECLARADO</b>\n", 12, array('justification' => 'left')); $pdf->setColor(0.25, 0.25, 0.25); #detallado inferior $s = "SELECT *, date_format(fechaguia,'%d/%m/%Y') as fechaguia FROM facturadetalleguias WHERE factura = {$_GET['folio']}"; $r = mysql_query($s, $l) or die($s); $col = array('0' => "Folio", '1' => 'Tipo Guia', '2' => 'Concepto', '3' => 'Seguro', '4' => 'Exced', '5' => 'Fecha', '6' => 'Importe', '7' => 'Iva', '8' => 'Iva Ret', '9' => 'Total'); $opt = array('0' => array('justification' => 'center'), '1' => array('justification' => 'center'), '2' => array('justification' => 'left'), '3' => array('justification' => 'right'), '4' => array('justification' => 'right'), '5' => array('justification' => 'right'), '6' => array('justification' => 'right'), '7' => array('justification' => 'right'), '8' => array('justification' => 'right'), '9' => array('justification' => 'right')); $est = array('fontSize' => 6, 'showHeadings' => 1, 'lineCol' => array(0.25, 0.25, 0.25), 'cols' => $opt);
} } } if ($arySwimmer['devices'] != '') { if ($hasnote === FALSE) { $note++; $aryRow['note'] = $note + 1 . ')'; $hasnote = TRUE; $aryNotes[$note] = array('no' => $note + 1 . ')', 'text' => _('Hjælpemidler') . ' ' . $arySwimmer['distance'] . ': ' . $arySwimmer['devices']); } else { $aryNotes[$note]['text'] .= "\n" . _('Hjælpemidler') . ' ' . gettext_dist($arySwimmer['distance']) . ': ' . $arySwimmer['devices']; } } $aryRow[$arySwimmer['distance']] = $arySwimmer['time']; } if (is_array($aryRow)) { $aryData[$cnt] = $aryRow; } $pdf = new Cezpdf(); $pdf->selectFont('./fonts/Helvetica'); $pdf->ezSetY(830); $pdf->ezText(_("Deltagerliste") . " " . $aryCompo['name'] . " - " . date('d-m-Y', strtotime($aryCompo['date'])), 18, array('justification' => 'center')); $pdf->ezSetY(781); $pdf->ezTable($aryData, array('Navn' => _('Navn'), 'Klub' => _('Klub'), '25' => _('25m'), '50' => _('50m'), '100' => _('100m'), 'note' => _('Note')), '', array('xPos' => 57, 'xOrientation' => 'right', 'width' => 481)); // 'Nr'=>'Nr', if ($note >= 0) { $pdf->ezTable($aryNotes, array('no' => '', 'text' => ''), '', array('showHeadings' => 0, 'showLines' => 0, 'shaded' => 0, 'xPos' => 57, 'xOrientation' => 'right', 'width' => 481, 'fontSize' => 10, 'titleFontSize' => 12, 'cols' => array('no' => array('width' => 30, 'justification' => 'center')))); } $pdf->ezStream(); } $db->close();
$date = new CDate(); $pdf->ezText("\n" . $date->format($df), 8); $pdf->selectFont("{$font_dir}/Helvetica-Bold.afm"); $pdf->ezText("\n" . safe_utf8_decode($AppUI->_('Task Log Report')), 12); $pdf->ezText(safe_utf8_decode($pname), 15); if ($log_all) { $pdf->ezText("All task log entries", 9); } else { $pdf->ezText("Task log entries from " . $start_date->format($df) . ' to ' . $end_date->format($df), 9); } $pdf->ezText("\n\n"); $title = 'Task Logs'; $pdfheaders = array(safe_utf8_decode($AppUI->_('Created by')), safe_utf8_decode($AppUI->_('Summary')), safe_utf8_decode($AppUI->_('Description')), safe_utf8_decode($AppUI->_('Date')), safe_utf8_decode($AppUI->_('Hours')), safe_utf8_decode($AppUI->_('Cost Code'))); $options = array('showLines' => 0, 'fontSize' => 12, 'rowGap' => 2, 'colGap' => 5, 'xPos' => 50, 'xOrientation' => 'right', 'width' => 500); $pdfheaderdata[] = array('', '', '', '', '', ''); $pdf->ezTable($pdfheaderdata, $pdfheaders, $title, $options); $options['col_options'] = array(2 => array('width' => 250), 3 => array('width' => 55), 4 => array('width' => 30), 5 => array('width' => 30)); $options['showHeadings'] = 0; $options['showLines'] = 1; $options['fontSize'] = 8; $pdf->ezTable($pdfdata, '', '', $options); if ($fp = fopen($temp_dir . '/temp' . $AppUI->user_id . '.pdf', 'wb')) { fwrite($fp, $pdf->ezOutput()); fclose($fp); echo '<a href="' . (dPgetConfig('overlay_dir') == '' ? DP_BASE_DIR : dPgetConfig('overlay_dir')) . '/files/temp/temp' . $AppUI->user_id . '.pdf" target="pdf">'; echo $AppUI->_("View PDF File"); echo "</a>"; } else { echo "Could not open file to save PDF. "; if (!is_writable($temp_dir)) { "The files/temp directory is not writable. Check your file system permissions.";
/** * Crea un pdf con el estado de cuenta de el cliente especificado * @param Array $args, $args['id_cliente'=>12[,'tipo_venta'=> 'credito | contado | saldo'] ], por default obtiene todas las compras del cliente */ public static function imprimirEstadoCuentaCliente($args) { //verificamos que se haya especificado el id del cliente if (!isset($args['id_cliente'])) { Logger::log("Error al obtener el estado de cuenta, no se ha especificado un cliente."); die('{"success": false, "reason": "Error al obtener el estado de cuenta, no se ha especificado un cliente."}'); } //verificamos que el cliente exista if (!($cliente = ClienteDAO::getByPK($args['id_cliente']))) { Logger::log("Error al obtener el estado de cuenta, no se tiene registro del cliente {$args['id_cliente']}."); die('{"success": false, "reason": "Error al obtener el estado de cuenta, no se tiene registro del cliente ' . $args['id_cliente'] . '"}'); } //obtenemos los datos del emisor $estado_cuenta = estadoCuentaCliente($args); //buscar los datos del emisor if (!($emisor = PosConfigDAO::getByPK('emisor'))) { Logger::log("no encuentro los datos del emisor"); die("no encuentro los datos del emisor"); } $emisor = json_decode($emisor->getValue())->emisor; $sucursal = SucursalDAO::getByPK($_SESSION['sucursal']); if (!$sucursal) { die("Sucursal invalida"); } include_once 'librerias/ezpdf/class.pdf.php'; include_once 'librerias/ezpdf/class.ezpdf.php'; $pdf = new Cezpdf(); $pdf->selectFont('../server/librerias/ezpdf/fonts/Helvetica.afm'); //margenes de un centimetro para toda la pagina $pdf->ezSetMargins(1, 1, 1, 1); /* * LOGO */ if (!($logo = PosConfigDAO::getByPK('url_logo'))) { Logger::log("Verifique la configuracion del pos_config, no se encontro el camṕo 'url_logo'"); die("Verifique la configuracion del POS, no se encontro el url del logo"); } //addJpegFromFile(imgFileName,x,y,w,[h]) //detectamos el tipo de imagen del logo if (substr($logo->getValue(), -3) == "jpg" || substr($logo->getValue(), -3) == "JPG" || substr($logo->getValue(), -4) == "jpeg" || substr($logo->getValue(), -4) == "JPEG") { $pdf->addJpegFromFile($logo->getValue(), puntos_cm(2), puntos_cm(25.5), puntos_cm(3.5)); } elseif (substr($logo->getValue(), -3) == "png" || substr($logo->getValue(), -3) == "PNG") { $pdf->addPngFromFile($logo->getValue(), puntos_cm(2), puntos_cm(25.5), puntos_cm(3.5)); } else { Logger::log("Verifique la configuracion del pos_config, la extension de la imagen del logo no es compatible"); die("La extension de la imagen usada para el logo del negocio no es valida."); } /* * ************************ * ENCABEZADO * ************************* */ $e = "<b>" . self::readableText($emisor->nombre) . "</b>\n"; $e .= formatAddress($emisor); $e .= "RFC: " . $emisor->rfc . "\n\n"; //datos de la sucursal $e .= "<b>Lugar de expedicion</b>\n"; $e .= self::readableText($sucursal->getDescripcion()) . "\n"; $e .= formatAddress($sucursal); $datos = array(array("emisor" => $e)); $pdf->ezSetY(puntos_cm(28.6)); $opciones_tabla = array(); $opciones_tabla['showLines'] = 0; $opciones_tabla['showHeadings'] = 0; $opciones_tabla['shaded'] = 0; $opciones_tabla['fontSize'] = 8; $opciones_tabla['xOrientation'] = 'right'; $opciones_tabla['xPos'] = puntos_cm(7.3); $opciones_tabla['width'] = puntos_cm(11); $opciones_tabla['textCol'] = array(0, 0, 0); $opciones_tabla['titleFontSize'] = 12; $opciones_tabla['rowGap'] = 3; $opciones_tabla['colGap'] = 3; $pdf->ezTable($datos, "", "", $opciones_tabla); $cajero = UsuarioDAO::getByPK($_SESSION['userid'])->getNombre(); $datos = array(array("col" => "<b>Cajero</b>"), array("col" => self::readableText($cajero)), array("col" => "<b>Cliente</b>"), array("col" => self::readableText($cliente->getRazonSocial())), array("col" => "<b>Limite de Credito</b>"), array("col" => FormatMoney($estado_cuenta->limite_credito, DONT_USE_HTML)), array("col" => "<b>Saldo</b>"), array("col" => FormatMoney($estado_cuenta->saldo, DONT_USE_HTML))); $pdf->ezSetY(puntos_cm(28.8)); $opciones_tabla['xPos'] = puntos_cm(12.2); $opciones_tabla['width'] = puntos_cm(6); $opciones_tabla['showLines'] = 0; $opciones_tabla['shaded'] = 2; $opciones_tabla['shadeCol'] = array(1, 1, 1); //$opciones_tabla['shadeCol2'] = array(0.054901961, 0.756862745, 0.196078431); $opciones_tabla['shadeCol2'] = array(0.8984375, 0.95703125, 0.99609375); $pdf->ezTable($datos, "", "", $opciones_tabla); //roundRect($pdf, puntos_cm(12.2), puntos_cm(28.8), puntos_cm(6), puntos_cm(4.25)); /** * ESTADO DE CUENTA */ $elementos = array(array('id_venta' => 'Venta', 'fecha' => 'Fecha', 'sucursal' => 'Sucursal', 'cajero' => 'Cajero', 'tipo_venta' => 'Tipo', 'tipo_pago' => 'Pago', 'total' => 'Total', 'pagado' => 'Pagado', 'saldo' => 'Saldo')); foreach ($estado_cuenta->array_ventas as $venta) { $array_venta = array(); $array_venta['id_venta'] = $venta['id_venta']; $array_venta['fecha'] = $venta['fecha']; $array_venta['sucursal'] = self::readableText($venta['sucursal']); $array_venta['cajero'] = self::readableText($venta['cajero']); $array_venta['cancelada'] = self::readableText($venta['cancelada']); $array_venta['tipo_venta'] = self::readableText($venta['tipo_venta']); $array_venta['tipo_pago'] = self::readableText($venta['tipo_pago']); $array_venta['total'] = FormatMoney($venta['total'], DONT_USE_HTML); $array_venta['pagado'] = FormatMoney($venta['pagado'], DONT_USE_HTML); $array_venta['saldo'] = FormatMoney($venta['saldo'], DONT_USE_HTML); array_push($elementos, $array_venta); } $pdf->ezText("", 8, array('justification' => 'center')); $pdf->ezSetY(puntos_cm(24)); $opciones_tabla['xPos'] = puntos_cm(2); $opciones_tabla['width'] = puntos_cm(16.2); $pdf->ezTable($elementos, "", "Estado de Cuenta", $opciones_tabla); //roundRect($pdf, puntos_cm(2), puntos_cm(24.3), puntos_cm(16.2), puntos_cm(3.2)); /* * ************************ * notas de abajo * ************************* */ $pdf->setLineStyle(1); $pdf->setStrokeColor(0.3359375, 0.578125, 0.89453125); $pdf->line(puntos_cm(2), puntos_cm(1.3), puntos_cm(18.2), puntos_cm(1.3)); $pdf->addText(puntos_cm(2), puntos_cm(1.0), 7, "Fecha de impresion: " . date("d/m/y") . " " . date("H:i:s")); //addJpegFromFile(imgFileName,x,y,w,[h]) //$pdf->addJpegFromFile("../www/media/logo_simbolo.jpg", puntos_cm(15.9), puntos_cm(.25), 25); $pdf->addText(puntos_cm(16.7), puntos_cm(0.6), 8, "caffeina.mx"); $pdf->ezStream(); }
function acta($argumento) { $fecha_doc = $argumento["fecha_doc"]; $usuarioAutorizaNomb = $argumento["usuarioAutorizaNomb"]; //rint ($query); $pdf = new Cezpdf("LETTER", "portrait"); //LETTER = Carta,portrait = vertical $year = date("Y"); $day = date("d"); $month = date("m"); $a = array("left" => 0); $b = array("justification" => "center"); $d = array("justification" => "left", "leading" => 8); $c = array("left" => 0, "leading" => 12); //leading = espaciado $e = array("left" => 0, "leading" => 15); //leading = espaciado $pdf->ezSetCmMargins(4, 3, 4, 2); //top,botton,left,right /* Se establece la fuente que se utilizara para el texto. */ $pdf->selectFont("../include/pdf/fonts/Times-Roman.afm"); $pdf->ezText("ACTA DE RECUPERACION DE RADICADOS \n\n", 15, $b); //$pdf->ezText($this->query." : \n" ,12,$d); $txtformat = "Radicados recuperados a {$fecha_doc} y autorizados por {$usuarioAutorizaNomb} \n\n "; $pdf->ezText($txtformat, 12, $c); $this->conexion->getResult($this->query); $data = array(); $columna = array(); $contador = 0; while ($this->conexion->cursor->next_record() != 0) { $radicado = $this->conexion->cursor->f('radi_nume_radi'); $columna[$contador++] = $radicado; if ($contador == 4) { $contador = 0; $data = array_merge($data, array(array('-1-' => $columna[0], '-2-' => $columna[1], '-3-' => $columna[2], '-4-' => $columna[3]))); array_splice($columna, 0); } //$data= array_merge ($data,array (array('Número'=>$rucConsecutivo."-".$rucYear,'Usuario'=>$nombre,'Defensor Público'=>$nombreDefensor))); } if ($contador != 0) { $data = array_merge($data, array(array('-1-' => $columna[0], '-2-' => $columna[1], '-3-' => $columna[2], '-4-' => $columna[3]))); } $pdf->ezTable($data); $pdf->ezStream(); }
//include_once ('pdfclass/class.ezpdf.php'); $pdf = new Cezpdf('a4', 'portrait'); $pdf->ezSetCmMargins(4.5, 2.5, 2.5, 2.5); $berlus_schrift = 'pdfclass/fonts/Times-Roman.afm'; $text_schrift = 'pdfclass/fonts/Arial.afm'; $pdf->addJpegFromFile('includes/logos/hv_logo198_80.jpg', 450, 780, 100, 42); $pdf->setLineStyle(0.5); $pdf->selectFont($berlus_schrift); $pdf->addText(42, 743, 6, "BERLUS HAUSVERWALTUNG - Fontanestr. 1 - 14193 Berlin"); $pdf->line(42, 750, 550, 750); $seite = $pdf->ezGetCurrentPageNumber(); $alle_seiten = $pdf->ezPageCount; $data55 = array(array('num' => 1, 'name' => 'gandalf', 'type' => 'wizard'), array('num' => 2, 'name' => 'bilbo', 'type' => 'hobbit', 'url' => 'http://www.ros.co. nz/pdf/'), array('num' => 3, 'name' => 'frodo', 'type' => 'hobbit'), array('num' => 4, 'name' => 'saruman', 'type' => 'bad dude', 'url' => 'http://sourceforge.net/projects/pdf-php'), array('num' => 5, 'name' => 'sauron', 'type' => 'really bad dude')); $pdf->ezTable($data55); // header('Content-type: application/pdf'); // header('Content-Disposition: attachment; filename="downloaded.pdf"'); // $output = $pdf->Output(); // $len = strlen($output); // header("Content-type: application/pdf"); // wird von MSIE ignoriert // header("content-length: $len"); // header("Content-Disposition: inline; filename=test.pdf"); //im fenster // header("Content-Disposition: attachment; filename=test.pdf"); // echo $output; // jetzt ausgeben $pdf->ezStream(); break; default: if (!empty($_REQUEST['geldkonto_id'])) { $_SESSION['geldkonto_id'] = $_REQUEST['geldkonto_id']; }
$nam = $r['nama']; $ketua = $r['nmketua']; $jur = $r['nmjur']; $ktrg = $r['ket']; $i++; } $pdf->ezText("\nNIM : {$nm}"); $pdf->ezText("\nNama Mahasiswa : {$nam}"); $pdf->ezText("\nJurusan : {$jur}"); $pdf->ezText("\nTahun Ajaran : {$tahuna}"); $pdf->ezText("\nSemester : {$semestera}"); //$pdf->ezText("\nTahun Ajaran : {$tah}/{$tah2}"); //$pdf->ezText("\nSemester : {$ktrg}"); $pdf->ezText("\n"); $ipk = $totalmutu / $totalsks; $pdf->ezTable($data); $pdf->ezText("\nTotal Mutu : {$totalmutu}"); $pdf->ezText("\nTotal SKS : {$totalsks}"); $pdf->ezText("\nIndeks Prestasi Semester (IPS) : {$ipk}"); $pdf->ezText("\n Bandung," . date('d-m-Y')); $pdf->ezText(" Ketua Jurusan"); $pdf->ezText("\n"); $pdf->ezText("\n"); $pdf->ezText("\n"); $pdf->ezText(" {$ketua}"); // Penomoran halaman $pdf->ezStartPageNumbers(320, 15, 8); $pdf->ezStream(); } else { echo "Data Nilai Kosong"; }
$vaKepada[] = array("1" => "", "2" => "", "3" => "", "4" => "Pangkat / gol", "5" => ":", "6" => $vaLeader_Gol['Description'] . " / " . $vaLeader_Gol['Title']); $vaKepada[] = array("1" => "", "2" => "", "3" => "", "4" => "NIP", "5" => ":", "6" => $vaLeader['nip']); $vaKepada[] = array("1" => "", "2" => "", "3" => "", "4" => "Jabatan", "5" => ":", "6" => $vaLeader['jabatan']); foreach ($vaPengikut as $key => $vaData) { $vaPengikut_Gol = scSys::GetKeterangan("Title,Description", "Id = '{$vaData['golongan']}'", "sc_master"); $vaKepada[] = array("1" => "", "2" => "", "3" => $nRow++ . ".", "4" => "Nama", "5" => ":", "6" => $vaData['nama']); $vaKepada[] = array("1" => "", "2" => "", "3" => "", "4" => "Pangkat / gol", "5" => ":", "6" => $vaPengikut_Gol['Description'] . " / " . $vaPengikut_Gol['Title']); $vaKepada[] = array("1" => "", "2" => "", "3" => "", "4" => "NIP", "5" => ":", "6" => $vaData['nip']); $vaKepada[] = array("1" => "", "2" => "", "3" => "", "4" => "Jabatan", "5" => ":", "6" => $vaData['jabatan']); } $vaUntuk = array(); $vaUntuk[] = array("1" => "Untuk", "2" => ":", "3" => $dbRow['purpose']); $nFont = 11; $pdf = new Cezpdf("A4", "P", $vaOpt, '0'); $pdf->ezImage(scSys::GetConfig("sc_header"), false, 100, 600); $pdf->ezTable($vaTable1, "", "", array("showLines" => 0, "showHeadings" => 0, "fontSize" => $nFont, "cols" => array("x" => array("width" => 60, "wrap" => 1), "1" => array("width" => 20, "wrap" => 1), "2" => array("width" => 2), "3" => array("width" => 18, "wrap" => 1)))); $pdf->ezText(""); $pdf->ezText("<u><b>PERINTAH PERJALANAN DINAS</b></u>", $nFont + 2, array("justification" => "center")); $pdf->ezText("(SPPD)", $nFont + 2, array("justification" => "center")); $pdf->ezText(""); $pdf->ezTable($vaTable2, "", "", array("showLines" => 0, "showHeadings" => 0, "fontSize" => $nFont, "cols" => array("1" => array("width" => 4, "wrap" => 1), "2" => array("width" => 40, "wrap" => 1), "3" => array("width" => 56, "wrap" => 1)))); $pdf->ezText(""); $pdf->ezText(""); $pdf->ezTable($vaTanggal, "", "", array("showLines" => 0, "showHeadings" => 0, "fontSize" => $nFont, "cols" => array("x" => array("width" => 50, "wrap" => 1), "1" => array("width" => 25, "wrap" => 1), "2" => array("width" => 2), "3" => array("width" => 23, "wrap" => 1)))); $pdf->ezText(""); $pdf->ezTable($vaTtd, "", "", array("showLines" => 0, "showHeadings" => 0, "fontSize" => $nFont, "cols" => array("x" => array("width" => 50, "wrap" => 1, "justification" => "center"), "1" => array("width" => 40, "wrap" => 1, "justification" => "center")))); $pdf->ezNewPage(); $pdf->ezImage(scSys::GetConfig("sc_header"), false, 100, 600); $pdf->ezText("<u><b>SURAT PERINTAH TUGAS</b></u>", $nFont + 2, array("justification" => "center")); $pdf->ezText("NOMOR : ", $nFont + 2, array("justification" => "center")); $pdf->ezText("");
require_once '../ezpdf/Cezpdf.php'; conectarse(); $pdf = new Cezpdf('a4'); $tmp = array('b' => 'Helvetica-Bold', 'i' => 'Courier-Oblique', 'bi' => 'Helvetica-BoldOblique', 'ib' => 'Helvetica-BoldOblique', 'bb' => 'Times-Roman'); $pdf->setFontFamily('Helvetica', $tmp); $pdf->selectFont('fonts/Helvetica.afm'); $pdf->ezSetCmMargins(1.5, 1, 2, 3); $pdf->addJpegFromFile("../img/libro.jpg", 50, 750, 60); $result = mysql_query("select matricula,\n\tconcat(nombre,' ',apellido_paterno,' ',apellido_materno) as nombre,\n\tconcat(calle,' ',numero,' ',colonia,'') as direccion,ciudad,estado,telefono,celular,sueldo,tipo\n\t\t\t\t\t\tfrom empleados \n\t\t\t\t\t\twhere status = 'ACTIVO' "); while ($datatmp = mysql_fetch_array($result)) { $data[] = array_merge($datatmp, array('matricula')); } $options = array('shadeHeadingCol' => array(0.6, 0.6, 0.5), 'shadeCol' => array(0.9, 0.9, 0.9), 'xOrientation' => 'center', 'width' => 550, 'fontSize' => 8, 'xPos' => 'center'); $titles = array('matricula' => '<b>ID</b>', 'nombre' => '<b>NOMBRE</b>', 'direccion' => '<b>DIRECCIÓN</b>', 'ciudad' => '<b>CIUDAD</b>', 'estado' => '<b>ESTADO</b>', 'telefono' => '<b>TELÉFONO</b>', 'celular' => '<b>CELULAR</b>', 'sueldo' => '<b>SUELDO</b>', 'tipo' => '<b>TIPO</b>'); $pdf->ezText("\n\n\n\n\n", 10); $pdf->ezTable($data, $titles, '', $options); //cabecera del pdf (objeto para todas las páginas) $all = $pdf->openObject(); $pdf->saveState(); $pdf->line($pdf->ez['leftMargin'], $pdf->ez['bottomMargin'] + 10, $pdf->ez['pageWidth'] - $pdf->ez['rightMargin'], $pdf->ez['bottomMargin'] + 10); //the bottom line $pdf->addText(200, 790, 12, "<b>Distribuciones y Representaciones Arvizu </b>\n"); $pdf->addText(230, 770, 12, "<i>!Leer Aumenta el Saber! </i>\n"); $pdf->addText(240, 740, 12, "<b>Listado Empleados </b>\n"); $pdf->ezText("\n\n\n", 10); $pdf->addText(50, 30, 8, "<b>Fecha: </b>\n" . date("d/m/Y")); $pdf->ezStartPageNumbers($pdf->ez['pageWidth'] - ($pdf->ez['rightMargin'] - 10), $pdf->ez['bottomMargin'], 8, 'PAGINA', '{PAGENUM} de {TOTALPAGENUM}', 1); $pdf->addText(50, 30, 10); //bottom text $pdf->restoreState(); $pdf->closeObject();
$columnasp1["ZONA{$zona}"] = "ZONA {$zona}\n{$fx->zoi}/{$fx->zof}"; $datap1["ZONA{$zona}"] = "\$ " . number_format($fx->valor, 2, ".", ","); $options1["ZONA{$zona}"] = array('justification' => 'right'); } $zona++; } $data0[] = $datap0; $data1[] = $datap1; $columnas0[] = $columnasp0; $columnas1[] = $columnasp1; //print_r($data); $estilo0 = array('fontSize' => 8, 'showHeadings' => 1, 'lineCol' => array(0.25, 0.25, 0.25), 'cols' => $options0); $estilo1 = array('fontSize' => 8, 'showHeadings' => 1, 'lineCol' => array(0.25, 0.25, 0.25), 'cols' => $options1); //print_r($estilo0); $pdf->ezText("", 8); $pdf->ezTable($data0, $columnasp0, '', $estilo0); $pdf->ezText("", 8); $pdf->ezTable($data1, $columnasp1, '', $estilo1); } elseif ($f->precioporcaja == 1) { $s = "SELECT * FROM cconvenio_configurador_caja WHERE tipo='CONVENIO' and idconvenio = {$_GET['folio']} GROUP BY descripcion"; $rx = mysql_query($s, $l) or die($s); $data0 = array(); $data1 = array(); $options0 = array(); $options1 = array(); while ($fx = mysql_fetch_array($rx)) { $s = "SELECT * FROM cconvenio_configurador_caja WHERE tipo='CONVENIO' and idconvenio = {$_GET['folio']} \n\t\t\t\tand descripcion = '{$fx['descripcion']}' order by zona"; $ry = mysql_query($s, $l) or die($s); $cantcol = mysql_num_rows($ry) / 2; $zona = 1; $datap0 = array();
$datagen = new GradebookDataGenerator($allcat, $alleval, $alllink); $header_names = array(get_lang('Name'), get_lang('Description'), get_lang('Weight'), get_lang('Date'), get_lang('Results')); $data_array = $datagen->get_data(GradebookDataGenerator::GDG_SORT_NAME, 0, null, true); $newarray = array(); foreach ($data_array as $data) { $newarray[] = array_slice($data, 1); } $pdf = new Cezpdf(); $pdf->selectFont(api_get_path(LIBRARY_PATH) . 'ezpdf/fonts/Courier.afm'); $pdf->ezSetMargins(30, 30, 50, 30); $pdf->ezSetY(810); $pdf->ezText(get_lang('FlatView') . ' (' . api_convert_and_format_date(null, DATE_FORMAT_SHORT) . ' ' . api_convert_and_format_date(null, TIME_NO_SEC_FORMAT) . ')', 12, array('justification' => 'center')); $pdf->line(50, 790, 550, 790); $pdf->line(50, 40, 550, 40); $pdf->ezSetY(750); $pdf->ezTable($newarray, $header_names, '', array('showHeadings' => 1, 'shaded' => 1, 'showLines' => 1, 'rowGap' => 3, 'width' => 500)); $pdf->ezStream(); exit; } } elseif (!empty($_GET['export_certificate'])) { //@todo this code seems not to be used $user_id = strval(intval($_GET['user'])); if (!api_is_allowed_to_edit(true, true)) { $user_id = api_get_user_id(); } $category = Category::load($_GET['cat_id']); if ($category[0]->is_certificate_available($user_id)) { $user = api_get_user_info($user_id); $scoredisplay = ScoreDisplay::instance(); $scorecourse = $category[0]->calc_score($user_id); $scorecourse_display = isset($scorecourse) ? $scoredisplay->display_score($scorecourse, SCORE_AVERAGE) : get_lang('NoResultsAvailable');
if (empty($encounter['photo_filename'])) { $idpic = $root_path . 'fotos/registration/_nothing_'; } else { $idpic = $root_path . 'fotos/registration/' . $encounter['photo_filename']; } if ($lang == 'ar' || $lang == 'fa') { // for arabic lang, added by Waleed Fathalla at 06/03/2004 # Load the page header #1 require '../std_plates/pageheader1ar.php'; # Load the patient data plate #1 require '../std_plates/patientdata1ar.php'; $data = NULL; # make empty line $y = $pdf->ezText("\n", 14); $data[] = array(ar2uni($LDPatientData)); $pdf->ezTable($data, '', '', array('xPos' => 'left', 'xOrientation' => 'right', 'showLines' => 0, 'fontSize' => $report_titlesize, 'showHeadings' => 0, 'shaded' => 2, 'shadeCol2' => array(0.9, 0.9, 0.9), 'width' => 555, 'cols' => array(0 => array('justification' => 'right')))); # make empty line $y = $pdf->ezText("\n", 14); # reset $data = NULL; $data[] = array(formatDate2Local($encounter['encounter_date'], $date_format), ar2uni("{$LDAdmitDate} :")); $data[] = array(formatDate2Local($encounter['encounter_date'], $date_format, TRUE, TRUE), ar2uni("{$LDAdmitTime} :")); $data[] = array(''); $data[] = array(ar2uni($encounter['title']), ar2uni("{$LDTitle} :")); $data[] = array($encounter['sex'], ar2uni("{$LDSex} :")); $data[] = array($encounter['blood_group'], ar2uni("{$LDBloodGroup} :")); $data[] = array(ar2uni($eclass), ar2uni("{$LDAdmitType} :")); if ($encounter['encounter_class_nr'] == 1) { $data[] = array(ar2uni($current_ward_name), ar2uni("{$LDWard} :")); } else { $data[] = array(ar2uni($current_dept_name), ar2uni("{$LDDepartment} :"));