/** * PDF image renderer * * @param PDF $pdf * * @return void */ function render($pdf) { global $lastpicbottom, $lastpicpage, $lastpicleft, $lastpicright; // Check for a pagebreak first if ($pdf->checkPageBreakPDF($this->height + 5)) { $this->y = $pdf->GetY(); } $curx = $pdf->GetX(); // If current position (left)set "." if ($this->x == ".") { $this->x = $pdf->GetX(); } else { $this->x = $pdf->addMarginX($this->x); $pdf->SetX($curx); } if ($this->y == ".") { //-- first check for a collision with the last picture if (isset($lastpicbottom)) { if ($pdf->PageNo() == $lastpicpage && $lastpicbottom >= $pdf->GetY() && $this->x >= $lastpicleft && $this->x <= $lastpicright) { $pdf->SetY($lastpicbottom + 5); } } $this->y = $pdf->GetY(); } else { $pdf->SetY($this->y); } if ($pdf->getRTL()) { $pdf->Image($this->file, $pdf->getPageWidth() - $this->x, $this->y, $this->width, $this->height, "", "", $this->line, false, 72, $this->align); } else { $pdf->Image($this->file, $this->x, $this->y, $this->width, $this->height, "", "", $this->line, false, 72, $this->align); } $lastpicpage = $pdf->PageNo(); $pdf->lastpicpage = $pdf->getPage(); $lastpicleft = $this->x; $lastpicright = $this->x + $this->width; $lastpicbottom = $this->y + $this->height; // Setup for the next line if ($this->line == "N") { $pdf->SetY($lastpicbottom); } }
$this->Cell(48, 5, utf8_decode("Fecha Impresión " . Date::today()), 0, 0, 'L'); $this->Cell(48, 5, utf8_decode('Página') . $this->PageNo() . '/{nb}', 0, 0, 'R'); } } $pdf = new PDF('P', 'mm', array(105, 148)); $pdf->AliasNbPages(); for ($i = 0; $i < 2; $i++) { $pdf->AddPage(); $pdf->Rect(10, 10, 85, 128); $pdf->Line(10, 20, 95, 20); $pdf->Line(10, 30, 95, 30); $pdf->SetFont('helvetica', 'B', 7); $pdf->SetFillColor(120, 120, 120); $pdf->SetTextColor(255, 255, 255); $pdf->SetX(10); $pdf->SetY(10); $pdf->Cell(85, 10, utf8_decode($this->planillaDataDet[0]['id_personal'] . " - " . $this->planillaDataDet[0]['nombre_personal']), 1, 0, 'C', true); $pdf->Ln(13); $pdf->SetTextColor(0, 0, 0); $pdf->Cell(15, 5, utf8_decode('BOLETA INFORMATIVA DETALLE'), 0, 0, 'L'); $pdf->Ln(10); $pdf->Cell(65, 5, utf8_decode('Básico ' . $this->planillaDataDet[0]['nom_planilla'] . ' ( ' . $this->planillaDataDet[0]['periodo'] . ' )'), 0, 0, 'L'); $pdf->Cell(20, 5, utf8_decode($this->planillaDataDet[0]['neto_total'] + $this->planillaDataDet[0]['monto_asig_familiar'] + $this->planillaDataDet[0]['otros_descuentos']), 0, 0, 'R'); $pdf->Ln(5); $pdf->Cell(15, 5, utf8_decode('DESCUENTOS'), 0, 0, 'L'); $pdf->Ln(5); foreach ($this->planillaDataDesc as $b) { $pdf->Cell(65, 5, utf8_decode($b['nom_descuento'] . " - " . $b['detalle_descuento']), 0, 0, 'L'); $pdf->Cell(20, 5, utf8_decode($b['monto_descuento']), 0, 0, 'R'); $pdf->Ln(5); }
/*======================================================= frederick >>> change this; incorrect arrangement of variable >> SEE: function setLGUinfo (line # 22) $pdf->setLGUinfo($getlgu[0],$getprov[0],$resulta[2]); ===========================================================*/ $pdf->setLGUinfo($getprov[0], $getlgu[0], $resulta[2]); $pdf->setYears($dateprev, $datenext, $datenextnext); $pdf->AddPage(); $pdf->AliasNbPages(); $getnat = @mysql_query("select * from ebpls_buss_nature"); $Y_Label_position = 50; $Y_Table_Position = 55; //header $dateprinted = date('Y-m-d'); $pdf->SetFont('Arial', 'B', 6); $pdf->SetY($Y_Label_position); $pdf->SetX(5); $pdf->Cell(340, 5, $dateprinted, 0, 1, 'R'); $pdf->SetFont('Arial', 'B', 6); $pdf->SetY($Y_Label_position + 10); $pdf->SetX(5); $pdf->Cell(100, 10, 'LINE OF BUSINESS', 1, 0, 'C'); $pdf->SetX(105); $pdf->Cell(60, 5, $dateprev, 1, 0, 'C'); $pdf->SetX(165); $pdf->Cell(60, 5, $datenext, 1, 0, 'C'); $pdf->SetX(225); $pdf->Cell(60, 5, $datenextnext, 1, 0, 'C'); $pdf->SetY($Y_Label_position + 15); $pdf->SetX(5); $pdf->Cell(100, 5, '', 0, 0, 'C');
<?php define('FPDF_FONTPATH', 'font/'); require_once 'mysql_table.php'; include "comunes.php"; include "../conectar.php"; $pdf = new PDF(); $pdf->Open(); $pdf->AddPage(); //Nombre del Listado $pdf->SetFillColor(255, 255, 255); $pdf->SetFont('Arial', 'B', 16); $pdf->SetY(40); $pdf->SetX(0); $pdf->MultiCell(290, 6, "Listado de Cobradores", 0, C, 0); $pdf->Ln(); //Restauracin de colores y fuentes $pdf->SetFillColor(224, 235, 255); $pdf->SetTextColor(0); $pdf->SetFont('Arial', 'B', 7); //Buscamos y listamos las familias $nombreentidad = $_POST["nombrecobrador"]; $codentidad = $_POST["codcobrador"]; $where = "1=1"; if ($codcobrador != "") { $where .= " AND codcobrador='{$codcobrador}'"; } if ($nombrecobrador != "") { $where .= " AND nombrecobrador like '%" . $nombrecobrador . "%'"; } $where2 .= " ORDER BY nombrecobrador ASC";
$this->SetFont('Times', '', 12); // Imprimir texto en una columna de 6 cm de ancho $this->MultiCell(60, 5, $txt); $this->Ln(); // Cita en itálica $this->SetFont('', 'I'); $this->Cell(0, 5, '(fin del extracto)'); // Volver a la primera columna $this->SetCol(0); } } $dias = array("Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sábado"); $meses = array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"); $pdf = new PDF(); $pdf->AddPage(); $pdf->SetY(35); $pdf->SetX(110); $pdf->SetFont('Times', '', 10); $pdf->Cell(40, 8, utf8_decode("Fecha de Expedicion: ") . utf8_decode($dias[date('w')] . " " . date('d') . " de " . $meses[date('n') - 1] . " del " . date('Y')), 0, 1); $pdf->SetY(45); $pdf->SetX(20); $pdf->Cell(100, 8, utf8_decode("Hotel : ") . $nombreHotel, 0, 0); $pdf->Cell(60, 8, utf8_decode("Folio de la venta : ") . $folioVenta, 1, 1); $pdf->SetX(20); $pdf->Cell(60, 8, utf8_decode("Direccion : ") . $direccion, 0, 1); $pdf->SetX(20); $pdf->Cell(100, 8, utf8_decode("Telefono Hotel. : ") . $telefono, 0, 0); $pdf->Cell(60, 8, utf8_decode("Opradora : ") . $opm, 1, 1); $pdf->SetX(20); $pdf->Cell(160, 8, utf8_decode("Coordinador(a) : ") . $ResConP, 1, 1); $pdf->SetX(20);
<?php define('FPDF_FONTPATH', 'font/'); require_once 'mysql_table.php'; include "comunes.php"; require "../sys/conexion.php"; $conn = new conexion(); $pdf = new PDF(); $pdf->Open(); $pdf->AddPage(); //Nombre del Listado $pdf->SetFillColor(255, 255, 255); $pdf->SetFont('Arial', 'B', 16); $pdf->SetY(20); $pdf->SetX(0); @$pdf->MultiCell(290, 6, "Lista Precio Netos de Articulos Tienda", 0, C, 0); $pdf->Ln(); //Restauracion de colores y fuentes $pdf->SetFillColor(224, 235, 255); $pdf->SetTextColor(0); $pdf->SetFont('Arial', 'B', 7); //Buscamos y listamos las familias $sel_articulos = "select articulos.*,familias.nombre from articulos,familias where articulos.codfamilia=familias.codfamilia and articulos.borrado=0 order by familias.codfamilia asc, articulos.codarticulo asc"; $rs_articulos = $conn->consulta($sel_articulos); $contador = 0; $item = 1; $valortotal = 0; $numero_articulos = $conn->num_rows($rs_articulos); if ($numero_articulos > 0) { $pdf->SetFont('Arial', '', 8); @$pdf->MultiCell(220, 6, $row["nombre"], 0, L, 0);
$pdf->Cell(2, 5, ":", 0, 0, 'L'); $pdf->Cell(33, 5, $bar1->keterangan, 0, 0, 'L'); $pdf->Ln(); $pdf->Ln(); } $str1 = "select * from " . $dbname . ".pad_photo\r\n where idlahan = '" . $idlahan . "'"; $res1 = mysql_query($str1); while ($bar1 = mysql_fetch_object($res1)) { $pdf->Cell(13, 5, $_SESSION['lang']['photo'], 0, 0, 'L'); $pdf->Cell(2, 5, ":", 0, 0, 'L'); $pdf->Cell(73, 5, $bar1->filename, 0, 0, 'L'); $pdf->Ln(); $yey = $pdf->GetY(); $path = 'filepad/' . $bar1->filename; $pdf->Image($path, 25, $yey, 70); $pdf->SetY($yey + 80); $pdf->Ln(); } $pdf->Output(); exit; break; case 'update': $str = "update " . $dbname . ".pad_lahan \r\n set pemilik=" . $pemilik . ", \r\n unit='" . $unit . "', \r\n lokasi='" . $lokasi . "', \r\n luas=" . $luas . ", \r\n luasdapatditanam=" . $bisaditanam . ", \r\n rptanaman=" . $rptanaman . ", \r\n rptanah=" . $rptanah . ", \r\n totalgantirugi=" . ($rptanaman + $rptanah) . ", \r\n statuspermintaandana=" . $statuspermintaandana . ", \r\n statuspermbayaran=" . $statuspermbayaran . ", \r\n kodeblok='" . $blok . "', \r\n statuskades=" . $statuskades . ", \r\n statuscamat=" . $statuscamat . ", \r\n tanggalpengajuan=" . $tanggalpermintaan . ", \r\n tanggalbayar=" . $tanggalbayar . ", \r\n tanggalkades=" . $tanggalkades . ", \r\n tanggalcamat=" . $tanggalcamat . ", \r\n updateby=" . $_SESSION['standard']['userid'] . ", \r\n biayakades=" . $biayakades . ", \r\n biayacamat=" . $biayacamat . ", \r\n biayamatrai=" . $biayamatrai . ", \r\n keterangan='" . $keterangan . "', \r\n nosurat='" . $nosurat . "', \r\n batastimur='" . $batastimur . "', \r\n batasbarat='" . $batasbarat . "', \r\n batasutara='" . $batasutara . "', \r\n batasselatan='" . $batasselatan . "'\r\n where idlahan=" . $mid; if (mysql_query($str)) { } else { echo " Gagal," . addslashes(mysql_error($conn)); exit; } break; case 'insert': $str = "insert into " . $dbname . ".pad_lahan (\r\n pemilik, \r\n unit, \r\n lokasi, \r\n luas, \r\n luasdapatditanam, \r\n rptanaman, \r\n rptanah, \r\n totalgantirugi, \r\n statuspermintaandana, \r\n statuspermbayaran, \r\n kodeblok, \r\n statuskades, \r\n statuscamat, \r\n tanggalpengajuan, \r\n tanggalbayar, \r\n tanggalkades, \r\n tanggalcamat, \r\n updateby, \r\n biayakades, \r\n biayacamat, \r\n biayamatrai, \r\n keterangan, \r\n nosurat, \r\n batastimur, \r\n batasbarat, \r\n batasutara, \r\n batasselatan)\r\n values(\r\n " . $pemilik . ",\r\n '" . $unit . "', \r\n '" . $lokasi . "',\r\n " . $luas . ",\r\n " . $bisaditanam . ",\r\n " . $rptanaman . ", \r\n " . $rptanah . ", \r\n " . ($rptanaman + $rptanah) . ",\r\n " . $statuspermintaandana . ", \r\n " . $statuspermbayaran . ", \r\n '" . $blok . "', \r\n " . $statuskades . ", \r\n " . $statuscamat . ",\r\n " . $tanggalpermintaan . ",\r\n " . $tanggalbayar . ",\r\n " . $tanggalkades . ",\r\n " . $tanggalcamat . ",\r\n " . $_SESSION['standard']['userid'] . ",\r\n " . $biayakades . ",\r\n " . $biayacamat . ", \r\n " . $biayamatrai . ",\r\n '" . $keterangan . "', \r\n '" . $nosurat . "', \r\n '" . $batastimur . "',\r\n '" . $batasbarat . "', \r\n '" . $batasutara . "', \r\n '" . $batasselatan . "' \r\n )";
} } $pdf = new PDF('L', 'mm', 'A4'); $pdf->AddPage(); $th = $_REQUEST['th']; $kdunit = $_REQUEST['kdunit']; $renstra = th_renstra($th); $font = 'Arial'; $noborder = 0; $border = 1; $size = 10; $ln = 5; $margin = 5; $tinggi = 275; $y = $pdf->GetY(); $pdf->SetY($y); $pdf->Image('../../css/images/logo_lapan.jpg', 135, 5, 30, 30, 'jpg'); $y = $pdf->GetY(); $pdf->Cell(0, 30, '', '', 1, 'L'); $oSatker = mysql_query("SELECT NAMA FROM t_satker WHERE KDUNITKERJA = '{$kdunit}' "); $Satker = mysql_fetch_array($oSatker); $kdeselon1 = substr($kdunit, 0, 3) . '000'; $oEselon = mysql_query("SELECT nama FROM tb_unitkerja WHERE kdunit = '{$kdeselon1}' "); $Eselon = mysql_fetch_array($oEselon); $w = array(0, 290); $pdf->SetFont($font, 'B', $size + 2); $pdf->SetX($margin + $w[0]); $pdf->Cell($w[1], $ln, 'RENCANA AKSI DARI PENETAPAN KINERJA', '', 1, 'C'); $pdf->SetX($margin + $w[0]); $pdf->Cell($w[1], $ln, trim(strtoupper(nm_unit($kdunit))), '', 1, 'C'); $pdf->Ln() * 2;
// $pdf->Cell(40,10,number_format($dtNoakunRup[$thnBudget][$lstThaTnm][$ktKrgng],0),1,0,'R',1); // $pdf->Cell(40,10,number_format($hslBagi[$thnBudget][$lstThaTnm][$ktKrgng],0),1,0,'R',1); // } // } // // } // //$pdf->Cell($colTotal,$height,"",1,1,'C',1); // // $brs=0; // $awal=1; // //$totAkun+=1; // } $pdf->SetFont('Arial', '', 5); $yAkhir = $pdf->GetY(); $xPertama = $pdf->GetX(); $pdf->SetY($yAkhir); $pdf->SetX($xPertama); $pdf->Cell(58, $height, $barisNoakun, 1, 0, 'L', 1); $pdf->Cell(150, $height, $optKegiatan[$barisNoakun], 1, 0, 'L', 1); //echo $totRupiah[$thnBudget][$barisNoakun]."<br>"; if (substr($barisNoakun, 0, 1) == '1') { @($hasilBagi[$barisNoakun] = $totRupiah[$thnBudget][$barisNoakun] / $ttlLuastbm); } else { @($hasilBagi[$barisNoakun] = $totRupiah[$thnBudget][$barisNoakun] / $ttlLuastm); } $pdf->Cell(40, 10, number_format($totRupiah[$thnBudget][$barisNoakun], 0), 1, 0, 'R', 1); $pdf->Cell(40, 10, number_format($hasilBagi[$barisNoakun], 0), 1, 0, 'R', 1); $grndTotal += $totRupiah[$thnBudget][$barisNoakun]; $grndTotalHsil += $hasilBagi[$barisNoakun]; $yAkhir = $pdf->GetY(); $xPertama = $pdf->GetX();
//Calculamos la provincia $codigoprovincia = $lafila["codprovincia"]; $consulta = "select * from provincias where codprovincia='{$codigoprovincia}'"; $query = mysql_query($consulta); $row = mysql_fetch_array($query); $pdf->Ln(5); $pdf->Cell(20); $pdf->Cell(80, 4, $lafila["codpostal"] . " - " . $lafila["direccion"] . " - " . $row["nombreprovincia"], 0, 0, 'L', 0); $pdf->Cell(10); $pdf->Cell(10, 4, $codfactura, 0, 0, 'L', 0); //$pdf->Ln(14); $pdf->Ln(5); $pdf->Cell(20); $pdf->Cell(40, 4, $lafila["localidad"], 0, 0, 'L', 0); //ahora mostramos las lneas de la factura $pdf->SetY(60); $consulta2 = "Select * from factulinea where codfactura='{$codfactura}' order by numlinea"; $resultado2 = mysql_query($consulta2, $conexion); $contador = 1; $lineas = 0; //agregado por errores joanlaga while ($row = mysql_fetch_array($resultado2)) { $pdf->Cell(20); $contador++; $codarticulo = mysql_result($resultado2, $lineas, "codigo"); $codfamilia = mysql_result($resultado2, $lineas, "codfamilia"); $cantidad1 = number_format(mysql_result($resultado2, $lineas, "cantidad"), 1, ".", ","); $pdf->Cell(4, 4, $cantidad1, 0, 0, 'C'); // $pdf->Cell(4,4,mysql_result($resultado2,$lineas,"cantidad"),0,0,'C'); $sel_articulos = "SELECT * FROM articulos WHERE codarticulo='{$codarticulo}' AND codfamilia='{$codfamilia}'"; $rs_articulos = mysql_query($sel_articulos);
$resv = mysql_query($strv); $barv = mysql_fetch_object($resv); $namabarang = $barv->namabarang; $pdf->Cell(8, 5, $no, 1, 0, 'L', 1); $pdf->Cell(42, 5, $bar->nopo, 1, 0, 'L', 1); $pdf->Cell(28, 5, $kodebarang, 1, 0, 'C', 1); $pdf->Cell(80, 5, $namabarang, 1, 0, 'L', 1); $pdf->Cell(15, 5, $satuan, 1, 0, 'L', 1); $pdf->Cell(18, 5, number_format($jumlah, 2, '.', ','), 1, 1, 'R', 1); } //footer================================ // $dtpenerima=namakaryawan($dbname,$conn,$penerima); // $dtpengetahui=namakaryawan($dbname,$conn,$pengetahui); $dptinY = $pdf->GetY(); $dptinX = $pdf->GetX(); $pdf->SetY($dptinY + 25); $pdf->SetX($dptinX); $pdf->SetFillColor(255, 255, 255); $pdf->SetFont('Arial', 'B', 8); if (substr($expend, 0, 1) == 'S') { $dert = $_SESSION['lang']['expeditor']; $duer = $optSupplier[$expend]; } else { $dert = $_SESSION['lang']['dibawa']; $duer = $optKary[$expend]; } $pdf->Cell(50, $height, $_SESSION['lang']['penerima'] . ",", 0, 0, 'C', 0); $pdf->Cell(70, $height, $dert . ",", 0, 0, 'C', 0); $pdf->Cell(65, $height, $_SESSION['lang']['pengirim'] . ",", 0, 1, 'C', 0); $pdf->ln(25); $pdf->SetFont('Arial', 'U', 8);
$this->SetFont('Arial', 'I', 8); $this->Cell(10, 10, 'Page ' . $this->PageNo() . " / {totalPages}", 0, 0, 'L'); } } //================================ $pdf = new PDF('L', 'pt', 'A4'); $pdf->AliasNbPages('{totalPages}'); $width = $pdf->w - $pdf->lMargin - $pdf->rMargin; $height = 10; $tnggi = $jmlHari * $height; $pdf->AddPage(); // $pdf->SetFillColor(255,255,255); // $pdf->SetFont('Arial','B',5); $tinggiAkr = $pdf->GetY(); $ksamping = $pdf->GetX(); $pdf->SetY($tinggiAkr + 20); $pdf->SetX($ksamping + 500); $pdf->SetFont('Arial', 'B', 6); $pdf->SetFillColor(255, 255, 255); $pdf->Cell(65, $height, " ", R, 0, 'C', 1); $pdf->SetFillColor(220, 220, 220); $pdf->Cell(135, $height, $_SESSION['lang']['anggaran'], TLR, 0, 'C', 1); $pdf->Cell(90, $height, $_SESSION['lang']['realisasi'], TLR, 1, 'C', 1); $tinggiAkr = $pdf->GetY(); $ksamping = $pdf->GetX(); $pdf->SetY($tinggiAkr); $pdf->SetX($ksamping + 500); $pdf->SetFillColor(255, 255, 255); $pdf->Cell(65, $height, " ", R, 0, 'C', 1); $pdf->SetFillColor(220, 220, 220); $pdf->Cell(45, $height, $_SESSION['lang']['setahun'], TBLR, 0, 'C', 1);
FREDERICK -> change Paper Orientation from Landscape to Portrait $pdf=new PDF('L','mm','Legal'); */ $pdf = new PDF('P', 'mm', 'Legal'); //change arrangement of $getlgu & $getprov SEE: function setLGUinfo on line 19 //$pdf->setLGUinfo($getlgu[0],$getprov[0],$resulat[2]); $pdf->setLGUinfo($getprov[0], $getlgu[0], 'Office of the Treasurer'); //--------------------------------------------------------------------- $pdf->AddPage(); $pdf->AliasNbPages(); $Y_Label_position = 50; $Y_Table_Position = 55; $resultpp = @mysql_query("select * from ebpls_buss_taxfeetype where taxfeetype='{$taxtype}'") or die(mysql_error()); $gettype = @mysql_fetch_array($resultpp); //header $pdf->SetFont('Arial', 'B', 6); $pdf->SetY($Y_Label_position); /*==================================================== FREDERICK -> change X Coordinate from 5 to 55: /$pdf->SetX(5); */ $pdf->SetX(55); //==================================================== $pdf->Cell(50, 5, $gettype[typedesc], 1, 0, 'C'); /*==================================================== FREDERICK -> removed this X Coordinate /$pdf->SetX(55); =====================================================*/ $pdf->Cell(55, 5, 'COLLECTION', 1, 1, 'C'); //second line $totalamount = 0; while ($getfees = mysql_fetch_array($result)) { $Yx++;
$pdf->ln(4); $pdf->SetFont($fonttype, '', 10); $pdf->Write(5, $request->GetVar('hotel_zip', 'session') . " " . $request->GetVar('hotel_city', 'session')); // Headline $pdf->SetXY(120, $y); $pdf->SetFont($fonttype, 'B', 12); $pdf->Write(5, "Meldeschein für Beherbergungsstätten"); $pdf->SetXY(120, $y + 5); $pdf->SetFont($fonttype, '', 6); $pdf->Write(3, "Rechtsgrundlage für die Erhebung der nachfolgend aufgeführten Daten sind"); $pdf->SetXY(120, $y + 8); $pdf->Write(3, "§§23 und 24 des Meldegesetzes vom 11. April 1983 (GBI. S. 117)"); $pdf->SetFont($fonttype, 'B', 10); $pdf->SetXY(10, 60); $pdf->Write(5, "Tag der Ankunft"); $pdf->SetY(65); $pdf->Write(5, "Tag der voraussichtlichen Abreise"); $pdf->SetY(70); $pdf->Write(5, "Familienname"); $pdf->SetY(75); $pdf->Write(5, "Vornamen"); $pdf->SetY(80); $pdf->Write(5, "Geburtsdatum"); $pdf->SetY(85); $pdf->Write(5, "Geburtsort"); $pdf->SetY(90); $pdf->Write(5, "Staatsangehörigkeit"); $pdf->SetY(95); $pdf->Write(5, "Ausweis"); $pdf->SetY(100); $pdf->Write(5, "Ausstellende Behörde, Ausstellungsdatum");
//Llama al constructor de su clase Padre. //Modificar aka segun la forma del papel del reporte parent::__construct('P', 'mm', 'A4'); //parent::__construct('P','mm','Letter'); } } //Creación del objeto de la clase heredada $pdf = new PDF(); $pdf->SetTopMargin(5.4); $pdf->SetLeftMargin(1.5); $pdf->AliasNbPages(); $pdf->SetFont('Arial', '', 9); $pdf->AddPage(); $pdf->Ln(); //Construcción de la tabla a mostrar $pdf->SetY(90); $pdf->SetFont('Arial', 'b', 11); $pdf->Text(23, 80, iconv('utf-8', 'cp1252', 'Item')); $pdf->Text(35, 80, iconv('utf-8', 'cp1252', 'Productos')); $pdf->Text(125, 80, 'Total Ventas'); $pdf->Text(167, 80, iconv('utf-8', 'cp1252', 'Fecha')); $pdf->SetFont('Arial', '', 10); $pdf->Line(20, 82, 190, 82); $pdf->Line(20, 83, 190, 83); $j = 0; foreach ($fila as $key) { $j = $j + 1; $productos = iconv('utf-8', 'cp1252', $key[0]); $TotalVentas = iconv('utf-8', 'cp1252', $key[1]); $fecha = date_format(date_create($key[2]), 'd/m/Y'); $pdf->Text(25, $pdf->GetY(), $j);
$result = mysql_query("select lguname, lguprovince, lguoffice from ebpls_buss_preference") or die(mysql_error()); $resulta = mysql_fetch_row($result); $getlgu = @mysql_query("select city_municipality_desc from ebpls_city_municipality where city_municipality_code = '{$resulta['0']}'"); $getlgu = @mysql_fetch_row($getlgu); $getprov = @mysql_query("select province_desc from ebpls_province where province_code = '{$resulta['1']}'"); $getprov = @mysql_fetch_row($getprov); if ($cap_inv2 == "" || $cap_inv2 == 0) { $cap_inv2 = 9999999999999; } //$pdf=new FPDF('L','mm','Legal'); $pdf = new PDF('L', 'mm', 'Legal'); $pdf->setLGUinfo($getlgu[0], $getprov[0], ''); $pdf->AddPage(); $pdf->AliasNbPages(); $pdf->SetFont('Arial', 'B', 10); $pdf->SetY(40); $pdf->SetX(10); $pdf->Cell(25, 5, '', 0, 0, 'L'); $pdf->SetX(50); $pdf->Cell(100, 5, '', 0, 1, 'L'); $Y_Label_position = 50; $Y_Table_Position = 55; $pdf->SetFont('Arial', 'B', 6); $pdf->SetY(50); $pdf->SetX(5); $pdf->Cell(30, 5, 'USER NAME', 1, 0, 'C'); $pdf->Cell(280, 5, 'ACTIVITY', 1, 0, 'C'); $pdf->Cell(25, 5, 'DATE', 1, 1, 'C'); $date_from = str_replace("/", "", $date_from); $idate = strtotime($date_from); //$idate = $idate - (60*60*24);
//================================ $pdf = new PDF('L', 'pt', 'A4'); $width = $pdf->w - $pdf->lMargin - $pdf->rMargin; $height = 10; $pdf->AddPage(); $pdf->SetFillColor(255, 255, 255); $pdf->SetFont('Arial', '', 4.5); if ($modPil != '2') { $ang = 1; $totalThn = count($dtThnBudget); $totalThn = $totalThn + 1; foreach ($dtThnBudget as $brsThnBudget) { if ($ang == 1) { $bmilY = $pdf->GetY(); $bmilX = $pdf->GetX(); $pdf->SetY($bmilY + 10); $pdf->Cell(15, $height, $ang, 1, 0, 'C'); $modPil == '0' ? $pdf->Cell(50, $height, $brsThnBudget, 1, 0, 'L') : $pdf->Cell(50, $height, $brsThnBudget . "[" . $dtJmlhThnTnm[$thnBudget][$brsThnBudget] . "]", 1, 0, 'L'); } else { if ($ang < $totalThn) { $bmilY = $pdf->GetY(); $bmilX = $pdf->GetX(); $pdf->SetY($bmilY + 10); $pdf->Cell(15, $height, $ang, 1, 0, 'C'); $modPil == '0' ? $pdf->Cell(50, $height, $brsThnBudget, 1, 0, 'L') : $pdf->Cell(50, $height, $brsThnBudget . "[" . $dtJmlhThnTnm[$thnBudget][$brsThnBudget] . "]", 1, 0, 'L'); } } $ang += 1; for ($pdfAngk = 1; $pdfAngk <= $totalUnit + 1; $pdfAngk++) { if ($pdfAngk != $totalUnit + 1) { if ($dtJmlhLuas[$thnBudget][$dtKdunit[$pdfAngk]][$brsThnBudget] == '' || $dtJjg[$thnBudget][$dtKdunit[$pdfAngk]][$brsThnBudget] == '' || $dtJmlhKg[$thnBudget][$dtKdunit[$pdfAngk]][$brsThnBudget] == '') {
$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'); $pdf->Cell($w, 4, isset($g_node_strings[1][2]) ? $g_node_strings[1][2] : '', 0, 0, 'L'); # Person 2 $pdf->SetY($top); $pdf->SetX($c2x); $pdf->Cell($w, $c2h, '', 1, 0, 'L'); $pdf->SetY($top + $c2h / 2 - 6); $pdf->SetX($c2x);
$result = mysql_query("select lguname, lguprovince, lguoffice from ebpls_buss_preference") or die(mysql_error()); $resulta = mysql_fetch_row($result); $getlgu = @mysql_query("select city_municipality_desc from ebpls_city_municipality where city_municipality_code = '{$resulta['0']}'"); $getlgu = @mysql_fetch_row($getlgu); $getprov = @mysql_query("select province_desc from ebpls_province where province_code = '{$resulta['1']}'"); $getprov = @mysql_fetch_row($getprov); if ($cap_inv2 == "" || $cap_inv2 == 0) { $cap_inv2 = 9999999999999; } //$pdf=new FPDF('L','mm','Legal'); $pdf = new PDF('L', 'mm', 'Legal'); $pdf->setLGUinfo($getlgu[0], $getprov[0], ''); $pdf->AddPage(); $pdf->AliasNbPages(); $pdf->SetFont('Arial', 'B', 10); $pdf->SetY(40); $pdf->SetX(10); $pdf->Cell(25, 5, '', 0, 0, 'L'); $pdf->SetX(50); $pdf->Cell(100, 5, '', 0, 1, 'L'); $Y_Label_position = 50; $Y_Table_Position = 55; $pdf->SetFont('Arial', 'B', 6); $pdf->SetY($Y_Label_position); $pdf->SetX(5); $pdf->Cell(25, 5, 'PERMIT #', 1, 0, 'C'); $pdf->Cell(80, 5, 'OWNER', 1, 0, 'C'); $pdf->Cell(100, 5, 'ADDRESS', 1, 0, 'C'); $pdf->Cell(50, 5, 'BOAT NAME', 1, 0, 'C'); $pdf->Cell(25, 5, '# OF CREW', 1, 0, 'C'); $pdf->Cell(25, 5, 'REGISTRATION #', 1, 0, 'C');
/** * Show footer of page. Need this->emetteur object * * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text * @return void */ function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) { $default_font_size = pdf_getPDFFontSize($outputlangs); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetY(-23); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("GoodStatusDeclaration"), 0, 'L'); $pdf->SetY(-13); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ToAndDate"), 0, 'C'); $pdf->SetXY(120, -23); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("NameAndSignature"), 0, 'C'); // Show page nb only on iso languages (so default Helvetica font) //if (pdf_getPDFFont($outputlangs) == 'Helvetica') //{ // $pdf->SetXY(-10,-10); // $pdf->MultiCell(11, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0); //} }
$this->Cell(35, 5, $periode, '', 0, 'L'); } $this->Ln(); } function Footer() { $this->SetY(-15); $this->SetFont('Arial', 'I', 8); $this->Cell(10, 10, 'Page ' . $this->PageNo(), 0, 0, 'C'); } } $pdf = new PDF('L', 'mm', 'A4'); $pdf->AddPage(); $pdf->Ln(); $pdf->SetFont('Arial', 'U', 15); $pdf->SetY(60); $pdf->Cell(250, 5, $_SESSION['lang']['pemeliharaanMesinReport'], 0, 1, 'C'); $pdf->Ln(); $pdf->SetFont('Arial', 'B', 9); $pdf->SetFillColor(220, 220, 220); $pdf->Cell(8, 5, 'No', 1, 0, 'L', 1); $pdf->Cell(40, 5, $_SESSION['lang']['notransaksi'], 1, 0, 'C', 1); $pdf->Cell(20, 5, $_SESSION['lang']['tanggal'], 1, 0, 'C', 1); $pdf->Cell(25, 5, $_SESSION['lang']['kodebarang'], 1, 0, 'C', 1); $pdf->Cell(60, 5, $_SESSION['lang']['namabarang'], 1, 0, 'C', 1); $pdf->Cell(15, 5, $_SESSION['lang']['satuan'], 1, 0, 'C', 1); $pdf->Cell(15, 5, $_SESSION['lang']['jumlah'], 1, 0, 'C', 1); $pdf->Cell(15, 5, $_SESSION['lang']['shift'], 1, 0, 'C', 1); $pdf->Cell(25, 5, $_SESSION['lang']['mesin'], 1, 0, 'C', 1); $pdf->Cell(30, 5, $_SESSION['lang']['jammulai'], 1, 0, 'C', 1); $pdf->Cell(30, 5, $_SESSION['lang']['jamselesai'], 1, 1, 'C', 1);
$dcpath = '/home/www/divyaeng2/dcpdfs/'; $mlistchunk = explode('<||>', $miscitems); $j = 0; for ($i = 0; $i < count($mlistchunk); $i++) { $dqr_list[$j] = explode('<|>', $mlistchunk[$i]); $j++; } $supp = new Supplier(); $supp->setSID($_POST['Supplier_ID']); $supp->setSupplierDetails(); $pdf = new PDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); //$pdf->AliasNbPages(); $pdf->setAutoPageBreak(TRUE, 45); $pdf->AddPage('P', 'A4'); $pdf->SetFont('helvetica', 'B', 13); $pdf->SetY(56); $pdf->Cell(125, 8, $supp->getName(), 0, 0, 'L'); $pdf->SetFont('helvetica', 'B', 14); $pdf->Cell(100, 8, "DC NO: {$dcno}", 0, 1, 'L'); $pdf->SetFont('helvetica', '', 13); $pdf->Cell(125, 8, $supp->getAddressl1(), 0, 0, 'L'); $pdf->Cell(100, 8, "Date: {$dcdate}", 0, 1, 'L'); $pdf->Cell(125, 8, $supp->getAddressl2(), 0, 0, 'L'); $pdf->Cell(100, 8, "Your Ref: {$cref}", 0, 1, 'L'); $pdf->Cell(125, 8, "Phone No: " . $supp->getPhoneNo(), 0, 0, 'L'); $pdf->Cell(100, 8, "Date: {$crefdate}", 0, 1, 'L'); $pdf->ln(); $pdf->line(0, 87, 220, 87); //line before mode of dispatch $pdf->setY(86); $pdf->MultiCell(125, 16, "Please receive the following materials and acknowledge the receipt", 0, 'L', 0, 0, '', '', true, 0, false, true, 16, 'M', true);
$pdf->Ln(5); $contador = $contador + 1; } //Calculamos los valores del final de la factura $importe4 = number_format($importe, 2, ".", ","); $ivai = $lafila["iva"]; $impo = $importe * ($ivai / 100); $impo = sprintf("%01.2f", $impo); $total = $importe + $impo; $total = sprintf("%01.2f", $total); $impo = number_format($impo, 2, ".", ","); $total = sprintf("%01.2f", $total); $total2 = number_format($total, 2, ".", ","); //Calculamos de numero a palabras $nw = new Numbers_Words(); $pdf->SetY(235); $pdf->Cell(33); //Modificamos esta parte para que tambi�n muestra la parte fraccionaria y M.N. $decimales = explode(".", $total); //$pdf->Cell(35,4,strtoupper($nw->toWords(round($total,0), "es") ." pesos ".$decimales[1]."/100 M.N."),0,0,'L',0); $pdf->Cell(35, 4, strtoupper($nw->toWords($decimales[0], "es") . " pesos " . $decimales[1] . "/100 M.N."), 0, 0, 'L', 0); $pdf->Ln(19); $pdf->Cell(155); $pdf->Cell(32, 4, $importe4, 0, 0, 'R', 0); $pdf->Ln(8); $pdf->Cell(155); $pdf->Cell(10, 4, $lafila["iva"] . " %", 0, 0, 'R', 0); $pdf->Cell(22, 4, $impo, 0, 0, 'R', 0); $pdf->Ln(8); $pdf->Cell(155); $pdf->Cell(32, 4, $total2, 0, 0, 'R', 0);
$sumbak1 = mysql_fetch_row($sumbak1); $sumbak2 = mysql_query("select sum(backtax) from comparative_statement where for_year='{$datenext}' and\n paid = 0"); $sumbak2 = mysql_fetch_row($sumbak2); $graphbak1 = $sumbak1[0] / 100000; $graphbak2 = $sumbak2[0] / 100000; $getlgu = @mysql_query("select city_municipality_desc from ebpls_city_municipality where city_municipality_code = '{$resulta['0']}'"); $getlgu = @mysql_fetch_row($getlgu); $getprov = @mysql_query("select province_desc from ebpls_province where province_code = '{$resulta['1']}'"); $getprov = @mysql_fetch_row($getprov); //$pdf=new FPDF('L','mm','Legal'); $pdf = new PDF('L', 'mm', 'Legal'); $pdf->setLGUinfo($getlgu[0], $getprov[0], $resulta[2]); $pdf->AddPage(); $pdf->AliasNbPages(); $pdf->SetFont('Arial', 'B', 10); $pdf->SetY(40); $pdf->SetX(10); $pdf->Cell(25, 5, '', 0, 0, 'L'); $pdf->SetX(50); $pdf->Cell(100, 5, '', 0, 1, 'L'); $Y_Label_position = 50; $Y_Table_Position = 55; $pdf->SetY(67); $pdf->SetX(50); $pdf->Cell(25, 5, 'Taxes', 0, 0, 'L'); $pdf->SetY(87); $pdf->SetX(50); $pdf->Cell(25, 5, 'Fees', 0, 0, 'L'); $pdf->SetY(107); $pdf->SetX(50); $pdf->Cell(25, 5, 'Surcharge', 0, 0, 'L');
$nombre = $datos["Nombre"]; } $sql = "SELECT * FROM usuarios WHERE IdUsuario = '{$IdUsuario}'"; $resultado = @mysql_query($sql) or die(mysql_error()); while ($datos = @mysql_fetch_assoc($resultado)) { $nombreU = $datos["Nombre"]; } $dias = array("Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sábado"); $meses = array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"); $pdf = new PDF(); $pdf->AddPage(); $pdf->Image('../imagenes/logo.jpg', 40, 8, 33); // Arial bold 15 $pdf->SetFont('Arial', 'B', 8); // Movernos a la derecha $pdf->SetY(4); $pdf->Cell(80); // Título $pdf->Cell(60, 5, 'Angytours', 0, 2, 'C'); $pdf->Cell(60, 5, 'Calle 59J # 565 X 110 y 112 Col Bojorquez', 0, 2, 'C'); $pdf->Cell(60, 5, 'Tel: (999)9-12-28-95 | Cel: (044)99-92-44-54-14', 0, 2, 'C'); $pdf->Cell(60, 5, 'Correo: angeviajes@hotmail.com', 0, 2, 'C'); $pdf->Cell(60, 5, 'RFC: PELA620129L36', 0, 2, 'C'); $pdf->SetFont('Arial', '', 10); $pdf->SetY(35); $pdf->SetX(140); $pdf->Cell(40, 8, utf8_decode("Fecha: ") . utf8_decode($dias[date('w')] . " " . date('d') . " de " . $meses[date('n') - 1] . " del " . date('Y')), 0, 1); $pdf->SetY(45); $pdf->SetX(20); $pdf->Cell(130, 8, utf8_decode("Cliente : ") . utf8_decode($nombre), 1, 0); $pdf->Cell(30, 8, utf8_decode("Folio : ") . $FolioGrupo, 1, 1);
{ //Title //Ensure table header is output parent::Header(); } } //Connect to database mysql_connect("{$db_hostname}", "{$db_username}", "{$db_password}"); mysql_select_db('remsdb'); $pdf = new PDF("L", "mm", array(400, 200)); $pdf->AddPage(); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Times', 'B', 16); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Times', 'B', 14); $pdf->SetY(8); $pdf->SetX(10); $pdf->Cell(0, 3, $pdfAgencyName, 0, 1, 'L'); $pdf->Ln(5); $pdf->SetFont('Times', 'B', 12); $pdf->SetTextColor(131, 130, 139); $pdf->Cell(0, 3, "Powered by Getchs;", 0, 1, 'L'); $pdf->tdheight = 5; $pdf->Ln(30); $pdf->SetFont('Times', 'B', 24); $pdf->SetTextColor(64, 64, 64); $pdf->Cell(0, 3, "LIST OF ALL ENDORSED APPLICANT", 0, 1, 'C'); $pdf->Ln(10); $pdf->AddCol("Name", 80, 'Applicant Name', 'L'); $pdf->AddCol('clientName', 70, 'Client Name', 'L'); $pdf->AddCol('endorsementDate', 60, 'Application Date', 'L');
//Arial italico 8 $this->SetFont('Arial', 'I', 7); $this->Line(10, 281, 200, 281); $this->Cell(0, 3, 'Emitido por: ' . $usuarioNome); } } //Instancia a classe gerador de pdf $pdf = new PDF(); //Define os atributos de propriedade do arquivo PDF $pdf->SetCreator('*****@*****.**'); $pdf->SetAuthor($usuarioNome . " - " . $empresaNome); $pdf->SetTitle('Detalhamento do cliente'); $pdf->SetSubject('Relatório gerado automaticamente pelo sistema'); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetY(25); $pdf->SetFont('Arial', 'B', 10); $pdf->SetFillColor(178, 178, 178); $pdf->Cell(0, 6, 'Detalhamento do Cliente', 1, 0, 'C', 1); //Nova Linha $pdf->ln(); $pdf->SetFont('Arial', 'B', 9); $pdf->Cell(0, 6, 'Tipo Cliente:', 1, 0, 'L'); $pdf->SetFont('Arial', 'I', 9); $pdf->SetX(39); $pdf->Cell(0, 6, $conta_descricao, 0, 0, 'L'); $pdf->SetX(57); $pdf->SetFont('Arial', 'B', 9); $pdf->Cell(0, 6, 'Nome/Razão Social:', 1, 0, 'L'); $pdf->SetFont('Arial', 'I', 9); $pdf->SetX(88);
$getprov = @mysql_query("select province_desc from ebpls_province where province_code = '{$resulta['1']}'"); $getprov = @mysql_fetch_row($getprov); //$pdf=new FPDF('L','mm','Legal'); $pdf = new PDF('L', 'mm', 'Legal'); /*------------------------------------------------------------------------ frederick >>> change this: $pdf->setLGUinfo($getlgu[0],$getprov[0],'Office of the Treasurer'); to this: */ $pdf->setLGUinfo($getprov[0], $getlgu[0], 'Office of the Treasurer'); //-------------------------------------------------------------------------- $pdf->AddPage(); $pdf->AliasNbPages(); $Y_Label_position = 50; $Y_Table_Position = 55; $pdf->SetFont('Arial', 'B', 6); $pdf->SetY($Y_Label_position); $dateprinted = date('Y-m-d'); $pdf->SetX(5); $pdf->Cell(340, 5, $dateprinted, 0, 1, 'R'); $pdf->SetX(5); $pdf->Cell(10, 5, 'SEQ. NO.', 1, 0, 'C'); $pdf->Cell(55, 5, 'NAME OF OWNER', 1, 0, 'C'); $pdf->Cell(60, 5, 'BUSINESS NAME', 1, 0, 'C'); $pdf->Cell(80, 5, 'BUSINESS ADDRESS', 1, 0, 'C'); $pdf->Cell(30, 5, 'CAPITAL INVESTMENT', 1, 0, 'C'); $pdf->Cell(30, 5, 'GROSS LAST YEAR', 1, 0, 'C'); $pdf->Cell(40, 5, 'OR NUMBER/PAYMENT DATE', 1, 0, 'C'); $pdf->Cell(25, 5, 'APPLICATION DATE', 1, 0, 'C'); $pdf->Cell(10, 5, 'TYPE', 1, 1, 'C'); // $result=mysql_query("select ' ', business_name, ' ' , business_street, ' ' from ebpls_business_enterprise") or die(mysql_error()); //if paid flag = 1 else flag = 0 lagay ka condition dito
$pdf->Cell(35, 4, $_SESSION['lang']['telp'], 0, 0, 'L'); $pdf->Cell(40, 4, ": " . $tlpSupplier, 0, 1, 'L'); $pdf->Cell(35, 4, $_SESSION['lang']['fax'], 0, 0, 'L'); $pdf->Cell(40, 4, ": " . $faxSupplier, 0, 1, 'L'); $pdf->Cell(35, 4, $_SESSION['lang']['namabank'], 0, 0, 'L'); $pdf->Cell(40, 4, ": " . $kdBank . " " . $kdBank, 0, 1, 'L'); $pdf->Cell(35, 4, $_SESSION['lang']['norekeningbank'], 0, 0, 'L'); $pdf->Cell(40, 4, ": " . $an . " " . $norek_sup, 0, 1, 'L'); $pdf->Cell(35, 4, $_SESSION['lang']['npwp'], 0, 0, 'L'); $pdf->Cell(40, 4, ": " . $npwp_sup, 0, 1, 'L'); $pdf->Cell(35, 4, $_SESSION['lang']['kota'], 0, 0, 'L'); $pdf->Cell(40, 4, ": " . $kota, 0, 1, 'L'); //title $pdf->SetFont('Arial', 'U', 12); $ar = round($pdf->GetY()); $pdf->SetY($ar + 5); $pdf->Cell(190, 5, strtoupper("Purchase Order"), 0, 1, 'C'); $pdf->SetY($ar + 12); //no po + tanggal po $pdf->SetFont('Arial', '', 8); $pdf->Cell(10, 4, "", 0, 0, 'L'); $pdf->Cell(20, 4, " ", 0, 0, 'L'); $pdf->SetX(163); $pdf->Cell(20, 4, $_SESSION['lang']['tanggal'], 0, 0, 'L'); $pdf->Cell(20, 4, ": " . $tglPo, 0, 0, 'L'); $pdf->SetY($ar + 17); //title $pdf->SetFont('Arial', 'B', 8); $pdf->SetFillColor(220, 220, 220); $pdf->Cell(8, 5, 'No', 1, 0, 'L', 1); $pdf->Cell(12, 5, $_SESSION['lang']['kodeabs'], 1, 0, 'C', 1);
/** * Genera un reporte en PDF * * @param array $result * @param array $sumArray * @param string $title * @param array $weightArray * @param array $headerArray */ function pdf($result, $sumArray, $title, $weightArray, $headerArray) { $config = Config::read('config'); $active_app = Router::get_application(); //Orientación if ($sumArray > 200) { $orientation = 'L'; } else { $orientation = 'P'; } $numRows = 140; //Tipo de Papel if ($sumArray > 250) { $paper = 'legal'; } else { $paper = 'letter'; } if ($paper == 'letter' && $orientation == 'P') { $widthPage = 220; $numRows = 42; } if ($paper == 'legal' && $orientation == 'L') { $widthPage = 355; $numRows = 30; } if ($paper == 'letter' && $orientation == 'L') { $widthPage = 270; $numRows = 30; } //Crear Documento PDF $pdf = new PDF($orientation, 'mm', $paper); $pdf->Open(); $pdf->AddPage(); //Nombre del Listado $pdf->SetFillColor(255, 255, 255); $pdf->AddFont('Verdana', '', 'verdana.php'); $pdf->SetFont('Verdana', '', 14); $pdf->SetY(20); $pdf->SetX(0); $pdf->Ln(); if ($config->{$active_app}->name) { $pdf->MultiCell(0, 6, strtoupper($config->{$active_app}->name), 0, "C", 0); } $pdf->MultiCell(0, 6, "REPORTE DE " . strtoupper($title), 0, "C", 0); $pdf->SetFont('Verdana', '', 12); if (isset($_SESSION['fecsis'])) { $pdf->MultiCell(0, 6, "FECHA " . date("Y-m-d"), 0, "C", 0); } $pdf->Ln(); //Colores, ancho de línea y fuente en negrita $pdf->SetFillColor(0xf2, 0xf2, 0xf2); $pdf->SetTextColor(0); $pdf->SetDrawColor(0, 0, 0); $pdf->SetLineWidth(0.2); $pdf->SetFont('Arial', 'B', 10); if ($weightArray[0] < 11) { $weightArray[0] = 11; } //Parametros del Reporte $pos = floor($widthPage / 2 - $sumArray / 2); $pdf->SetX($pos); for ($i = 0; $i <= count($headerArray) - 1; $i++) { $pdf->Cell($weightArray[$i], 7, $headerArray[$i], 1, 0, 'C', 1); } $pdf->Ln(); //Restauración de colores y fuentes $pdf->SetFillColor(224, 235, 255); $pdf->SetTextColor(0); $pdf->SetFont('Arial', 'B', 7); //print_r($weightArray); //Buscamos y listamos $n = 1; $p = 1; $t = 0; foreach ($result as $row) { //$pdf->Cell(Ancho, Alto, contenido, ?, ?, Align) if ($n > $numRows || $p == 1 && $n > $numRows - 3) { $pdf->AddPage($orientation); $pdf->SetY(30); $pdf->SetX($pos); $pdf->SetFillColor(0xf2, 0xf2, 0xf2); $pdf->SetTextColor(0); $pdf->SetDrawColor(0, 0, 0); $pdf->SetLineWidth(0.2); $pdf->SetFont('Arial', 'B', 10); for ($i = 0; $i < count($headerArray); $i++) { $pdf->Cell($weightArray[$i], 7, $headerArray[$i], 1, 0, 'C', 1); } $pdf->Ln(); $pdf->SetFillColor(224, 235, 255); $pdf->SetTextColor(0); $pdf->SetFont('Arial', 'B', 7); $n = 1; $p++; } $pdf->SetX($pos); for ($i = 0; $i <= count($row) - 1; $i++) { if (is_numeric($row[$i])) { $pdf->Cell($weightArray[$i], 5, trim($row[$i]), 'LRTB', 0, 'C'); } else { $pdf->Cell($weightArray[$i], 5, trim($row[$i]), 'LRTB', 0, 'L'); } } $n++; $t++; $pdf->Ln(); } $pdf->SetX($pos); $pdf->SetFont('Arial', 'B', 7); $pdf->SetFillColor(0xf2, 0xf2, 0xf2); $pdf->Cell($weightArray[0], 5, "TOTAL", 'LRTB', 0, 'R'); $pdf->Cell($weightArray[1], 5, $t, 'LRTB', 0, 'L'); /*print "<div style='background: url(img/bg2.jpg) #F2f2f2;border:1px solid #c0c0c0'> <table><td><img src='img/information.gif' width='64' height='64'/></td><td>"; print "Papel: $paper<br>"; print "Orientación: $orientation<br>"; print "Ancho Página: $widthPage mm<br>"; print "Número Páginas: $p<br>"; print "</td></table></div><br>";*/ $file = md5(uniqid()); $pdf->Output(CORE_PATH . 'public/temp/' . $file . ".pdf", 'F'); if (isset($raw_output)) { print "<script type='text/javascript'> window.open('" . KUMBIA_PATH . "temp/" . $file . ".pdf', null); </script>"; } else { Generator::forms_print("<script type='text/javascript'> window.open('" . KUMBIA_PATH . "temp/" . $file . ".pdf', null); </script>"); } }