/** @Functions que permiten generar PDF's con reportes /**************************************************************************/ public function reporte_medicamentos() { // Carga de datos $data_meds = $this->gestion->get_medicamentos(); $tmp_meds = $this->templates->tmp_reporte_medicamentos($data_meds); // Generacion de PDF $pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Sysmedcloud'); $pdf->SetTitle('Reporte de Medicamentos'); $pdf->SetSubject(''); $pdf->SetKeywords(''); $pdf->SetHeaderData('logo.png', PDF_HEADER_LOGO_WIDTH + 20, 'Reporte', 'Medicamentos', array(0, 64, 255), array(0, 64, 128)); $pdf->setFooterData($tc = array(0, 64, 0), $lc = 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->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->setFontSubsetting(true); $pdf->SetFont('Helvetica', '', 8, '', true); $pdf->AddPage(); $pdf->writeHTML($tmp_meds, true, 0, true, 0); $nombre_archivo = utf8_decode("reporte-medicamentos-" . date("d") . "_" . date("m") . "_" . date("Y") . ".pdf"); $pdf->Output($nombre_archivo, 'I'); }
public function generar($code) { $this->load->library('Pdf'); $pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false); // $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Espacio Vivo'); // $pdf->SetTitle('Ejemplo de provincías con TCPDF'); // $pdf->SetSubject('Tutorial TCPDF'); $pdf->SetKeywords('espacio vivo, inmuebles, pdf, PDF, renta'); // datos por defecto de cabecera, se pueden modificar en el archivo tcpdf_config_alt.php de libraries/config // $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 001', PDF_HEADER_STRING, array(0, 64, 255), array(0, 64, 128)); $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->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // 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); // Establecer el tipo de letra //Si tienes que imprimir carácteres ASCII estándar, puede utilizar las fuentes básicas como // Helvetica para reducir el tamaño del archivo. $pdf->SetFont('helvetica', '', 14, '', false); // Añadir una página // Este método tiene varias opciones, consulta la documentación para más información. $pdf->AddPage(); //fijar efecto de sombra en el texto $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal')); // Establecemos el contenido para imprimir $immovable = $this->general->bringme_immovable($code); $immovable = $immovable[0]; $html = $this->load->view("pdf", $immovable, true); // Imprimimos el texto con writeHTMLCell() $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true); // --------------------------------------------------------- // Cerrar el documento PDF y preparamos la salida // Este método tiene varias opciones, consulte la documentación para más información. $nombre_archivo = utf8_decode("Inmueble" . $immovable['code'] . ".pdf"); $pdf->Output($nombre_archivo, 'I'); }
public function generarListadogeneneral() { $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_WIDTH,PDF_HEADER_TITLE,PDF_HEADER_STRING,array(0,64,255),array(0,64, 128)); $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->SetFont('times', '', 9, '', true); $pdf->AddPage(); $html = null; $nombre_archivo = null; // Establecemos el contenido para imprimir $resultado = $this->ReporteGeneral_model->getlistadogeneral($nombre, $apellido); if ($resultado) { $html = ''; $html .= "<style type=text/css>"; $html .= "th{color: #fff; font-weight: bold; background-color: #0B615E; align=center}"; $html .= "td{background-color: #fff; color: #222; align=center}"; $html .= "</style>"; $html .= "<h2>Listado General de las Personas con Permisos</h2>"; $html .= "<table width='100%' border='1' cellpadding='0' cellspacing='0' >"; $html .= "<tr>\r\n <th><em>Fecha del Permiso</em></th>\r\n <th><em>Cédula</em></th>\r\n <th><em>Nombres</em></th>\r\n <th><em>Cantidad de salidas</em></th>\r\n <th><em>Departamento</em></th>\r\n <th><em>Motivo</em></th>\r\n </tr>"; foreach ($resultado as $fila) { $html .= '<tr> <td>' . mb_convert_case($fila["fechaautorizacion"], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila["cedula"], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila["nombre"], MB_CASE_TITLE, "UTF-8") . ' ' . mb_convert_case($fila["apellido"], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila["contsalida"], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila["departamento"], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila["motivo"], MB_CASE_TITLE, "UTF-8") . '</td> </tr> <hr>'; } $html .= "</table>"; $cantidad = count($resultado); if ($cantidad > 1) { $html .= "<h4>Actualmente: " . count($resultado) . " empleados con permisos</h4>"; } else { $html .= "<h4>Actualmente: " . count($resultado) . " empleados con permisos</h4>"; } $nombre_archivo = utf8_decode("Listado General.pdf"); } else { $html = ''; $html .= "<style type=text/css>"; $html .= "th{color: #fff; font-weight: bold; background-color: #AAC7E3}"; $html .= "td{background-color: #fff; color: #222}"; $html .= "</style>"; $html .= "<h4>Listado General de las Personas con Permisos</h4>"; $html .= "<table width='100%'>"; $html .= "<tr><th>No hay empleados de permiso con las características indicadas</th></tr>"; $html .= "</table>"; $nombre_archivo = utf8_decode("Listado General " . $nombre . ".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'); }
public function generar() { $this->load->library('Pdf'); $pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Israel Parra'); $pdf->SetTitle('Ejemplo de provincías con TCPDF'); $pdf->SetSubject('Tutorial TCPDF'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); // datos por defecto de cabecera, se pueden modificar en el archivo tcpdf_config_alt.php de libraries/config $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 001', PDF_HEADER_STRING, array(0, 64, 255), array(0, 64, 128)); $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->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // 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); // Establecer el tipo de letra //Si tienes que imprimir carácteres ASCII estándar, puede utilizar las fuentes básicas como // Helvetica para reducir el tamaño del archivo. $pdf->SetFont('freemono', '', 14, '', true); // Añadir una página // Este método tiene varias opciones, consulta la documentación para más información. $pdf->AddPage(); //fijar efecto de sombra en el texto $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal')); // Establecemos el contenido para imprimir $matricula = $this->input->post('provincia'); $provincias = $this->modelo->getIdentificacion($matricula); foreach ($provincias as $fila) { $prov = $fila['nombre']; } //preparamos y maquetamos el contenido a crear $html = ''; $html .= "<style type=text/css>"; $html .= "th{color: #fff; font-weight: bold; background-color: #222}"; $html .= "td{background-color: #AAC7E3; color: #fff}"; $html .= "</style>"; $html .= "<h2>Localidades de " . $prov . "</h2><h4>Actualmente: " . count($provincias) . " localidades</h4>"; $html .= "<table width='100%'>"; $html .= "<tr><th>Id localidad</th><th>Localidades</th></tr>"; //provincias es la respuesta de la función getProvinciasSeleccionadas($provincia) del modelo foreach ($provincias as $fila) { $id = $fila['ap']; $localidad = $fila['am']; $html .= "<tr><td class='id'>" . $id . "</td><td class='localidad'>" . $localidad . "</td></tr>"; } $html .= "</table>"; // Imprimimos el texto con writeHTMLCell() $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true); // --------------------------------------------------------- // Cerrar el documento PDF y preparamos la salida // Este método tiene varias opciones, consulte la documentación para más información. $nombre_archivo = utf8_decode("Localidades de " . $prov . ".pdf"); $pdf->Output($nombre_archivo, 'I'); }
public function generarSalidaEmpleados() { $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('p', '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_WIDTH,PDF_HEADER_TITLE,PDF_HEADER_STRING,array(0,64,255),array(0,64, 128)); $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('l'); // 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->SetFont('times', '', 10, '', true); $pdf->AddPage(); $pdf->Cell(44, 0, 'Cédula', 1, 0, 'C', 0, '', 0); $pdf->Cell(90, 0, 'Nombres y Apellidos', 1, 0, 'C', 0, '', 1); $pdf->Cell(44, 0, 'Sexo', 1, 0, 'C', 0, '', 1); $pdf->Cell(44, 0, 'Edo. Civil', 1, 0, 'C', 0, '', 1); $pdf->Cell(44, 0, 'Posee Partida', 1, 1, 'C', 0, '', 1); $pdf->Ln(5); $pdf->Cell(44, 0, 'Teléfono Móvil ', 1, 0, 'C', 0, '', 0); $pdf->Cell(90, 0, 'Municipio', 1, 0, 'C', 0, '', 1); $pdf->Cell(88, 0, 'Parroquia', 1, 0, 'C', 0, '', 1); $pdf->Cell(44, 0, 'Fecha Nac.', 1, 1, 'C', 0, '', 1); $pdf->Ln(5); $pdf->Cell(44, 0, 'Teléfono Local', 1, 0, 'C', 0, '', 0); $pdf->Cell(178, 0, 'Dirección', 1, 0, 'C', 0, '', 1); $pdf->Cell(44, 0, 'Edad', 1, 1, 'C', 0, '', 1); $pdf->Ln(5); $pdf->Cell(44, 0, 'CI Responsable', 1, 0, 'C', 0, '', 0); $pdf->Cell(90, 0, 'Nombres y Apellidos del Responsable', 1, 0, 'C', 0, '', 1); $pdf->Cell(130, 0, 'Dirección', 1, 0, 'C', 0, '', 1); // <td><b>CI Responsable</b></td> // <td colspan="2"><b>Nombres y Apellidos del Responsable</b></td> // <td colspan="3"><b>Dirección</b></td> // <td><b>Tipo Vivienda</b></td> // <td><b>Tenencia Vivienda</b></td> // <td><b>Parentesco</b></td> // <td><b>Padres Vivos</b></td> // <td> // <b>Nro. Personas</b> // </td> // <td><b>Convive con el Discapacitado</b></td> // <td><br><b>Condición/Discapacidad</b></td> // <td><br><b>Tipo Discapacidad</b></td> // <td colspan="2"><br><b>Diagnóstico Tipo Discapacidad</b></td> // <td><br><b>Certificado Informe Médico</b></td> // <td><br><b>Estatus</b></td> // <td><b>Requiere Medicamento</b></td> // <td colspan="2"><br><b>Nombre de los Medicamentos</b></td> // <td><br><b>Requiere Ayuda</b></td> // <td colspan="2"><br><b>Nombre de la Ayuda</b></td> // <td ><b>Grado de instrucción</b></td> // <td colspan="2"><b>Deseo de continuar Estudiando</b></td> // <td colspan="2"><b>Condiciones para seguir Estudiando</b></td> // <td><b>Limitación de Estudio</b></td> // --------------------------------------------------------- //Close and output PDF document $pdf->Output('example_004.pdf', 'I'); }
function generar() { $this->load->library('Pdf'); $pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Cony Jaramillo'); $pdf->SetTitle('Combrobante'); $pdf->SetSubject('Registro Coordinadores y Promotores'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); ob_start(); // datos por defecto de cabecera, se pueden modificar en el archivo tcpdf_config_alt.php de libraries/config $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING, array(0, 64, 255), array(0, 1, 0)); $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->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // 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); // Establecer el tipo de letra $pdf->SetFont('helvetica', '', 14, '', true); // Añadir una página // Este método tiene varias opciones, consulta la documentación para más información. $pdf->AddPage(); //fijar efecto de sombra en el texto $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(255, 255, 255), 'opacity' => 1, 'blend_mode' => 'Normal')); // Establecemos el contenido para imprimir $data['nombre'] = $this->input->post('nombre'); $data['folio'] = $this->input->post('folio'); $data['correo'] = $this->input->post('correo'); $data['fecha'] = $this->input->post('fecha'); $data['plantel'] = $this->input->post('plantel'); $data['institucion'] = $this->input->post('institucion'); $data['tipo_registro'] = $this->input->post('tipo_registro'); $matricula = $this->input->post('matricula'); //preparamos y maquetamos el contenido a crear $html = ""; $html .= "<style type=text/css>"; $html .= " h1 {\n\t\t\t\t\t \n\t\t\t\t\t width: 100%;\n\t\t\t\t\t font-weight: bold;\n\t\t\t\t\t font-size: 13;\n\t\t\t\t\t line-height: 2;\n\t\t\t\t\t text-align: center;\n\t\t\t\t\t color: #070005;\n\t\t\t\t\t}\n \t\t\th2{\n \t\t\t\t\ttext-align: justify;\n \t\t\t\t\tfont-weight: bold;\n\t\t\t\t\t\tfont-size: 9;\n\t\t\t\t\t\tline-height: 1.5;\n \t\t\t\t\tcolor: #070005;\n \t\t\t\t}\n \t\t\th3{\n \t\t\t\tline-height: 3;\n \t\t\t\ttext-align: center;\n \t\t\t\tfont-weight: normal;\n \t\t\t\tfont-size: 9;\n \t\t\t\t}\n\t\t\t\t\th4{\n \t\t\t\t\ttext-align: center;\n \t\t\t\t\tfont-weight: bold;\n\t\t\t\t\t\tfont-size: 10;\n\t\t\t\t\t\tline-height: 1;\n \t\t\t\t\tcolor: #070005;\n\t\t\t\t}\n \t\t\t\n \t\t\th5{\n \t\t\t\t\ttext-align: justify;\n \t\t\t\t\tfont-weight: bold;\n\t\t\t\t\t\tfont-size: 10;\n\t\t\t\t\t\tline-height: 4;\n \t\t\t\t\tcolor: #070005;\n\t\t\t\t}\n \t\t\tp {\n \t\t\t \tline-height: 1.5;\n \t\t\t\tcolor: #5E5D5D;\n \t\t\t\tfont-weight: bold;\n\t\t\t\t text-align: justify;\n\t\t\t\t\t\n \t\t\t\tfont-size: 9;\n \t\t\t\t\n\t\t\t\t}\n \t\t\t\t\n \t\t\t\n\t\t\t"; $html .= "</style>"; $html .= '<h1>COMPROBANTE DE REGISTRO COMO ' . $data['tipo_registro'] . '<br> DEL PROGRAMA PREPA SÍ</h1>'; $html .= "<p><h5>" . $data['nombre'] . "</h5></p>"; $html .= '<table border="0"> <tr> <td><h2>FECHA DE REGISTRO</h2></td> <td colspan="2"><p>' . $data['fecha'] . '</p></td> </tr> <tr> <td><h2>INSTITUCION</h2></td> <td colspan="2"><p>' . $data['institucion'] . '</p></td> </tr> <tr> <td><h2>PLANTEL</h2></td> <td colspan="2"><p>' . $data['plantel'] . '</p></td> </tr> <tr> <td colspan="3"><h4></h4></td> </tr> <tr> <td colspan="3" bgcolor="#FBEFFB"><h4>FOLIO: ' . $data['folio'] . '</h4></td> </tr> </table>'; $html .= "<br><br><br><br><br><h3>Has quedado registrado, te sugerimos estar al pendiente de tu correo: <br> <u>" . $data['correo'] . "</u></h3>"; // Imprimimos el texto con writeHTMLCell() $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true); $estilo = array('padding' => 'auto'); $tipos = array('C128A'); for ($i = 0; $i < sizeof($tipos); $i++) { $pdf->SetXY(78, 110); $pdf->Cell(45, 50, $matricula, 0, 0, 'C'); $pdf->write1DBarcode($matricula, $tipos[$i], 75, 115, 50, 14, '', $estilo); } // --------------------------------------------------------- // Cerrar el documento PDF y preparamos la salida // Este método tiene varias opciones, consulte la documentación para más información. $nombre_archivo = utf8_decode("Registro_" . $data['folio'] . ".pdf"); $pdf->Output($nombre_archivo, 'I'); ob_end_flush(); }
public function cetak_kertas_resep() { $this->load->library('Pdf'); $pdf = new Pdf('P', 'mm', 'A5', true, 'UTF-8', false); // $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetPageOrientation('P'); $pdf->SetAuthor('Pemerintah Kota Bogor'); $pdf->SetTitle('Resep Obat'); $pdf->SetSubject('Resep Obat'); $pdf->SetKeywords('Resep Obat'); // $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING, array(0,64,255), array(0,64,128)); $pdf->setFooterData(array(0, 64, 0), 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->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) { require_once dirname(__FILE__) . '/lang/eng.php'; $pdf->setLanguageArray($l); } $pdf->setFontSubsetting(true); $pdf->SetFont('helvetica', '', 11, '', true); $pdf->AddPage(); $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal')); $puskesmas = $this->m_rujukan->get_puskesmas_info($this->session->userdata('kd_puskesmas')); $kd_trans_pelayanan = $this->uri->segment(3); $surat = $this->m_rujukan->get_data_pasien($kd_trans_pelayanan); if ($surat['alamat'] == '') { $surat['alamat'] = "-"; } if ($surat['umur'] == '') { $surat['umur'] = "-"; } if ($surat['jenis_kelamin'] == '') { $surat['jenis_kelamin'] = "-"; } if ($surat['idkartu_medical'] == '') { $surat['idkartu_medical'] = "-"; } if ($surat['kd_bayar'] == '') { $surat['kd_bayar'] = "-"; } if ($surat['no_asuransi'] == '') { $surat['no_asuransi'] = "-"; } if ($surat['nm_dokter'] == '') { $surat['nm_dokter'] = "_____________________"; } $tgl = date('d-m-Y'); #echo $this->db->last_query(); exit; $html = '<table align="center" border="0" align="left">'; $html .= ' <tr> <td width="20%" style="text-align: center;"><img src="' . base_url() . 'assets/img/logo.png" width="80" height="80"/></td> <td width="80%" style="text-align: center;"><h4>00/DOK IN PKM - USI/01/PKM/151/2011</h4><br><h3>PEMERINTAH PROPINSI ' . $puskesmas["nm_propinsi"] . '<br>DINAS KESEHATAN KOTA ' . $puskesmas["nm_kota"] . '</h3> <h4>UPTD ' . $puskesmas["nm_puskesmas"] . '<br>' . $puskesmas["alamat"] . '<br>' . $puskesmas["no_telp"] . '</h4> </td> </tr>'; $html .= '</table>'; $html .= '<p align="left"><b>Resep Obat</b></p>'; $html .= '<table align="center" cellpadding="2" cellspacing="0" border="0" width="100%"> <tr> <td width="20%" border="1px" style="text-align: center;">' . $surat["kd_bayar"] . '</td> <td width="5%" style="text-align: left;"></td> <td width="75%" style="text-align: right;">' . $puskesmas["nm_kota"] . ', ' . $tgl . '</td> </tr> <tr> <td style="text-align: right;" colspan="3">No KK: ' . $surat["idkartu_medical"] . '</td> </tr> <tr> <td style="text-align: right;" colspan="3">No R.M. Pasien: ' . $surat["kd_rekam_medis"] . '</td> </tr> <tr> <td><p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p><p> </p><p> </p> <p> </p></td> </tr> <tr> <td style="text-align: right;" colspan="3">Pemeriksa, </td> </tr> <tr> <td><p> </p> <p> </p></td> </tr> <tr> <td style="text-align: right;" colspan="3">' . $surat["nm_dokter"] . '</td> </tr> <tr> <td width="17%" style="text-align: left;">No. Antrian</td> <td width="2%" style="text-align: left;">:</td> <td width="81%" style="text-align: left;">' . $surat["no_antrian"] . '</td> </tr> <tr> <td width="17%" style="text-align: left;">Nama</td> <td width="2%" style="text-align: left;">:</td> <td width="81%" style="text-align: left;">' . $surat["nm_lengkap"] . '</td> </tr> <tr> <td style="text-align: left;">Umur</td> <td style="text-align: left;">:</td> <td style="text-align: left;">' . $surat["umur"] . '</td> </tr> <tr> <td style="text-align: left;">Alamat</td> <td style="text-align: left;">:</td> <td style="text-align: left;">' . $surat["alamat"] . ', Kel. ' . ucwords(strtolower($surat["nm_kelurahan"])) . ', Kec. ' . ucwords(strtolower($surat["nm_kecamatan"])) . ' , ' . ucwords(strtolower($surat["nm_kota"])) . '</td> </tr> <tr> <td style="text-align: left;">Status Psn</td> <td style="text-align: left;">:</td> <td style="text-align: left;">' . $surat["cara_bayar"] . ' , No ' . $surat["no_asuransi"] . '</td> </tr> </table>'; $pdf->SetTitle('Judul'); $pdf->SetHeaderMargin(30); $pdf->SetTopMargin(20); $pdf->setFooterMargin(20); $pdf->SetAutoPageBreak(true); $pdf->SetAuthor('Pengarang'); $pdf->SetDisplayMode('real', 'default'); $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true); $pdf->Output('Resep.pdf', 'I'); }
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'); }
function imprimir() { $this->load->library('Pdf'); $pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $this->load->library('zend'); //load in folder Zend $this->zend->load('Zend/Barcode'); //generate barcode $fichas = $this->Ficha->buscar_imprimir(); foreach ($fichas as $f) { $res = Zend_Barcode::factory('code128', 'image', array('text' => $f['clave']), array()); $res = $res->draw(); imagepng($res, './codigos/' . $f['clave'] . '.png'); } //$pdf->SetAuthor('Israel Parra'); // $pdf->SetTitle('Ejemplo de provincías con TCPDF'); //$pdf->SetSubject('Tutorial TCPDF'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); // datos por defecto de cabecera, se pueden modificar en el archivo tcpdf_config_alt.php de libraries/config //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 001', PDF_HEADER_STRING, array(0, 64, 255), array(0, 64, 128)); $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->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // 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); // Establecer el tipo de letra //Si tienes que imprimir carácteres ASCII estándar, puede utilizar las fuentes básicas como // Helvetica para reducir el tamaño del archivo. $pdf->SetFont('freemono', '', 14, '', true); // Añadir una página // Este método tiene varias opciones, consulta la documentación para más información. $pdf->AddPage(); //fijar efecto de sombra en el texto $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal')); // Establecemos el contenido para imprimir $fichas = $this->Ficha->buscar_imprimir(); //foreach($fichas as $fila) $i = 0; while ($i < 1) { $clave = $fichas[$i]['clave']; // //preparamos y maquetamos el contenido a crear $html = ''; $html .= "<style type=text/css>"; $html .= "th{color: #fff; font-weight: bold; background-color: #222}"; $html .= "td{background-color: #AAC7E3; color: #fff}"; $html .= "</style>"; $html .= '<img src="./codigos/' . $clave . '.png">'; //generate barcode //$html .= Zend_Barcode::render('code128', 'image', array('text'=>$clave), array())->render(); $style = array('border' => true, 'vpadding' => 'auto', 'hpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'module_width' => 4, 'module_height' => 3); $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 4, $fill = 0, $reseth = true, $align = '', $autopadding = true); //$pdf->Ln(); //$pdf->Addpage(); $i++; } // --------------------------------------------------------- // Cerrar el documento PDF y preparamos la salida // Este método tiene varias opciones, consulte la documentación para más información. $nombre_archivo = utf8_decode("Demandas.pdf"); $pdf->Output($nombre_archivo, 'I'); }
public function generarListadogendis() { $nacionalidad = $this->input->get("nacionalidad") != '' ? "LIKE '%" . $this->input->get("nacionalidad") . "%'" : 'LIKE "%"'; $ceduladisca = $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 "%"'; $edocivil = $this->input->get("edocivil") != 'null' ? '=' . $this->input->get("edocivil") : 'LIKE "%"'; $edad = $this->input->get("edad") != 'null' ? '=' . $this->input->get("edad") : '>= 0'; $municipio = $this->input->get("municipio") != 'null' ? '=' . $this->input->get("municipio") : 'LIKE "%"'; $parroquia = $this->input->get("parroquia") != 'null' ? '=' . $this->input->get("parroquia") : 'LIKE "%"'; $sexo = $this->input->get("sexo") != 'null' ? '=' . $this->input->get("sexo") : 'LIKE "%"'; $direccion = $this->input->get("direccion") != 'null' ? '=' . $this->input->get("direccion") : 'LIKE "%"'; $institucion = $this->input->get("institucion") != 'null' ? '=' . $this->input->get("institucion") : 'LIKE "%"'; $poseeinforme = $this->input->get("poseeinforme") != 'null' ? '=' . $this->input->get("poseeinforme") : 'LIKE "%"'; $condiciondis = $this->input->get("condiciondis") != 'null' ? '=' . $this->input->get("condiciondis") : 'LIKE "%"'; $medicamentos = $this->input->get("medicamentos") != 'null' ? '=' . $this->input->get("medicamentos") : 'LIKE "%"'; $tipodiscapacidad = $this->input->get("tipodiscapacidad") != 'null' ? '=' . $this->input->get("tipodiscapacidad") : 'LIKE "%"'; $requiereayuda = $this->input->get("requiereayuda") != 'null' ? '=' . $this->input->get("requiereayuda") : 'LIKE "%"'; $ayuda = $this->input->get("ayuda") != 'null' ? '=' . $this->input->get("ayuda") : 'LIKE "%"'; $tipovivienda = $this->input->get("tipovivienda") != 'null' ? '=' . $this->input->get("tipovivienda") : 'LIKE "%"'; $status = $this->input->get("status") != 'null' ? '=' . $this->input->get("status") : '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_WIDTH,PDF_HEADER_LOGO_WIDTH1,PDF_HEADER_TITLE ,PDF_HEADER_STRING,array(0,64,255),array(0,64, 128)); $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, PDF_HEADER_TITLE, PDF_HEADER_STRING); $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH1, PDF_HEADER_TITLE, PDF_HEADER_STRING); $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); $pdf->SetPageOrientation('l'); $pdf->SetFillColorArray(''); // 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->SetFont('times', '', 10, '', true); $pdf->AddPage(); $html = null; $nombre_archivo = null; // Establecemos el contenido para imprimir $resultado1 = $this->Repplanilla_model->getdiscapacidad($status, $nacionalidad, $ceduladisca, $direccion, $nombre, $apellido, $edocivil, $edad, $municipio, $parroquia, $sexo, $institucion, $tipodiscapacidad, $ayuda, $requiereayuda, $poseeinforme, $condiciondis, $medicamentos); if ($resultado1) { $html = ''; $html .= "<style type=text/css>"; $html .= "th{color: black; font-weight: bold; background-color:#AAC7E3; align=center}"; $html .= "td{ color: #222; align=center}"; $html .= "p.saltodepagina{display: block; page-break-before: always}"; $html .= "</style>"; foreach ($resultado1 as $fila) { $html .= ' <table border="1" > <tr><th colspan="6"><h3>I. Identificación de la Persona con Discapacidad</h3></th> </tr> <tr align="center" bgcolor="#DCDCDC"> <td><b>Cédula</b></td> <td colspan="2"><b>Nombres y Apellidos</b></td> <td><b>Sexo</b></td> <td><b>Edo. Civil</b></td> <td><br><b>Posee Partida</b></td> </tr> <tr align="center"> <td> ' . mb_convert_case($fila['nacionalidad'], MB_CASE_TITLE, "UTF-8") . ' - ' . mb_convert_case($fila['cedula'], MB_CASE_TITLE, "UTF-8") . ' </td> <td colspan="2" align="justify">' . mb_convert_case($fila['nombres'], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila['sexo'], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . $fila['edocivil'] . '</td> <td>' . mb_convert_case($fila['poseepartida'], MB_CASE_TITLE, "UTF-8") . '</td> </tr> <tr align="center" bgcolor="#DCDCDC"> <td><b>Teléfono Móvil </b></td> <td colspan="2"><br><b>Municipio</b></td> <td colspan="2"><b>Parroquia</b></td> <td><br><b>Fecha Nac.</b></td> </tr> <tr align="left"> <td align="center">' . $fila['movil'] . '</td> <td colspan="2">' . mb_convert_case($fila['municipio'], MB_CASE_TITLE, "UTF-8") . ' </td> <td colspan="2">' . mb_convert_case($fila['parroquia'], MB_CASE_TITLE, "UTF-8") . ' </td> <td align="center">' . $fila['fechanac'] . '</td> </tr> <tr align="center" bgcolor="#DCDCDC"> <td><b>Teléfono Local</b></td> <td colspan="4"><b>Dirección</b></td> <td><b>Edad</b></td> </tr> <tr align="justify"> <td align="center">' . $fila['fijo'] . '</td> <td colspan="4">' . mb_convert_case($fila['direccion'], MB_CASE_TITLE, "UTF-8") . '</td> <td align="center"> ' . $fila['edaddis'] . ' año(s) y ' . $fila['meses'] . ' mes(es)</td> </tr> <tr><th colspan="6" align="center"><h3>II. Caracteristícas Socio-Familiar de la Persona con Discapacidad</h3></th></tr> <tr align="center" bgcolor="#DCDCDC"> <td><b>CI Responsable</b></td> <td colspan="2"><b>Nombres y Apellidos del Responsable</b></td> <td colspan="3"><b>Dirección</b></td> </tr> <tr align="left"> <td align="center">' . $fila['cedularesponsable'] . '</td> <td colspan="2">' . mb_convert_case($fila['nombresresponsable'], MB_CASE_TITLE, "UTF-8") . ' </td> <td colspan="3" align="justify">' . mb_convert_case($fila['direccionresponsable'], MB_CASE_TITLE, "UTF-8") . '</td> </tr> <tr align="center" bgcolor="#DCDCDC"> <td><b>Tipo Vivienda</b></td> <td><b>Tenencia Vivienda</b></td> <td><b>Parentesco</b></td> <td><b>Padres Vivos</b></td> <td> <b>Nro. Personas</b> </td> <td><b>Convive con el Discapacitado</b></td> </tr> <tr> <td>' . mb_convert_case($fila['tipovivienda'], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila['tenenciavivienda'], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila['familiardirecto'], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila['parentescofamiliar'], MB_CASE_TITLE, "UTF-8") . '</td> <td align="left"> Habitantes:' . $fila['numerohabitantes'] . ' Trabajan:' . $fila['numerotrabajan'] . '</td> <td>' . $fila['convivenciadiscapa'] . '</td> </tr> <tr><th colspan="6" align="center"><h3>III. Caracteristícas de la Discapacidad</h3></th></tr> <tr align="center" bgcolor="#DCDCDC"> <td><br><b>Condición/Discapacidad</b></td> <td><br><b>Tipo Discapacidad</b></td> <td colspan="2"><br><b>Diagnóstico Tipo Discapacidad</b></td> <td><br><b>Certificado Informe Médico</b></td> <td><br><b>Estatus</b></td> </tr> <tr align="left"> <td align="center">' . mb_convert_case($fila['condicion'], MB_CASE_TITLE, "UTF-8") . '</td> <td align="center">' . mb_convert_case($fila['tipodis'], MB_CASE_TITLE, "UTF-8") . '</td> <td colspan="2">' . mb_convert_case($fila['describirtipodisca'], MB_CASE_TITLE, "UTF-8") . '</td> <td align="center">' . mb_convert_case($fila['poseeinforme'], MB_CASE_TITLE, "UTF-8") . '</td> <td align="center">' . mb_convert_case($fila["status"], MB_CASE_TITLE, "UTF-8") . '</td> </tr> <tr align="center" bgcolor="#DCDCDC"> <td><b>Requiere Medicamento</b></td> <td colspan="2"><br><b>Nombre de los Medicamentos</b></td> <td><br><b>Requiere Ayuda</b></td> <td colspan="2"><br><b>Nombre de la Ayuda</b></td> </tr> <tr align="center"> <td>' . mb_convert_case($fila['usamedica'], MB_CASE_TITLE, "UTF-8") . '</td> <td colspan="2">' . mb_convert_case($fila['nombremedica'], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila['requiereayuda'], MB_CASE_TITLE, "UTF-8") . '</td> <td colspan="2">' . mb_convert_case($fila['nombreayuda'], MB_CASE_TITLE, "UTF-8") . '</td> </tr> <tr><th colspan="6" align="center"><h3>IV. Nivel Educativo de la Persona con Discapacidad</h3></th></tr> <tr align="center" bgcolor="#DCDCDC"> <td ><b>Grado de instrucción</b></td> <td colspan="2"><b>Deseo de continuar Estudiando</b></td> <td colspan="2"><b>Condiciones para seguir Estudiando</b></td> <td><b>Limitación de Estudio</b></td> </tr> <tr align="center"> <td>' . mb_convert_case($fila['gradoinstruccion'], MB_CASE_TITLE, "UTF-8") . '</td> <td colspan="2">' . mb_convert_case($fila['deseoestudio'], MB_CASE_TITLE, "UTF-8") . '</td> <td colspan="2">' . mb_convert_case($fila['condicionestudio'], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila['nombrelimitacion'], MB_CASE_TITLE, "UTF-8") . '</td> </tr> </table>'; $resultado2 = $this->Repplanilla_model->getnivelocupacional($fila['cedula']); foreach ($resultado2 as $fila) { $html .= ' <table border="1"> <tr><th colspan="6" align="center"><h3>V. Nivel Ocupacional de la Persona con Discapacidad</h3></th></tr> <tr align="center" bgcolor="#DCDCDC"> <td><b>Habilidad o Destreza</b></td> <td><b>Posee Experiencia</b></td> <td colspan="2"><b>Experiencia Laboral</b></td> <td><b>Act. Recreativa/Deportiva</b></td> <td><b>Nombre de la Actividad</b></td> </tr> <tr align="center"> <td>' . mb_convert_case($fila['habilidaddis'], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila['experiencialaboral'], MB_CASE_TITLE, "UTF-8") . '</td> <td colspan="2">' . mb_convert_case($fila['descripcionexperiencia'], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila['actividadrecdep'], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila['indiqueactividad'], MB_CASE_TITLE, "UTF-8") . '</td> </tr> <tr align="center" bgcolor="#DCDCDC"> <td><b>Desarrolla Actividad</b></td> <td><b>Tipo Actividad Productiva</b></td> <td><b>Condiciones para Aprender Oficio</b></td> <td><b>Manifiesta Deseo de Aprender</b></td> <td colspan="2"><br><b>Tipo de Oficio que le Gustaría Aprender</b></td> </tr> <tr align="center"> <td>' . mb_convert_case($fila['realizaactividad'], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila['actproductiva'], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila['condicionaprender'], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila['deseoaprender'], MB_CASE_TITLE, "UTF-8") . '</td> <td colspan="2">' . mb_convert_case($fila['oficioocup'], MB_CASE_TITLE, "UTF-8") . '</td> </tr> <tr><th colspan="6" align="center"><h3>VI. Nivel de Apoyo Institucional para la Persona con Discapacidad</h3></th></tr> <tr align="center" bgcolor="#DCDCDC"> <td colspan="2"><br><b>Institución de Apoyo</b></td> <td colspan="2"><b>Nombre completo de la Institución</b></td> <td colspan="2"><b>Tipo de Ayuda Prestada</b></td> </tr> <tr align="center"> <td colspan="2">' . mb_convert_case($fila['nombreinstapoyo'], MB_CASE_TITLE, "UTF-8") . '</td> <td colspan="2" align="left" >' . mb_convert_case($fila['nombrecompletoindt'], MB_CASE_TITLE, "UTF-8") . '</td> <td colspan="2">' . mb_convert_case($fila['tipoayuda'], MB_CASE_TITLE, "UTF-8") . '</td> </tr> <tr align="center" bgcolor="#DCDCDC"> <td><b>Existe Consejo Comunal</b></td> <td colspan="2"><br><b>Consejo Comunal en su Sector</b></td> <td><b>Existe Comité Comunitario</b></td> <td colspan="2"><b>Comité Comunitario en su Sector</b></td> </tr> <tr align="center"> <td>' . mb_convert_case($fila['existeconsejo'], MB_CASE_TITLE, "UTF-8") . '</td> <td colspan="2">' . mb_convert_case($fila['nombreconsejo'], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila['existecomite'], MB_CASE_TITLE, "UTF-8") . '</td> <td colspan="2">' . mb_convert_case($fila['nombrecomite'], MB_CASE_TITLE, "UTF-8") . '</td> </tr> </table>'; $resultado3 = $this->Repplanilla_model->getusuario($fila['cedula']); foreach ($resultado3 as $fila) { $html .= ' <table border="1"> <tr><th colspan="6" align="center"><h3>Información de la Persona que Elaboro el Registro</h3></th></tr> <tr align="center" bgcolor="#DCDCDC"> <td><b>Cédula</b></td> <td colspan="3"><br><b>Nombre y Apellido</b></td> <td><b>Teléfono</b></td> <td><b>Fecha del Registro</b></td> </tr> <tr align="center"> <td>' . mb_convert_case($fila['cedulausuario'], MB_CASE_TITLE, "UTF-8") . '</td> <td colspan="3">' . mb_convert_case($fila['nombresusuario'], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila['telfusuario'], MB_CASE_TITLE, "UTF-8") . '</td> <td>' . mb_convert_case($fila['fecharegistro'], MB_CASE_TITLE, "UTF-8") . '</td> </tr> </table><br><br><br>'; } } } $nombre_archivo = utf8_decode("Planilla Discapacitados.pdf"); } else { $html = ''; $html .= "<style type=text/css>"; $html .= "th{color: #fff; font-weight: bold; background-color: #AAC7E3}"; $html .= "td{background-color: #fff; color: #222}"; $html .= "</style>"; $html .= "<h4>Planilla de Personas con Discapacidad</h4>"; $html .= "<table width='100%'>"; $html .= "<tr><th>No hay Personas con Discapacidad con las caracteristicas indicadas</th></tr>"; $html .= "</table>"; $nombre_archivo = utf8_decode("Planilla de Personas con Discapacidad.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'); }
public function generarReporteActividadEvento() { $idEvento = $this->input->get('idEv'); $html = null; $pdf = new Pdf('L', 'mm', 'Legal', true, 'UTF-8', false); $pdf->setPageOrientation('l'); $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf->SetMargins(PDF_MARGIN_LEFT, 15, PDF_MARGIN_RIGHT); $pdf->setHeaderMargin(2); $pdf->SetHeaderData('bannerprevengo4.png', 270, 'Gobernacion de Lara', 'Oficina de Personal--División de Planificación y Presupuesto', array(0, 64, 255), array(0, 64, 128)); $pdf->setFooterMargin(12); $pdf->setFooterData(); $pdf->SetAlpha(1, 'Normal'); $pdf->Image('imagen/logo/degradado.PNG', 30, 54, 100, 104, '', '', 'N', '', '', 'C'); // recuperamos la opacidad por defecto $pdf->SetAlpha(1, 'Normal'); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->setFontSubsetting(true); $pdf->SetFont('times', '', 12, '', true); $pdf->SetFont('Times', 'B', 12); $pdf->setPrintHeader(true); $pdf->setPrintFooter(true); $pdf->AddPage(); $pdf->SetTextColor('8', '8', '8'); $pdf->Ln(10); $pdf->SetFont('times', '', 11, '', true); $ano = date('Y'); $mesesN = array(1 => "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"); $mes = $mesesN[date('n')]; $dia = date('d'); $html .= ' <table> <tr colspan="8"> <td colspan="8"><p align="rigth"><b>Barquisimeto, ' . $dia . ' de ' . $mes . ' del ' . $ano . '</b></p></td> </tr> </table>'; $html .= "<h1>Reporte General de Metas alcanzada para las actividades</h1>"; $condicion = 'evento.id=' . $idEvento; $reporte = $this->evento_model->cargarListaEventoSeleccionPDF($condicion); if ($reporte->num_rows > 0) { foreach ($reporte->result_array() as $fila2) { $html .= ' <table border="1"> <tr colspan="4"> <td colspan="4" bgColor="#429DED"><p align="center"><b>Evento</b></p></td> </tr> <tr colspan="4"> <td colspan="1" bgColor="#429DED"><p align="center"><b>Titulo</b></p></td> <td colspan="2" bgColor="#429DED"><p align="center"><b>Descripción</b></p></td> <td colspan="1" bgColor="#429DED"><p align="center"><b>Estatus</b></p></td> </tr> <tr colspan="4"> <td colspan="1"><p align="center">' . $fila2['titulo'] . '</p></td> <td colspan="2"><p align="center">' . $fila2['descripcion'] . '</p></td> <td colspan="1"><p align="center">' . $fila2['estatus'] . '</p></td> </tr>'; $reporte2 = $this->actividad_model->cargarMetaPlandeAccionDeEventoPDF($fila2['idEv']); $html .= '<tr colspan="4"> <td colspan="4" bgColor="#429DED"><p align="center"><b>Plan de Accion</b></p></td> </tr>'; if ($reporte2->num_rows > 0) { foreach ($reporte2->result_array() as $fila2) { $html .= ' <tr colspan="5"> <td colspan="1" bgColor="#00BFFF"><p align="center"><b>Actividad:</b></p></td> <td colspan="1" bgColor="#00BFFF"><p align="center"><b>Meta Propuesta</b></p></td> <td colspan="1" bgColor="#00BFFF"><p align="center"><b>Meta Alcanzada</b></p></td> <td colspan="1" bgColor="#00BFFF"><p align="center"><b>Estatus</b></p></td> </tr> <tr colspan="4"> <td colspan="1" ><p align="center">' . $fila2['descripcion'] . '</p></td> <td colspan="1" ><p align="center">' . $fila2['metap'] . '</p></td> <td colspan="1" ><p align="center">' . $fila2['metaa'] . '</p></td> <td colspan="1" ><p align="center">' . $fila2['estatus'] . '</p></td> </tr>'; } } else { $html .= '<tr colspan="4"> <td colspan="4"><p align="center"><b> El evento no tiene plan de accion registrado.</b></p></td> </tr>'; } $html .= '</table>'; $html .= '<h1></H1>'; } } else { $html .= '<tr colspan="4"> <td colspan="4" bgColor="#429DED"><p align="center"><b>No hay Eventos registrados</b></p></td> </tr>'; $html .= '</table>'; } $nombre_archivo = utf8_decode("reporteEventos.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'); }
<?php $pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Anibal Urbiola'); $pdf->SetTitle('Descarga de la ficha de chikungunya'); $pdf->SetSubject('Conversion a PDF'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); // datos por defecto de cabecera, se pueden modificar en el archivo tcpdf_config_alt.php de libraries/config $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 001', PDF_HEADER_STRING, array(0, 64, 255), array(0, 64, 128)); $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->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // 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); // Establecer el tipo de letra //Si tienes que imprimir carácteres ASCII estándar, puede utilizar las fuentes básicas como // Helvetica para reducir el tamaño del archivo. $pdf->SetFont('courier', '', 14, '', true);