public function reporteEstatusPdf() { $pdf = new Pdf('L', 'mm', 'A4', true, 'UTF-8', false); $pdf->setPageOrientation('p'); $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf->SetMargins(PDF_MARGIN_LEFT, 15, PDF_MARGIN_RIGHT); //$pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->setFontSubsetting(true); $pdf->SetFont('times', '', 12, '', true); $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); $pdf->AddPage(); $html = null; $reporteEstatus = $this->reporteticket_model->reporteEstatusPDF(); if ($reporteEstatus) { $pdf->Image("imagen/logo/logoborde.png", $x = 5, $y = 5, $w = 70, $h = 40, $type = '', $link = '', $align = 'right', $resize = false, $dpi = 300, $palign = '', $ismask = false, $imgmask = false, $border = 0, $fitbox = false, $hidden = false, $fitonpage = false, $alt = false, $altimgs = array()); $pdf->Text(120, 15, "República Bolivariana de Venezuela", $fstroke = false, $fclip = false, $ffill = true, $border = 0, $ln = 0, $align = 'left', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M', $rtloff = false); $pdf->Text(120, 20, "Gobernación del Estado Lara", $fstroke = false, $fclip = false, $ffill = true, $border = 0, $ln = 0, $align = 'left', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M', $rtloff = false); $pdf->Text(120, 25, "Oficina de Atención al Ciudadano.", $fstroke = false, $fclip = false, $ffill = true, $border = 0, $ln = 0, $align = 'left', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M', $rtloff = false); $pdf->SetFont('Times', 'B', 12); $pdf->Text(60, 50, 'Reporte estadistico del estatus de los Ticket registrados.'); foreach ($reporteEstatus->result_array() as $fila) { $arregloDatos[] = array('estatus' => $fila['estatus'], 'contador' => $fila['contador']); } $pdf->Ln(10); $pdf->SetFillColor('150', '210', '255'); $pdf->Cell(0, 0, 'Cuadro Resumen', 1, 1, 'C', 1); $pdf->Cell(75, 0, 'Tipo ticket', 1, 0, 'C', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M'); $pdf->Cell(75, 0, 'Sector relacionado', 1, 0, 'C', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M'); $pdf->Cell(30, 0, 'Cantidad', 1, 1, 'C', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M'); $reporteCuadro = $this->reporteticket_model->reporteEstatusCuadroPDF(); foreach ($reporteCuadro as $fila2) { $pdf->Cell(75, 0, $fila2->tipo, 1, 0, 'C', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M'); $pdf->Cell(75, 0, $fila2->sector, 1, 0, 'C', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M'); $pdf->Cell(30, 0, $fila2->cantidad, 1, 1, 'C', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M'); $total = $fila2->total; } $pdf->Cell(150, 0, 'Total de ticket', 1, 0, 'R', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M'); $pdf->Cell(30, 0, $total, 1, 1, 'C', 1); $pdf->Ln(10); $pdf->graficoPDF($arregloDatos, 'Grafico', array(60, '', 90, 100), ''); } else { $pdf->SetFont('Times', 'B', 18); $pdf->Text(14, 40, 'No se encuentra información con las características indicadas.'); } $nombre_archivo = utf8_decode("listado.pdf"); $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = 'C', $autopadding = true); $pdf->Output($nombre_archivo, 'I'); }
</div> <?php $pdf = new Pdf(); $pdf->AddPage(); $pdf->SetFont('Arial', '', 12); $pdf->SetY(40); $pdf->SetFont('Arial', ''); $pdf->SetY(60); $pdf->MultiCell(0, 15, "Cashier: " . $data->get_fullname($_SESSION['id'])); $pdf->MultiCell(0, 15, "Date: " . date('F j,Y')); $pdf->MultiCell(0, 15, "Shift: " . $_SESSION['shift']); $y_axis_initial = 110; $pdf->SetY($y_axis_initial); $pdf->SetX(45); //print column titles $pdf->SetFillColor(252, 124, 5); $pdf->SetLineWidth(1); $pdf->SetFont('Arial', '', 11); $pdf->Cell(265, 16, 'Item Name', 1, 0, 'C', 1); $pdf->Cell(60, 16, 'Beg. In.', 1, 0, 'C', 1); $pdf->Cell(50, 16, 'Add. In.', 1, 0, 'C', 1); $pdf->Cell(50, 16, 'Add. Out.', 1, 0, 'C', 1); $pdf->Cell(50, 16, 'End. In.', 1, 0, 'C', 1); $pdf->Cell(50, 16, 'Sold', 1, 0, 'C', 1); $row_height = 16; $y_axis = $y_axis_initial + $row_height; $connect = new mysqli('localhost', 'root', '', 'dsr'); $resultX = mysqli_query($connect, "SELECT * FROM particulars"); $x = 0; while ($row = mysqli_fetch_object($resultX)) { $item_name = $row->item_name;
public function generarSalidaEmpleados() { $departamento = $this->input->get("departamento") != 'null' ? '=' . $this->input->get("departamento") : 'LIKE "%"'; $nacionalidad = $this->input->get("nacionalidad") != '' ? "LIKE '%" . $this->input->get("nacionalidad") . "%'" : 'LIKE "%"'; $cedula = $this->input->get("cedula") != '' ? '=' . $this->input->get("cedula") : 'LIKE "%"'; $nombre = $this->input->get("nombre") != '' ? "LIKE '%" . $this->input->get("nombre") . "%'" : 'LIKE "%"'; $apellido = $this->input->get("apellido") != '' ? "LIKE '%" . $this->input->get("apellido") . "%'" : 'LIKE "%"'; $pdf = new Pdf('l', 'mm', 'A4', true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetSubject('Tutorial TCPDF'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH1, PDF_HEADER_TITLE, PDF_HEADER_STRING); $pdf->setFooterData($tc = array(0, 64, 0), $lc = array(0, 64, 128)); // datos por defecto de cabecera, se pueden modificar en el archivo tcpdf_config.php de libraries/config // $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH,'Listado General',PDF_HEADER_STRING,array(0,64,255), array(0,64,128)); $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); $pdf->SetPageOrientation('p'); // se pueden modificar en el archivo tcpdf_config.php de libraries/config $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // se pueden modificar en el archivo tcpdf_config.php de libraries/config $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // se pueden modificar en el archivo tcpdf_config.php de libraries/config $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //relación utilizada para ajustar la conversión de los píxeles $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // establecer el modo de fuente por defecto $pdf->setFontSubsetting(true); $pdf->AddPage(); $html = null; $nombre_archivo = null; $username = $this->session->userdata('datasession'); if ($username['idusuario'] == 13) { $resultado2 = $this->ReporteGeneral_model->getdptoempleadosdos($nacionalidad, $cedula, $nombre, $apellido, $departamento); } else { $resultado2 = $this->ReporteGeneral_model->getdptoempleados($nacionalidad, $cedula, $nombre, $apellido, $username['idusuario']); $resultado = $this->ReporteGeneral_model->getsalidasempleados($nacionalidad, $cedula, $nombre, $apellido, $username['idusuario']); } if ($resultado2->num_rows() > 0) { foreach ($resultado2->result_array() as $fila2) { if ($username['idusuario'] == 13) { $resultado = $this->ReporteGeneral_model->getsalidasempleadosdos($nacionalidad, $cedula, $nombre, $apellido, $fila2['departamento']); } else { $resultado = $this->ReporteGeneral_model->getsalidasempleados($nacionalidad, $cedula, $nombre, $apellido, $username['idusuario']); } $pdf->SetFont('Times', 'B', 14); $pdf->Text(14, 25, 'Departamento: ' . $fila2['nombre']); $pdf->SetFont('Times', 'B', 12); $pdf->Text(50, 35, 'Resumen de autorización(es) por empleado(s).'); $pdf->Ln(15); $pdf->SetFont('times', '', 11, '', true); $pdf->SetFillColor('150', '210', '255'); $pdf->Cell(20, 0, 'Cédula', 1, 0, 'C', 1); $pdf->Cell(60, 0, 'Nombres y Apellidos', 1, 0, 'C', 1); $pdf->Cell(20, 0, 'Personal', 1, 0, 'C', 1); $pdf->Cell(20, 0, 'Laboral', 1, 0, 'C', 1); $pdf->Cell(20, 0, 'Medico', 1, 0, 'C', 1); $pdf->Cell(20, 0, 'Estudio', 1, 0, 'C', 1); $pdf->Cell(20, 0, 'Sindical', 1, 0, 'C', 1); $pdf->Cell(10, 0, 'Total', 1, 1, 'C', 1); $cedemp = 'null'; $motivo = array(); $tot = 0; foreach ($resultado->result_array() as $fila) { $tot = $tot + 1; if ($cedemp != $fila['cedula']) { if ($cedemp != 'null') { $result = 0; foreach ($motivo as $re) { if ($re != 0) { $result = $result + $re; } $pdf->Cell(20, 0, $re, 1, 0, 'C', 0, '', 0); } $pdf->Cell(10, 5, $result, 1, 1, 'C', 1); unset($motivo); $motivo = array(); $pdf->Cell(20, 0, $fila['cedula'], 1, 0, 'C', 0, '', 1); $pdf->Cell(60, 0, $fila['nombre'] . ' ' . $fila['apellido'], 1, 0, 'C', 0, '', 1); $mot1 = $fila["Personal"]; $mot2 = $fila["Laboral"]; $mot3 = $fila["Medico"]; $mot4 = $fila["Estudio"]; $mot5 = $fila["Sindical"]; array_push($motivo, $mot1, $mot2, $mot3, $mot4, $mot5); $cedemp = $fila['cedula']; } else { if ($tot == 1) { $pdf->Cell(20, 0, $fila['cedula'], 1, 0, 'C', 0, '', 1); $pdf->Cell(60, 0, $fila['nombre'] . ' ' . $fila['apellido'], 1, 0, 'C', 0, '', 1); $mot1 = $fila["Personal"]; $mot2 = $fila["Laboral"]; $mot3 = $fila["Medico"]; $mot4 = $fila["Estudio"]; $mot5 = $fila["Sindical"]; array_push($motivo, $mot1, $mot2, $mot3, $mot4, $mot5); $cedemp = $fila['cedula']; } } } else { if ($motivo[0] == 0 && $fila["Personal"] != '0') { $reemplazo = array(0 => $fila["Personal"]); $motivo = array_replace($motivo, $reemplazo); } if ($motivo[1] == 0 && $fila["Laboral"] != '0') { $reemplazo = array(1 => $fila["Laboral"]); $motivo = array_replace($motivo, $reemplazo); } if ($motivo[2] == 0 && $fila["Medico"] != '0') { $reemplazo = array(2 => $fila["Medico"]); $motivo = array_replace($motivo, $reemplazo); } if ($motivo[3] == 0 && $fila["Estudio"] != '0') { $reemplazo = array(3 => $fila["Estudio"]); $motivo = array_replace($motivo, $reemplazo); } if ($motivo[4] == 0 && $fila["Sindical"] != '0') { $reemplazo = array(4 => $fila["Sindical"]); $motivo = array_replace($motivo, $reemplazo); } } } $result2 = 0; foreach ($motivo as $re) { if ($re != 0) { $result2 = $result2 + $re; } $pdf->Cell(20, 0, $re, 1, 0, 'C', 0, '', 0); } $pdf->Cell(10, 5, $result2, 1, 1, 'C', 1); $pdf->AddPage(); } } else { $pdf->SetFont('Times', 'B', 18); $pdf->Text(14, 25, 'No se encuentran autorización(es) con las características indicadas.'); } $pdf->Output('resumengeneral.pdf', 'I'); }
$High = mb_convert_encoding($High, 'Big5', 'HTML-ENTITIES'); $Med = mb_convert_encoding($Med, 'Big5', 'HTML-ENTITIES'); $Low = mb_convert_encoding($Low, 'Big5', 'HTML-ENTITIES'); $Info = mb_convert_encoding($Info, 'Big5', 'HTML-ENTITIES'); $pdf->SetFont('Big5', '', 10); } else { $HostIP = mb_convert_encoding($HostIP, 'ISO-8859-1', 'HTML-ENTITIES'); $HostName = mb_convert_encoding($HostName, 'ISO-8859-1', 'HTML-ENTITIES'); $Serious = mb_convert_encoding($Serious, 'ISO-8859-1', 'HTML-ENTITIES'); $High = mb_convert_encoding($High, 'ISO-8859-1', 'HTML-ENTITIES'); $Med = mb_convert_encoding($Med, 'ISO-8859-1', 'HTML-ENTITIES'); $Low = mb_convert_encoding($Low, 'ISO-8859-1', 'HTML-ENTITIES'); $Info = mb_convert_encoding($Info, 'ISO-8859-1', 'HTML-ENTITIES'); $pdf->SetFont('Helvetica', '', 10); } $pdf->SetFillColor(238, 238, 238); $pdf->Cell(28, 6, $HostIP, 1, 0, 'C', 1); $pdf->Cell(52, 6, $HostName, 1, 0, 'C', 1); //$pdf->Cell(20, 6, "LocalChks",1,0,'C'); $pdf->Cell(22, 6, $Serious, 1, 0, 'C', 1); $pdf->Cell(22, 6, $High, 1, 0, 'C', 1); $pdf->Cell(22, 6, $Med, 1, 0, 'C', 1); $pdf->Cell(22, 6, $Low, 1, 0, 'C', 1); $pdf->Cell(22, 6, $Info, 1, 0, 'C', 1); //$pdf->Cell(20, 6, "Exceptions",1,0,'C'); $pdf->Ln(); foreach ($hosts as $hostIP_ctx => $hostname) { list($hostIP, $hostctx) = explode("#", $hostIP_ctx); ${"IP_" . $hostIP_ctx} = $pdf->AddLink(); $pdf->Cell(28, 6, $hostIP, 1, 0, 'C', 0, ${"IP_" . $hostIP_ctx}); $pdf->Cell(52, 6, $hostname, 1, 0, 'C', 0, ${"IP_" . $hostIP_ctx});
public function index() { $this->load->library('pdf'); $pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false); $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); $pdf->AddPage(); $pdf->SetFillColor(255, 255, 127); $pdf->SetFont('helvetica', 'B', 12); //($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0) $pdf->MultiCell(10, 8, "NO", 'LBT', 'C', true, 0, '', '', true, 0, false, true, 0, 'M', true); $pdf->MultiCell(30, 8, 'NO RM', 'LBT', 'C', true, 0, '', '', true, 0, false, true, 0, 'M', true); $pdf->MultiCell(59, 8, "NAMA PASIEN", 'LBT', 'C', true, 0, '', '', true, 0, false, true, 0, 'M', true); $pdf->MultiCell(10, 8, "SEX", 'LBT', 'C', true, 0, '', '', true, 0, false, true, 0, 'M', true); $pdf->MultiCell(13, 8, "UMR", 'LBT', 'C', true, 0, '', '', true, 0, false, true, 0, 'M', true); $pdf->MultiCell(70, 8, 'ALAMAT', 'LBTR', 'C', true, 1, '', '', true, 0, false, true, 0, 'M', true); $pdf->SetFont('helvetica', '', 11); $pdf->MultiCell(10, '', "1", 'LB', 'C', false, 0, '', '', true, 0, false, true, 0, 'M', true); $pdf->MultiCell(30, '', '000001223455', 'LB', 'L', false, 0, '', '', true, 0, false, true, 0, 'M', true); $pdf->MultiCell(59, '', "Sulaiman", 'LB', 'L', false, 0, '', '', true, 0, false, true, 0, 'M', true); $pdf->MultiCell(10, '', "L", 'LB', 'L', false, 0, '', '', true, 0, false, true, 0, 'M', true); $pdf->MultiCell(13, '', "20", 'LB', 'L', false, 0, '', '', true, 0, false, true, 0, 'M', true); $pdf->MultiCell(70, '', 'Jln Kembang No 10 Surabaya', 'LBR', 'L', false, 1, '', '', true, 0, false, true, 0, 'M', true); $pdf->MultiCell(10, '', "2", 'LB', 'C', false, 0, '', '', true, 0, false, true, 0, 'M', true); $pdf->MultiCell(30, '', '000001223454', 'LB', 'L', false, 0, '', '', true, 0, false, true, 0, 'M', true); $pdf->MultiCell(59, '', "H Naib bin arif bin soleh bin herman bin junidi bin kurniawan bin heri bin bintang bin karo karo bin saturasi bin sholeh", 'LB', 'L', false, 0, '', '', true, 0, false, true, 0, 'M', false); $pdf->MultiCell(10, '', "L", 'LB', 'L', false, 0, '', '', true, 0, false, true, 0, 'M', true); $pdf->MultiCell(13, '', "34", 'LB', 'L', false, 0, '', '', true, 0, false, true, 0, 'M', true); $pdf->MultiCell(70, '', 'Jln Kembang No 10 Surabaya', 'LBR', 'L', false, 1, '', '', true, 0, false, true, 0, 'M', true); $pdf->MultiCell(59, 11, "badger badger badger badger badger badger badger badger - mushroom! mushroom!", 'LB', 'L', false, 0, 50, 60, true, 0, false, false, 0, 'T', true); //Close and output PDF document $pdf->Output('example_005.pdf', 'I'); }