function testpdf() { $this->load->library('fpdf'); $this->fpdf->FPDF('P', 'cm', 'A4'); $this->fpdf->AddPage(); //$this->fpdf->SetFont('Arial','',10); $this->fpdf->setFont('Arial', 'B', 9); $teks = "Ini hasil Laporan PDF menggunakan Library FPDF di CodeIgniter"; $this->fpdf->Cell(3, 0.5, $teks, 1, '0', 'L', true); // $this->fpdf->setFont('Arial','B',7); $this->fpdf->Text(8, 1.9, 'Jl.Zambrud I No.35 Sumur Batu - Jakarta Pusat'); $this->fpdf->Line(15.6, 2.1, 5, 2.1); $this->fpdf->Text(8, 1.9, 'Jl.Zambrud I No.35 Sumur Batu - Jakarta Pusat'); //$this->fpdf->Ln(); $this->fpdf->Output(); $this->load->library('pdf'); $pdf = new PDF(); $pdf->SetMargins(1, 1); $pdf->AddPage(); $pdf->SetFont('Arial', 'B', 14); $pdf->Cell(0, 0.5, 'Hellol Ci', 0, 1, 'C'); $pdf->Output(); /* $this->load->library('fpdf'); $this->fpdf->FPDF('P','cm','A4'); $this->fpdf->Ln(); $this->fpdf->setFont('Arial','B',9); $this->fpdf->Text(7.5,1,"DAFTAR PENJUALAN BULAN "); $this->fpdf->setFont('Arial','B',9); $this->fpdf->Text(8.3,1.5,'KOMUNITAS MUSISI INDONESIA'); $this->fpdf->setFont('Arial','B',7); $this->fpdf->Text(8,1.9,'Jl.Zambrud I No.35 Sumur Batu - Jakarta Pusat'); $this->fpdf->Line(15.6,2.1,5,2.1); $this->fpdf->ln(1.6); $this->fpdf->ln(0.3); $this->fpdf->Output(); */ }
public function formarPdf($nombreArchivo, $seleccionar) { require 'PDF.php'; $archivo = $nombreArchivo; $pdf = new PDF(); // $pdf->SetTitle($title); $pdf->AddPage(); foreach ($seleccionar as $valor) { $fueNombre = utf8_decode($valor['fueNombre']); $notTitulo = utf8_decode($valor['notTitulo']); $notContenido = utf8_decode($valor['notContenido']); $notAutor = utf8_decode($valor['notAutor']); $notEnlace = utf8_decode($valor['notEnlace']); $fuenteIgual = strcmp($fueNombre, $fueNombreAnterior); if ($fuenteIgual == 0) { $mostrarFuente = ""; } else { $mostrarFuente = $fueNombre; } $fueNombreAnterior = $fueNombre; $Fecha = '2016-06-01'; /* $body=$body.'<br>'; $body=$body.'<div>'; $body=$body.'<h2 style="text-align: center; color:#1565c0;"> <u>'.$mostrarFuente.'</u></h2>'; $body=$body.'<h4 style="text-align: left; color:#1565c0;">'.$notTitulo.'</h4>'; $body=$body.'<p style="text-align: justify;" >'.$notContenido.'</p>'; $body=$body.'<br><p style="text-align: justify;" ><small>'.$notAutor.'</small></p>'; $body=$body.'<p style="text-align: justify;" ><small> <a href="'.$notEnlace.'">'.$notEnlace.'</a></small></p>'; $body=$body.'</div>';*/ $pdf->PrintChapter($mostrarFuente, $Fecha, $notTitulo, $notContenido); } /*$fuente=utf8_decode('Fuente de información'); $Fecha='2016-06-01'; $titulo=utf8_decode('Titulo de notica'); $contenido=utf8_decode('Contenido de noticia');*/ //$pdf->SetAuthor('Julio Verne'); /* $pdf->PrintChapter($fuente, $Fecha,$titulo,$contenido); $pdf->PrintChapter($fuente, $Fecha,$titulo,$contenido); $pdf->PrintChapter($fuente, $Fecha,$titulo,$contenido); $pdf->PrintChapter($fuente, $Fecha,$titulo,$contenido); $pdf->PrintChapter($fuente, $Fecha,$titulo,$contenido); $pdf->PrintChapter($fuente, $Fecha,$titulo,$contenido); $pdf->PrintChapter($fuente, $Fecha,$titulo,$contenido); $pdf->PrintChapter($fuente, $Fecha,$titulo,'ultimo');*/ $pdf->Output(); // $pdf->Output($archivo,"f"); }
function relatorioCursoPorPolo() { $pdf = new PDF("P", "pt", "A4"); $relatorio = $this->read(); $cabeçalhoTabela = array('Curso', 'Tipo'); $polo = ""; $array = array(); foreach ($relatorio as $value) { if ($polo == "") { $polo = $value->getPolo()->getId(); $pdf->setVendedor($value->getPolo()->getNome()); $pdf->AddPage(); } if ($polo != $value->getPolo()->getId()) { $pdf->BasicTable($cabeçalhoTabela, $array); $array = array(); $polo = $value->getPolo()->getId(); $pdf->setVendedor($value->getPolo()->getNome()); $pdf->AddPage(); array_push($array, array($value->getNome(), $value->getTipo()['descricao'])); } else { array_push($array, array($value->getNome(), $value->getTipo()['descricao'])); } } $pdf->BasicTable($cabeçalhoTabela, $array); $pdf->Output(); }
public function getPDF() { /*$pdf = new PDF(); $docentes = Docente::all(); $columnas = ['NRO','CODIGO','APELLIDOS Y NOMBRES']; $pdf->SetFont('Arial','B',13); $pdf->AddPage(); $pdf->Cell(80); $pdf->Cell(30,5,'Lista de Docentes',0,1,'C'); $pdf->SetFont('Arial','B',9); $pdf->Ln(2); $pdf->SetFont('Arial','B',10); $pdf->docentes($columnas,$docentes); $cabe=['Content-Type' => 'application/pdf']; return Response::make($pdf->_checkoutput(),200,$cabe);*/ $fpdf = new PDF(); $docentes = Docente::all(); $columnas = ['NRO', 'CODIGO', 'APELLIDOS Y NOMBRES']; $fpdf->AddPage(); $fpdf->Cell(80); $fpdf->Cell(30, 5, 'Lista de Docentes', 0, 1, 'C'); $fpdf->SetFont('Arial', 'B', 9); $fpdf->Ln(2); $fpdf->SetFont('Arial', 'B', 16); $fpdf->docentes($columnas, $docentes); $fpdf->Output(); exit; }
function Cetak() { // *** Init PDF $pdf = new PDF(); $pdf->SetTitle("Rekap Pembayaran Mahasiswa Per Bulan"); $pdf->AddPage('L', 'Legal'); $lbr = 190; BuatIsinya($_SESSION['TahunID'], $_SESSION['ProdiID'], $pdf); $pdf->Output(); }
function Cetak() { // *** Init PDF $pdf = new PDF(); $pdf->SetTitle("Pembayaran Mahasiswa Per Periode"); $pdf->AddPage(); $lbr = 190; BuatIsinya($_SESSION['TahunID'], $_SESSION['ProdiID'], $pdf); $pdf->Output(); }
public function index() { $pdf = new PDF(); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('Times', '', 12); for ($i = 1; $i <= 40; $i++) { $pdf->Cell(0, 10, 'Printing line number ' . $i, 0, 1); } $pdf->Output(); }
function Cetak() { // *** Init PDF $pdf = new PDF(); $pdf->SetTitle("Penjualan Formulir"); $pdf->AddPage(); $lbr = 190; BuatJudulLaporan($_SESSION['_PMBPeriodID'], $pdf); BuatIsinya($_SESSION['_PMBPeriodID'], $pdf); $pdf->Output(); }
function index() { // Instanciation of inherited class $pdf = new PDF(); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('Times', '', 12); for ($i = 1; $i <= 40; $i++) { $pdf->Cell(0, 10, 'Printing line number ' . $i, 0, 1); } $pdf->Output(); }
function relatorioDisciplinasPorCurso($id) { $pdf = new PDF("P", "pt", "A4"); $pdf->AddPage(); $pdf->SetFont('Arial', 'B', 16); $polo = new Polo(); $polo->setId($id); $polo = $polo->getById(); $pdf->Cell(40, 10, $polo->getNome()); $cabeçalhoTabela = array('Disciplina', 'Nome Tutor', 'Sobrenome Tutor'); $curso = new Curso(); $cursos = $curso->read(); foreach ($cursos as $curso) { if ($curso->getPolo()->getId() != $id) { continue; } $pdf->setVendedor($curso->getNome() . " - " . $curso->getTipo()['descricao']); $pdf->AddPage(); $disciplinaDao = new DisciplinaDao(); $array = $disciplinaDao->listDisciplinasTutoresByCurso($curso); $pdf->BasicTable($cabeçalhoTabela, $array); } $pdf->Output(); }
function __construct($datos) { $pdf = new PDF(); // [ Establesco Todos los datos que conendra la Factura ] $pdf->set_data($datos); $pdf->FPDF('P', 'mm', 'Letter'); // Esta funcion la uso cuando voy a imprimir al final el numero de la paguina $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('Arial', '', 12); //$pdf->SetTextColor(20,20,250); COLOR AZUL $pdf->SetTextColor(0, 0, 0); $pdf->menbrete(); $pdf->detalle($datos['productos']); $pdf->Output(); }
public function generateCodes(array $data) { $count = (int) $data['count']; $teacherId = $data['teacher_id']; $message = $data['message']; if (is_null($count) || is_null($teacherId)) { return false; } else { try { \DB::beginTransaction(); $teacher = Authenticator::user($teacherId); \PDF::setPrintHeader(false); \PDF::setPrintFooter(false); \PDF::AddPage(); for ($i = 0; $i < $count; $i++) { $code = $this->codeRepo->generateCode(); $data = array(); $data = array_add($data, 'student_code', $code); $data = array_add($data, 'teacher_id', $teacherId); $code = $this->codeRepo->create($data); $code->message = $message; $this->codeRepo->clearModel(); $html = View::make('pages.code')->with('code', $code)->render(); if ($i % 5 === 0 && $i !== 0) { \PDF::AddPage(); \PDF::writeHTML($html, false, false, false, false, 'L'); } else { \PDF::writeHTML($html, false, false, false, false, 'L'); } } \PDF::SetCreator(''); \PDF::SetAuthor(''); $format = '%s/%s.pdf'; $subpath = sprintf($format, 'pdfs', $teacherId); $format = '/%s/%s'; $fullpath = sprintf($format, public_path(), $subpath); \PDF::Output($fullpath, 'F'); \DB::commit(); return $subpath; } catch (\Exception $ex) { \Log::error($ex); \DB::rollback(); return false; } } }
public function listadoAction($aditionalFilter = '') { $pdf = new PDF("P", 'mm', "A4"); $pdf->SetTopMargin(15); $pdf->SetLeftMargin(10); $pdf->AliasNbPages(); $pdf->SetFillColor(210); $per = new Permisos(); $em = new EntityManager($per->getConectionName()); $query = "select t1.IdPerfil,t1.Permisos,t4.Perfil,t2.Titulo as Opcion,t3.Titulo as SubOpcion\n from AgtPermisos as t1,menu as t2, submenu as t3, perfiles as t4\n where t1.IDOpcion=t2.IDOpcion\n and t1.IDOpcion=t3.IDOpcion\n and t3.Id=t1.IDSubOpcion\n and t1.IdPerfil=t4.Id\n order by t1.IdPerfil,t1.IDOpcion,t1.IDSubOpcion;"; $em->query($query); $rows = $em->fetchResult(); $em->desConecta(); unset($per); $perant = ""; $opcant = ""; foreach ($rows as $row) { if ($perant != $row['IDPerfil']) { $pdf->AddPage(); $pdf->Cell(40, 5, $row['Perfil'], 0, 0, "L", 1); } else { $pdf->Cell(40, 5, "", 0, 0, "L", 0); } $pdf->SetFillColor(240); if ($opcant != $row['Opcion']) { $pdf->Cell(30, 5, $row['Opcion'], 0, 0, "L", 1); } else { $pdf->Cell(30, 5, "", 0, 0, "L", 0); } $perant = $row['IDPerfil']; $opcant = $row['Opcion']; $pdf->Cell(40, 5, $row['SubOpcion'], 0, 0, "L", 0); $permisos = array('C' => substr($row['Permisos'], 0, 1), 'I' => substr($row['Permisos'], 1, 1), 'B' => substr($row['Permisos'], 2, 1), 'A' => substr($row['Permisos'], 3, 1), 'L' => substr($row['Permisos'], 4, 1), 'E' => substr($row['Permisos'], 5, 1)); $pdf->Cell(13, 5, $permisos['C'], 0, 0, "C", 0); $pdf->Cell(13, 5, $permisos['I'], 0, 0, "C", 1); $pdf->Cell(13, 5, $permisos['B'], 0, 0, "C", 0); $pdf->Cell(13, 5, $permisos['A'], 0, 0, "C", 1); $pdf->Cell(13, 5, $permisos['L'], 0, 0, "C", 0); $pdf->Cell(13, 5, $permisos['E'], 0, 1, "C", 1); $pdf->SetFillColor(210); } $archivo = "docs/docs" . $_SESSION['emp'] . "/pdfs/" . md5(date('d-m-Y H:i:s')) . ".pdf"; $pdf->Output($archivo, 'F'); $this->values['archivo'] = $archivo; return array('template' => '_global/listadoPdf.html.twig', 'values' => $this->values); }
public function actionDownload() { parent::actionDownload(); $pdf = new PDF(); $pdf->title = 'Material Stock Overview List'; $pdf->AddPage('L'); $pdf->setFont('Arial', 'B', 12); // definisi font $pdf->setFont('Arial', 'B', 8); // menuliskan tabel $header = array('No', 'ID', 'Material Name', 'Sloc', 'Qty', 'UOM', 'Prod Trans Type', 'Ref Source'); $model = new Productstock('search'); $dataprovider = $model->search(); $dataprovider->pagination = false; $data = $dataprovider->getData(); $cols = $dataprovider->getKeys(); $dataku = array(count($data)); //var_dump($dataku); $w = array(10, 15, 70, 30, 30, 30, 40, 30); $pdf->SetTableHeader(); //Header for ($i = 0; $i < count($header); $i++) { $pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C', true); } $pdf->Ln(); $pdf->SetTableData(); //Data $fill = false; $i = 0; foreach ($data as $datas) { $i = $i + 1; $pdf->Cell($w[0], 6, $i, 'LR', 0, 'L', $fill); $pdf->Cell($w[1], 6, $datas['productstockid'], 'LR', 0, 'L', $fill); $pdf->Cell($w[2], 6, Product::model()->findbypk($datas['productid'])->productname, 'LR', 0, 'L', $fill); $pdf->Cell($w[3], 6, Sloc::model()->findbypk($datas['slocid'])->sloccode, 'LR', 0, 'L', $fill); $pdf->Cell($w[4], 6, $datas['qty'], 'LR', 0, 'L', $fill); $pdf->Cell($w[5], 6, Unitofmeasure::model()->findbypk($datas['unitofmeasureid'])->uomcode, 'LR', 0, 'L', $fill); $pdf->Cell($w[6], 6, Prodtranstype::model()->findbypk($datas['prodtranstypeid'])->description, 'LR', 0, 'L', $fill); $pdf->Cell($w[7], 6, $datas['refsource'], 'LR', 0, 'L', $fill); $pdf->Ln(); $fill = !$fill; } $pdf->Cell(array_sum($w), 0, '', 'T'); // me-render ke browser $pdf->Output('productstock.pdf', 'D'); }
function run() { // change some win codes, and xhtml into html $str = array('<br />' => '<br>', '<hr />' => '<hr>', '[r]' => '<red>', '[/r]' => '</red>', '[l]' => '<blue>', '[/l]' => '</blue>', '“' => '"', '”' => '"', '„' => '"', '…' => '...', '’' => '\''); foreach ($str as $_from => $_to) { $this->html = str_replace($_from, $_to, $this->html); } $pdf = new PDF('P', 'mm', 'A4'); $pdf->SetDisplayMode('real'); $pdf->AddPage(); // html $pdf->WriteHTML($this->_convert(stripslashes($this->html)), $this->bi); // output $pdf->Output(); // stop processing exit; }
public function mostrar() { if (!isset($_GET['lote'])) { echo "Error"; } else { $lote = $_GET['lote']; $sql = "Select l.tipoLote, l.fechaEntrada, b.idBulto, b.idLote, p.descripcion, p.dimAncho, p.dimAlto, p.dimLargo\n\t\t\t\t\tfrom `tbl_sga_lote`as l, `tbl_sga_bulto`as b, `tbl_sga_producto` as p\n\t\t\t\t\twhere b.idLote = '{$lote}'\n\t\t\t\t\tand b.idProducto = p.idProducto\n\t\t\t\t\tand l.idLote=b.idLote"; $query = $this->db->query($sql); $pdf = new PDF(); foreach ($query->result() as $row) { $fecha = date_create($row->fechaEntrada); $fecha = date_format($fecha, 'd-m-Y'); $pdf->AddPage(); $pdf->Fecha("{$fecha}", "{$row->idBulto}", "{$row->idLote}", "{$row->tipoLote}", "{$row->descripcion}", "{$row->dimAncho} x {$row->dimAlto} x {$row->dimLargo}"); } // $pdf = new PDF(); // $pdf->AddPage(); // $pdf->Fecha('11/10/2007','002110','PRODUCTO TERMINADO','Madera molica','200x330x3004'); // $pdf->AddPage(); // $pdf->Fecha('11/10/2007','002110','PRODUCTO TERMINADO','Madera molica','200x330x3004'); $pdf->Output(); } }
public function CorreosOrdinario() { include 'config/etiqueta.php'; $pdf = new PDF('L', 'mm', array(140, 100)); for ($x = 0; $x < count($this->pedidoExportar); $x++) { $sql = "SELECT cus.firstname, cus.lastname, dir.address1, dir.postcode, dir.city, prov.name as provincia, paisLen.name as pais\n FROM ps_orders AS ord\n INNER JOIN ps_customer AS cus ON cus.id_customer = ord.id_customer\n INNER JOIN ps_address as dir ON dir.id_address = ord.id_address_delivery\n INNER JOIN ps_state as prov on prov.id_state = dir.id_state\n INNER JOIN ps_country as pais on pais.id_country = dir.id_country\n INNER JOIN ps_country_lang as paisLen on pais.id_country = paisLen.id_country\n WHERE ord.id_order = " . $this->pedidoExportar[$x] . " and paisLen.id_lang = 1"; $datosDireccion = DB::getInstance()->ExecuteS($sql); $nomb = ""; $dir = ""; $cod = ""; $prov = ""; $pais = ""; foreach ($datosDireccion as $datPed) { $nomb = $datPed['firstname'] . " " . $datPed['lastname']; $dir = $datPed['address1']; $cod = $datPed['postcode'] . " " . utf8_decode($datPed['city']); $prov = utf8_decode($datPed['provincia']); $pais = utf8_decode($datPed['pais']); } $pdf->AddPage(); $pdf->Body($nomb, $dir, $cod, $prov, $pais); } $pdf->Output("test.pdf"); }
} } // Instanciation of inherited class $header = array('Ord Date','Ord ID','Service','Pickup Company Name','Shipping Company Name','Ord Value'); $printtotal = 1005; $pdf = new PDF(); $pdf->SetAutoPageBreak(true, 28); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('Times','',12); //$pdf->Write( 4,"To, \n$address1\n$address2\n$address3$ln$city - $pin."); //$address = getAddressBookPermanetn($_POST['cus_already_bill']); $noaddress = false; $stnoname = "Street name"; $prov = "Prov"; $postal = "600110"; $city = "chennai";
$this->Cell(30, 10, "No. PO: " . $nopo, 0, 1, 'L'); } function Footer() { global $nopo; $this->SetY(-15); $this->SetFont('Arial', 'I', 8); $this->Cell(10, 10, 'Page ' . $this->PageNo(), 0, 0, 'C'); $this->SetFont('Arial', '', 6); //$this->SetY(27); $this->SetX(163); $this->Cell(30, 10, 'PRINT TIME : ' . date('d-m-Y H:i:s'), 0, 1, 'L'); } } $pdf = new PDF('P', 'mm', 'A4'); $pdf->AddPage(); // kepada yth $pdf->SetFont('Arial', 'B', 8); if ($_SESSION['language'] == 'EN') { $pdf->Cell(30, 4, "TO :", 0, 0, 'L'); } else { $pdf->Cell(30, 4, "KEPADA YTH :", 0, 0, 'L'); } $pdf->Ln(); $arte = ""; $pdf->Cell(35, 4, $_SESSION['lang']['nm_perusahaan'], 0, 0, 'L'); $pdf->Cell(40, 4, ": " . $nmSupplier . $arte, 0, 1, 'L'); if ($cp != '') { $pdf->Cell(35, 4, $_SESSION['lang']['cperson'], 0, 0, 'L'); $pdf->Cell(40, 4, ": " . $cp, 0, 1, 'L'); }
$query1 = " \nSelect empleado.No_Empleado, CONCAT(Primer_nombre, ' ', Segundo_nombre, ' ', Primer_apellido, ' ', Segundo_Apellido) as Nombre, departamento_laboral.nombre_departamento, motivos.descripcion, \nCOUNT(permisos.id_Permisos) as Solicitudes, SUM(permisos.dias_permiso) as Inasistencias from permisos\n inner join motivos on permisos.id_motivo=motivos.Motivo_ID \n inner join empleado on empleado.No_Empleado=permisos.No_Empleado \n inner join persona on persona.N_identidad=empleado.N_identidad \n inner join departamento_laboral on departamento_laboral.id_departamento_laboral = permisos.id_departamento \n where date_format(permisos.fecha,'%d-%m-%Y') between date_format('" . $fechai . " ','%d-%m-%Y')and date_format('" . $fechaf . "','%d-%m-%Y')\t\n\tGROUP BY Primer_nombre, Segundo_nombre, Primer_apellido, Segundo_Apellido, departamento_laboral.nombre_departamento ORDER BY Primer_nombre asc"; } // con filtro del departemento if ($depto != '-1' and $motivo == '-1' and ($fechai != "" and $fechaf != "")) { $query1 = " \nSelect empleado.No_Empleado, CONCAT(Primer_nombre, ' ', Segundo_nombre, ' ', Primer_apellido, ' ', Segundo_Apellido) as Nombre, departamento_laboral.nombre_departamento,motivos.descripcion, \nCOUNT(permisos.id_Permisos) as Solicitudes, SUM(permisos.dias_permiso) as Inasistencias from permisos\n inner join motivos on permisos.id_motivo=motivos.Motivo_ID \n inner join empleado on empleado.No_Empleado=permisos.No_Empleado \n inner join persona on persona.N_identidad=empleado.N_identidad \n inner join departamento_laboral on departamento_laboral.id_departamento_laboral = permisos.id_departamento \n where departamento_laboral.nombre_departamento='" . $depto . "'\n and date_format(permisos.fecha,'%d-%m-%Y') between date_format('" . $fechai . " ','%d-%m-%Y')and date_format('" . $fechaf . "','%d-%m-%Y')\t\n\tGROUP BY Primer_nombre, Segundo_nombre, Primer_apellido, Segundo_Apellido, departamento_laboral.nombre_departamento ORDER BY Primer_nombre asc"; } // con filtro del motivos y depattamento if ($depto != '-1' and $motivo != '-1' and ($fechai != "" and $fechaf != "")) { $query1 = " \nSelect empleado.No_Empleado, CONCAT(Primer_nombre, ' ', Segundo_nombre, ' ', Primer_apellido, ' ', Segundo_Apellido) as Nombre, departamento_laboral.nombre_departamento,motivos.descripcion, \nCOUNT(permisos.id_Permisos) as Solicitudes, SUM(permisos.dias_permiso) as Inasistencias from permisos\n inner join motivos on permisos.id_motivo=motivos.Motivo_ID \n inner join empleado on empleado.No_Empleado=permisos.No_Empleado \n inner join persona on persona.N_identidad=empleado.N_identidad \n inner join departamento_laboral on departamento_laboral.id_departamento_laboral = permisos.id_departamento \n where departamento_laboral.nombre_departamento='" . $depto . "' and motivos.descripcion='" . $motivo . "' and \n date_format(permisos.fecha,'%d-%m-%Y') between date_format('" . $fechai . " ','%d-%m-%Y')and date_format('" . $fechaf . "','%d-%m-%Y')\t\n\tGROUP BY Primer_nombre, Segundo_nombre, Primer_apellido, Segundo_Apellido, departamento_laboral.nombre_departamento,motivos.descripcion ORDER BY Primer_nombre asc"; } // por fechas if ($depto == '-1' and $motivo != '-1') { $query1 = " \nSelect empleado.No_Empleado, CONCAT(Primer_nombre, ' ', Segundo_nombre, ' ', Primer_apellido, ' ', Segundo_Apellido) as Nombre, departamento_laboral.nombre_departamento, motivos.descripcion, \nCOUNT(permisos.id_Permisos) as Solicitudes, SUM(permisos.dias_permiso) as Inasistencias from permisos\n inner join motivos on permisos.id_motivo=motivos.Motivo_ID \n inner join empleado on empleado.No_Empleado=permisos.No_Empleado \n inner join persona on persona.N_identidad=empleado.N_identidad \n inner join departamento_laboral on departamento_laboral.id_departamento_laboral = permisos.id_departamento \n where motivos.descripcion='" . $motivo . "' and \n date_format(permisos.fecha,'%d-%m-%Y') between date_format('" . $fechai . " ','%d-%m-%Y')and date_format('" . $fechaf . "','%d-%m-%Y')\t\n\tGROUP BY Primer_nombre, Segundo_nombre, Primer_apellido, Segundo_Apellido, departamento_laboral.nombre_departamento,motivos.descripcion ORDER BY Primer_nombre asc"; } $pdf = new PDF(); $pdf->AddPage("L", "Letter"); $pdf->SetFont('Arial', '', 18); $pdf->Image($maindir . 'assets/img/lucen-aspicio.png', 50, 15, 200, 200, 'PNG'); $pdf->Image($maindir . 'assets/img/logo_unah.png', 15, 5, 24, 36, 'PNG'); $pdf->Image($maindir . 'assets/img/logo-cienciasjuridicas.png', 230, 8, 35, 35, 'PNG'); $pdf->Cell(22, 10, '', 0); $pdf->SetFont('Arial', '', 18); $pdf->Cell(45, 10, '', 0); $pdf->Cell(70, 10, utf8_decode('Universidad Nacional Autónoma de Honduras'), 0); $pdf->Ln(10); $pdf->SetFont('Arial', 'U', 14); $pdf->Cell(60, 8, '', 0, 0, "C"); $pdf->Cell(130, 8, 'Reportes de Permisos Personales', 0, 0, "C"); $pdf->Ln(25); //$pdf->AddCol('N',25,'#Empleado','C'); $pdf->AddCol('Nombre', 70, 'Nombre Completo', 'C');
// Start : 13 Oktober 2008 session_start(); include_once "../dwo.lib.php"; include_once "../db.mysql.php"; include_once "../connectdb.php"; include_once "../parameter.php"; include_once "../cekparam.php"; include_once "../header_pdf.php"; // *** Parameters *** $gel = $_REQUEST['gel']; $gels = GetFields('pmbperiod', "KodeID='" . KodeID . "' and PMBPeriodID", $gel, "*"); $lbr = 190; // *** Cetak *** $pdf = new PDF('P', 'mm', 'A4'); $pdf->SetTitle("Rekapitulasi Jumlah Pendaftar Per Periode"); $pdf->AddPage('P'); BuatHeaderLap($gel, $gels, $pdf); TampilkanIsinya($gel, $gels, $pdf); $pdf->Output(); // *** Functions *** function BuatHeaderLap($gel, $gels, $p) { global $lbr; $t = 6; $p->SetFont('Helvetica', 'B', 14); $p->Cell($lbr, $t, "Rekapitulasi Jumlah Pendaftar Per Periode", 0, 1, 'C'); $p->SetFont('Helvetica', 'B', 12); $p->Cell($lbr, $t, "Sampai Dengan Periode {$gel}", 0, 1, 'C'); $p->Ln(4); } function TampilkanIsinya($gel, $gels, $p)
function savePdf() { $meeting =& $this->meeting; $submission =& $this->submission; $summary = $submission->getSummaryFile() != null ? $submission->getSummaryFile() : $this->getData('summary'); $specificDiscussionText = $this->getData('discussionText'); $discussionType = $this->getData('discussionType'); $typeOther = $this->getData('typeOther'); $isUnanimous = $this->getData('unanimous') == "Yes" ? true : false; $decision = $this->getData("decision"); $votes = $this->getData("votes"); $minorityReason = $this->getData("minorityReason"); $chairReview = $this->getData('chairReview'); $abstract = $submission->getLocalizedAbstract(); $pdf = new PDF(); $pdf->AddPage(); $pdf->ChapterTitle('CONTINUING REVIEW of ' . $submission->getProposalId()); $pdf->ChapterItemKeyVal('Protocol Title', $abstract->getScientificTitle(), "BU"); $pdf->ChapterItemKeyVal('Principal Investigator (PI)', $submission->getAuthorString(), "BU"); $pdf->ChapterItemKeyVal('Unique project identification # assigned', $submission->getProposalId(), "BU"); $pdf->ChapterItemKeyVal('Responsible Staff Member', $submission->getUser()->getFullName(), "BU"); if ($isUnanimous) { switch ($decision) { case SUBMISSION_SECTION_DECISION_APPROVED: $decisionStr = "The proposal was accepted in principal unanimously by all the members of the ERC present in the meeting, and was approved with clarifications mentioned above."; break; case SUBMISSION_SECTION_DECISION_RESUBMIT: $decisionStr = "The proposal was assigned for revision and resubmission in principal unanimously by all the members of the ERC present in the meeting provided with the considerations and conditions mentioned above."; break; case SUBMISSION_SECTION_DECISION_DECLINED: $decisionStr = "The proposal was not accepted in principal unanimously by all the members of the ERC present in the meeting due to concerns stated above."; break; } } else { switch ($decision) { case SUBMISSION_SECTION_DECISION_APPROVED: $decisionStr = "The proposal was accepted in principal by the majority of the ERC members present in the meeting and was approved with clarifications mentioned above."; break; case SUBMISSION_SECTION_DECISION_RESUBMIT: $decisionStr = "The proposal was assigned for revision and resubmission in principal by the majority of the ERC members present in the meeting provided with the considerations and conditions mentioned above."; break; case SUBMISSION_SECTION_DECISION_DECLINED: $decisionStr = "The proposal was not accepted in principal unanimously by the majority of the ERC members present in the meeting due to concerns stated above."; break; } $votesStr = "The distribution of votes are as follows. " . $this->getData('votesApprove') . " member(s) voted for, " . $this->getData('votesNotApprove') . " member(s) voted against, " . $this->getData('votesAbstain') . " member(s) abstained."; $reasonsStr = "Reasons for minority opinions are as follows: {$minorityReason}"; } $pdf->ChapterItemKey('IRB Decision and Votes', "BU"); $pdf->ChapterItemVal($decisionStr); if (!$isUnanimous) { $pdf->ChapterItemVal($votesStr); $pdf->ChapterItemVal($reasonsStr); if ($chairReview != null) { $pdf->ChapterItemVal($chairReview); } } $journal =& Request::getJournal(); $journalId = $journal->getId(); $filename = $abstract->getScientificTitle() . ".pdf"; $meetingFilesDir = Config::getVar('files', 'files_dir') . '/journals/' . $journalId . '/meetings/' . $meeting->getId() . "/continuingReviews/" . $filename; import('classes.file.MinutesFileManager'); $minutesFileManager = new MinutesFileManager($meeting->getId(), "continuingReviews", $submission->getId()); if ($minutesFileManager->createDirectory()) { $pdf->Output($meetingFilesDir, "F"); } }
private function printHeader($format, $printFields, $startDate, $endDate) { if ($format == 'pdf' || $format == 'pdfl') { ob_end_clean(); $pdf = new PDF($format == 'pdf' ? 'P' : 'L', 'mm', 'A4', _CHARSET_ == 'UTF-8', _CHARSET_, false); $pdf->setTopMargin(20); $pdf->headerRight = $GLOBALS['locReportPage']; $pdf->printHeaderOnFirstPage = true; $pdf->AddPage(); $pdf->SetAutoPageBreak(TRUE, 15); $pdf->setY(10); $pdf->SetFont('Helvetica', 'B', 12); $pdf->Cell(100, 15, $GLOBALS['locInvoiceReport'], 0, 1, 'L'); if ($startDate || $endDate) { $pdf->SetFont('Helvetica', '', 8); $pdf->Cell(25, 15, $GLOBALS['locDateInterval'], 0, 0, 'L'); $pdf->Cell(50, 15, dateConvDBDate2Date($startDate) . ' - ' . dateConvDBDate2Date($endDate), 0, 1, 'L'); } $pdf->SetFont('Helvetica', 'B', 8); if (in_array('invoice_no', $printFields)) { $pdf->Cell(18, 4, $GLOBALS['locInvoiceNumber'], 0, 0, 'L'); } if (in_array('invoice_date', $printFields)) { $pdf->Cell(20, 4, $GLOBALS['locInvDate'], 0, 0, 'L'); } if (in_array('due_date', $printFields)) { $pdf->Cell(20, 4, $GLOBALS['locDueDate'], 0, 0, 'L'); } if (in_array('payment_date', $printFields)) { $pdf->Cell(20, 4, $GLOBALS['locPaymentDate'], 0, 0, 'L'); } if (in_array('company_name', $printFields)) { $pdf->Cell(45, 4, $GLOBALS['locPayer'], 0, 0, 'L'); } if (in_array('status', $printFields)) { $pdf->Cell(20, 4, $GLOBALS['locInvoiceState'], 0, 0, 'L'); } if (in_array('ref_number', $printFields)) { $pdf->Cell(25, 4, $GLOBALS['locReferenceNumber'], 0, 0, 'L'); } if (in_array('sums', $printFields)) { $pdf->Cell(25, 4, $GLOBALS['locVATLess'], 0, 0, 'R'); $pdf->Cell(25, 4, $GLOBALS['locVATPart'], 0, 0, 'R'); $pdf->Cell(25, 4, $GLOBALS['locWithVAT'], 0, 1, 'R'); } $this->pdf = $pdf; return; } ?> <div class="report"> <table> <tr> <?php if (in_array('invoice_no', $printFields)) { ?> <th class="label"> <?php echo $GLOBALS['locInvoiceNumber']; ?> </th> <?php } if (in_array('invoice_date', $printFields)) { ?> <th class="label"> <?php echo $GLOBALS['locInvDate']; ?> </th> <?php } if (in_array('due_date', $printFields)) { ?> <th class="label"> <?php echo $GLOBALS['locDueDate']; ?> </th> <?php } if (in_array('payment_date', $printFields)) { ?> <th class="label"> <?php echo $GLOBALS['locPaymentDate']; ?> </th> <?php } if (in_array('company_name', $printFields)) { ?> <th class="label"> <?php echo $GLOBALS['locPayer']; ?> </th> <?php } if (in_array('status', $printFields)) { ?> <th class="label"> <?php echo $GLOBALS['locInvoiceState']; ?> </th> <?php } if (in_array('ref_number', $printFields)) { ?> <th class="label"> <?php echo $GLOBALS['locReferenceNumber']; ?> </th> <?php } if (in_array('sums', $printFields)) { ?> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locVATLess']; ?> </th> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locVATPart']; ?> </th> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locWithVAT']; ?> </th> <?php } ?> </tr> <?php }
public function basket() { $this->start = $this->input->get('start'); $this->end = $this->input->get('end'); $this->view = ""; if (isset($_GET['view']) && $_GET['view'] != "") { $this->view = pnp::clean($_GET['view']); } $this->data->getTimeRange($this->start, $this->end, $this->view); $basket = $this->session->get("basket"); if (is_array($basket) && sizeof($basket) > 0) { foreach ($basket as $item) { # explode host::service::source $slices = explode("::", $item); if (sizeof($slices) == 2) { $this->data->buildDataStruct($slices[0], $slices[1], $this->view); } if (sizeof($slices) == 3) { $this->data->buildDataStruct($slices[0], $slices[1], $this->view, $slices[2]); } } } //echo Kohana::debug($this->data->STRUCT); /* * PDF Output */ $pdf = new PDF(); $pdf->AliasNbPages(); $pdf->SetAutoPageBreak('off'); $pdf->SetMargins(17.5, 30, 10); $pdf->AddPage(); if ($this->use_bg) { $pdf->setSourceFile($this->config->conf['background_pdf']); $tplIdx = $pdf->importPage(1, '/MediaBox'); $pdf->useTemplate($tplIdx); } $pdf->SetCreator('Created with PNP'); $pdf->SetFont('Arial', '', 10); // Title foreach ($this->data->STRUCT as $data) { if ($pdf->GetY() > 200) { $pdf->AddPage(); if ($this->use_bg) { $pdf->useTemplate($tplIdx); } } if ($data['LEVEL'] == 0) { $pdf->SetFont('Arial', '', 12); $pdf->CELL(120, 10, $data['MACRO']['DISP_HOSTNAME'] . " -- " . $data['MACRO']['DISP_SERVICEDESC'], 0, 1); $pdf->SetFont('Arial', '', 10); $pdf->CELL(120, 5, $data['TIMERANGE']['title'] . " (" . $data['TIMERANGE']['f_start'] . " - " . $data['TIMERANGE']['f_end'] . ")", 0, 1); $pdf->SetFont('Arial', '', 8); $pdf->CELL(120, 5, "Datasource " . $data["ds_name"], 0, 1); } else { $pdf->SetFont('Arial', '', 8); $pdf->CELL(120, 5, "Datasource " . $data["ds_name"], 0, 1); } $image = $this->rrdtool->doImage($data['RRD_CALL'], $out = 'PDF'); $img = $this->rrdtool->saveImage($image); $Y = $pdf->GetY(); $cell_height = $img['height'] * 0.23; $cell_width = $img['width'] * 0.23; $pdf->Image($img['file'], 17.5, $Y, $cell_width, $cell_height, 'PNG'); $pdf->CELL(120, $cell_height, '', 0, 1); unlink($img['file']); } $pdf->Output("pnp4nagios.pdf", "I"); }
$SpAvere = array(14, 16, 20, 17, 18, 15, 42, 43, 19); global $Titolo; global $Tipo; $pdf = new PDF(); $pdf->AliasNbPages(); $pdf->SetMargins(4, 4, 4); //~ ri esegue la stessa query della ricerca $campi = $_SESSION['qpdf']['campi']; $ord = $_SESSION['qpdf']['ord']; $Risultati = GetRows("view_piano_conti", $campi, $ord, $db); if (isset($_GET['tipo']) && $_GET['tipo'] != "") { $Tipo = $_GET['tipo']; switch ($_GET['tipo']) { case "movimenti": $Titolo = "Stampa Movimenti"; $pdf->AddPage('L'); // L = landscape $pdf->SetTitle($Titolo); $pdf->SetSubject($Titolo); break; case "mastrini": $Titolo = "Stampa Mastrini"; $pdf->AddPage(); $pdf->SetTitle($Titolo); $pdf->SetSubject($Titolo); break; } } /* * 22/08/2009 01:04:49 CEST Claudio Giordano *
$this->Line(10, 281, 200, 281); $this->Cell(0, 3, 'Emitido por: ' . $usuarioNome); //Logotipo $this->Image('../image/workcrm_powered.jpg', 175, 282, 24); } } //Instancia a classe gerador de pdf $pdf = new PDF(); //Define os atributos de propriedade do arquivo PDF $pdf->SetCreator('work | crm - www.workcrm.com.br'); $pdf->SetAuthor($usuarioNome . " - " . $empresaNome); $pdf->SetTitle('Relação de Contas'); $pdf->SetSubject('Relatório gerado automaticamente pelo sistema'); $pdf->AliasNbPages(); //Cria a primeira página no modo landscape $pdf->AddPage(L); //Verifica se precisa imprimir o cabeçalho da quebra if ($SemQuebra != 1) { //Imprime o cabeçalho da primeira quebra $pdf->ln(); $pdf->SetFont('Arial', 'B', 10); $pdf->Cell(0, 5, $Agrupamento_nome . $Nome_quebra); $pdf->SetFont('Arial', '', 10); } //Salta a primeira linha $pdf->ln(); //Monta as linhas com os dados da query $pdf->SetFont('Arial', '', 10); //Percorre e monta o array com os dados while ($dados = mysql_fetch_array($sql)) { //Efetua o switch para o campo de tipo de conta
public static function generate($dbh, $appID, $method = 'I') { $data = self::get($dbh, $appID); //if (strlen($socialnumber) > 20) $socialnumber = $this->decrypt($socialnumber); $socialnumber = ''; //Blank out social on forms per Maria 6/6/2013 // initiate PDF $pdf = new PDF(); $pdf->SetMargins(PDF_MARGIN_LEFT, 10, PDF_MARGIN_RIGHT); // add a page $pdf->AddPage(); $pdf->SetFont("Helvetica", "", 11); $pdf->SetXY(33, 30); $pdf->Write(5, date('m/d/Y', strtotime($data['appDate']))); $pdf->SetXY(85, 30); $pdf->Write(5, $data['jobName']); $pdf->SetXY(30, 36); $pdf->Write(5, $data['lastname']); $pdf->SetXY(110, 36); $pdf->Write(5, $data['firstname']); $pdf->SetXY(170, 36); $pdf->Write(5, $data['middlename']); $pdf->SetXY(30, 62); $pdf->Write(5, $data['address']); $pdf->SetXY(105, 62); $pdf->Write(5, $data['city']); $pdf->SetXY(162, 62); $pdf->Write(5, $data['state']); $pdf->SetXY(187, 62); $pdf->Write(5, $data['zip']); $pdf->SetXY(70, 69); $pdf->Write(5, $data['years']); $pdf->SetXY(105, 69); $pdf->Write(5, $data['phone']); $pdf->SetXY(122, 76); $pdf->Write(5, $data['email']); $pdf->SetFont("Helvetica", "", 10); $highestx = 59 + $data['highestgrade'] * 5.4; if ($data['highestgrade'] > 8) { $highestx += 19; } if ($data['highestgrade'] > 12) { $highestx += 20; } $pdf->SetXY($highestx, 152); $pdf->Write(5, 'Highest'); $pdf->SetXY(46, 175); $pdf->Write(5, $data['highschool']); $pdf->SetXY(46, 184); $pdf->Write(5, $data['highschoolloc']); $pdf->SetXY(101, 175); $pdf->Write(5, $data['highschoolyears']); $pdf->SetXY(129, 175); $pdf->Write(5, $data['coursesubject']); $pdf->SetXY(174.5, 175); $pdf->write(5, $data['coursesubjectgraduated'] == 'Yes' ? 'X' : ''); $pdf->SetXY(174.5, 184); $pdf->write(5, $data['coursesubjectgraduated'] == 'GED' ? 'X' : ''); $pdf->SetXY(46, 193); $pdf->Write(5, $data['collegeuniversity']); $pdf->SetXY(46, 202); $pdf->Write(5, $data['collegeuniversityloc']); $pdf->SetXY(101, 193); $pdf->Write(5, $data['collegeuniversityyearscompleted']); $pdf->SetXY(129, 193); $pdf->Write(5, $data['collegeuniversitycourse']); $pdf->SetXY(174.5, 191); $pdf->write(5, $data['collegegraduated'] == 'Yes' ? 'X' : ''); $pdf->SetXY(184, 194); $pdf->Write(5, $data['collegegraduatedMonth']); $pdf->SetXY(196, 194); $pdf->Write(5, $data['collegegraduatedYear']); $pdf->SetXY(174.5, 202); $pdf->write(5, $data['collegegraduated'] == 'InP' ? 'X' : ''); $pdf->SetXY(46, 210); $pdf->Write(5, $data['othercollege']); $pdf->SetXY(46, 222); $pdf->Write(5, $data['othercollegeloc']); $pdf->SetXY(101, 214); $pdf->Write(5, $data['othercollegeyears']); $pdf->SetXY(129, 210); $pdf->Write(5, $data['othercollegecourse']); $pdf->SetXY(174.5, 209); $pdf->write(5, $data['othercollegecompleted'] == 'Yes' ? 'X' : ''); $pdf->SetXY(184, 213); $pdf->Write(5, $data['othercollegecompletedMonth']); $pdf->SetXY(194, 213); $pdf->Write(5, $data['othercollegecompletedYear']); $pdf->SetXY(174.5, 219); $pdf->write(5, $data['othercollegecompleted'] == 'Pro' ? 'X' : ''); $pdf->SetXY(128, 260.5); $pdf->Write(5, $data['language']); $pdf->SetXY(163, 260.5); $pdf->write(5, $data['languagespeak'] ? 'X' : ''); $pdf->SetXY(177, 260.5); $pdf->write(5, $data['languageread'] ? 'X' : ''); $pdf->SetXY(190, 260.5); $pdf->write(5, $data['languagewrite'] ? 'X' : ''); $pdf->AddPage(); $y = 0; $pdf->SetXY(10, $y + 46); $pdf->Write(5, $data['companyname1']); $pdf->SetXY(10, $y + 55); $pdf->MultiCell(50, 10, $data['companyaddress1'], 0, 'L'); $pdf->SetXY(10, $y + 64); $pdf->Write(5, $data['companyphone1']); $pdf->SetXY(10, $y + 72); $pdf->Write(5, $data['supervisorname1']); $pdf->SetXY(60, $y + 52); $pdf->MultiCell(80, 35, $data['responsibilities1'], 0, 'L'); $pdf->SetXY(141, $y + 56); $pdf->MultiCell(60, 25, $data['reasonforleaving1'], 0, 'L'); $pdf->SetXY(160, $y + 64); $pdf->write(5, "{$data['startwages1']} -> {$data['endedwages1']}"); if ($data['maywecontact1'] == 'Yes') { $pdf->SetXY(146, $y + 73); } else { $pdf->SetXY(178, $y + 73); } $pdf->write(5, 'X'); $y = 33; $pdf->SetXY(10, $y + 46); $pdf->Write(5, $data['companyname2']); $pdf->SetXY(10, $y + 55); $pdf->MultiCell(50, 10, $data['companyaddress2'], 0, 'L'); $pdf->SetXY(10, $y + 64); $pdf->Write(5, $data['companyphone2']); $pdf->SetXY(10, $y + 72); $pdf->Write(5, $data['supervisorname2']); $pdf->SetXY(60, $y + 52); $pdf->MultiCell(80, 35, $data['responsibilities2'], 0, 'L'); $pdf->SetXY(141, $y + 56); $pdf->MultiCell(60, 25, $data['reasonforleaving2'], 0, 'L'); $pdf->SetXY(160, $y + 64); $pdf->write(5, "{$data['startwages2']} -> {$data['endedwages2']}"); if ($data['maywecontact2'] == 'Yes') { $pdf->SetXY(140, $y + 73); } else { $pdf->SetXY(178, $y + 73); } $pdf->write(5, 'X'); $y = 66.5; $pdf->SetXY(10, $y + 46); $pdf->Write(5, $data['companyname3']); $pdf->SetXY(10, $y + 55); $pdf->MultiCell(50, 10, $data['companyaddress3'], 0, 'L'); $pdf->SetXY(10, $y + 64); $pdf->Write(5, $data['companyphone3']); $pdf->SetXY(10, $y + 72); $pdf->Write(5, $data['supervisorname3']); $pdf->SetXY(60, $y + 52); $pdf->MultiCell(80, 35, $data['responsibilities3'], 0, 'L'); $pdf->SetXY(141, $y + 56); $pdf->MultiCell(60, 25, $data['reasonforleaving3'], 0, 'L'); $pdf->SetXY(160, $y + 64); $pdf->write(5, "{$data['startwages3']} -> {$data['endedwages3']}"); if ($data['maywecontact3'] == 'Yes') { $pdf->SetXY(140, $y + 73); } else { $pdf->SetXY(178, $y + 73); } $pdf->write(5, 'X'); $pdf->SetXY(44, 265); $pdf->MultiCell(95, 10, "Signed Online as {$data['signature']} from {$data['ipAddress']}", 0, 'L'); $pdf->SetXY(150, 265); $pdf->Write(5, $data['appDate']); $pdf->AddPage(); $pdf->SetXY(26, 42); $pdf->Write(5, $data['lastname']); $pdf->SetXY(101, 42); $pdf->Write(5, $data['firstname']); $pdf->SetXY(172, 42); $pdf->Write(5, substr($data['middlename'], 0, 1)); $pdf->SetXY(115, 50); $pdf->Write(5, $data['zip']); $pdf->SetXY(48, 57); $pdf->Write(5, $data['jobName']); $pdf->SetXY(48, 57); $pdf->Write(5, $data['jobName']); $filename = $data['firstname'] . '_' . $data['lastname'] . '_app.pdf'; if ($method == 'F') { $pdf->Output(__DIR__ . '../../public_html/img/pdf/' . $filename, 'F'); return 'img/pdf/' . $filename; } elseif ($method == 'I') { $pdf->Output(__DIR__ . '../../public_html/img/pdf/' . $filename, 'I'); die; } }
$fecha = pg_result($consulta, $i, 'sal_fecha'); $ficha = pg_result($consulta, $i, 'ficha'); $CI = pg_result($consulta, $i, 'fun_ci'); $sueldoBruto = pg_result($consulta, $i, 'cat_nom'); $IPS = pg_result($consulta, $i, 'sal_ips'); $Ausencia = pg_result($consulta, $i, 'sal_aus'); $Permiso = pg_result($consulta, $i, 'sal_pyt'); $Judicial = pg_result($consulta, $i, 'sal_jud'); $ASO = pg_result($consulta, $i, 'sal_aso'); $Reposo = pg_result($consulta, $i, 'sal_rep'); $TotalDes = pg_result($consulta, $i, 'total_descuentos'); $Odescuentos = pg_result($consulta, $i, 'ode_mon'); $Neto = pg_result($consulta, $i, 'sal_neto'); //******************************************************************************** $pdf = new PDF(); $pdf->AddPage('P', 'recibo'); $pdf->AliasNbPages(); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0, 0, 'Fecha:', 0, 0, 'L', false); //Fecha $pdf->text(23, 36, $fecha); $pdf->Ln(4); $pdf->Cell(0, 0, 'Nombre Funcionario:', 0, 0, 'L', false); //Nombre de Funcionario $pdf->text(45, 40, $funcionario); $pdf->text(147, 40, 'Ficha:'); $pdf->text(158, 40, $ficha); $pdf->Ln(4); $pdf->Cell(0, 0, 'C.I.:', 0, 0, 'L', false); //numero de cedula de identidad $pdf->text(19, 44, $CI);
$this->Cell(15, 10, 'Categoria', 1, 0, 'C', 1); $this->Cell(20, 10, 'Sueldo Bruto', 1, 0, 'C', 1); $this->Cell(15, 10, 'IPS', 1, 0, 'C', 1); $this->Cell(20, 10, 'Ausencia', 1, 0, 'C', 1); $this->Cell(20, 10, 'Permisos', 1, 0, 'C', 1); $this->Cell(20, 10, 'Judicial', 1, 0, 'C', 1); $this->Cell(20, 10, 'ASO', 1, 0, 'C', 1); $this->Cell(20, 10, 'Reposo', 1, 0, 'C', 1); $this->Cell(25, 10, 'Total Descuentos', 1, 0, 'C', 1); $this->Cell(25, 10, 'Neto a Cobrar', 1, 1, 'C', 1); //Restore font and colors } } $pdf = new PDF(); //'P'=vertical o 'L'=horizontal,'mm','A4' o 'Legal' $pdf->AddPage('L', 'legal'); //$pdf->AliasNbPages(); $pdf->SetFont('Arial', '', 6); //Connection and query $conectate = pg_connect("host=localhost port=5434 dbname=salario user=postgres password=postgres" . "") or die('Error al conectar a la base de datos'); $consulta = pg_exec($conectate, "SELECT row_number()over (partition by 0 order by max(cat.cat_cod) ) as lineas,\n max(Sal.usu_cod) as usu_cod\n ,max(FUN.fun_ci)as fun_ci\n ,max(Sal.sal_cod)as sal_cod\n ,max(Sal.fun_cod) as fun_cod\n ,max(org.org_cod) as organismo\n ,max(cat.cat_des) as categoria\n ,max(CONCAT(FUN.fun_nom,' ',FUN.fun_ape)) as nombres\n ,max(to_char(SAL.sal_fecha,'dd/mm/yyyy')) as sal_fecha,\n max(cat.cat_nom) as sueldobruto\n ,max(SAL.sal_ips) as sal_ips\n ,max(SAL.sal_aus) as sal_aus\n ,max(SAL.sal_pyt) as sal_pyt\n ,max(SAL.sal_jud) as sal_jud\n ,max(SAL.sal_aso) as sal_aso\n ,max(SAL.sal_rep)as sal_rep\n ,sum(DES.ode_mon) as ode_mon\n ,'Otros Descuentos' as tde_des\n ,max(SAL.sal_neto) as sal_neto \n\t\t ,(max(SAL.sal_ips)+ max(SAL.sal_aus)+max(SAL.sal_pyt)+max(SAL.sal_jud)+max(SAL.sal_aso)+max(SAL.sal_rep)) as total_descuentos\n\t\t ,max(car.car_des) as cargo\n\t\t ,max(cat.cat_des) as categoria\n ,max(lin.lin_des) as nrolinea\n from Salario SAL\n LEFT OUTER JOIN descuento DES on (DES.sal_cod=SAL.sal_cod) \n LEFT OUTER JOIN tipo_descuento TIPDES\n on TIPDES.tde_cod=DES.tde_cod\n INNER JOIN funcionario FUN \n on SAl.fun_cod=FUN.fun_cod\n INNER JOIN categoria_detalle catdet\n on sal.fun_cod= catdet.fun_cod\n INNER JOIN categoria cat\n on cat.cat_cod=catdet.cat_cod\n INNER JOIN organismo_detalle orgdet\n on sal.fun_cod= orgdet.fun_cod\n INNER JOIN organismo org\n on org.org_cod=orgdet.org_cod\n INNER JOIN cargo car\n on car.car_cod=FUN.car_cod\n INNER JOIN linea_detalle lindet\n on sal.fun_cod= lindet.fun_cod\n INNER JOIN linea lin\n on lin.lin_cod=lindet.lin_cod\n where SAL.fun_cod=FUN.fun_cod and FUN.fun_fuente='30' \n and EXTRACT(MONTH FROM sal_fecha)= EXTRACT(MONTH FROM now())\n and EXTRACT(YEAR FROM sal_fecha)= EXTRACT(YEAR FROM now()) \n group by FUN.fun_cod \n order by categoria,nombres"); $numregs = pg_numrows($consulta); $pdf->SetFont('Arial', '', 8); $pdf->SetFillColor(224, 235, 255); $pdf->SetTextColor(0); //Build table $fill = false; $i = 0; while ($i < $numregs) { $nrolinea = pg_result($consulta, $i, 'nrolinea'); $cargo = pg_result($consulta, $i, 'cargo');
protected function printHeader($format) { if ($format == 'pdf') { ob_end_clean(); $pdf = new PDF('P', 'mm', 'A4', _CHARSET_ == 'UTF-8', _CHARSET_, false); $pdf->setTopMargin(20); $pdf->headerRight = $GLOBALS['locReportPage']; $pdf->printHeaderOnFirstPage = true; $pdf->AddPage(); $pdf->SetAutoPageBreak(TRUE, 15); $pdf->setY(10); $pdf->SetFont('Helvetica', 'B', 12); $pdf->Cell(100, 5, $GLOBALS['locProductStockReport'], 0, 1, 'L'); $pdf->SetFont('Helvetica', 'B', 8); $pdf->Cell(50, 10, date($GLOBALS['locDateFormat']), 0, 1, 'L'); $pdf->Cell(15, 4, $GLOBALS['locCode'], 0, 0, 'L'); $pdf->Cell(40, 4, $GLOBALS['locProduct'], 0, 0, 'L'); $pdf->Cell(25, 4, $GLOBALS['locUnitPrice'], 0, 0, 'R'); $pdf->Cell(25, 4, $GLOBALS['locPurchasePrice'], 0, 0, 'R'); $pdf->Cell(25, 4, $GLOBALS['locStockBalance'], 0, 0, 'R'); $pdf->Cell(25, 4, $GLOBALS['locStockValue'], 0, 1, 'R'); $this->pdf = $pdf; return; } ?> <div class="report"> <table> <tr> <th class="label"> <?php echo $GLOBALS['locCode']; ?> </th> <th class="label"> <?php echo $GLOBALS['locProduct']; ?> </th> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locUnitPrice']; ?> </th> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locPurchasePrice']; ?> </th> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locStockBalance']; ?> </th> <th class="label" style="text-align: right"> <?php echo $GLOBALS['locStockValue']; ?> </th> </tr> <?php }