/** @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');
 }
Example #2
0
 public function GeneraPdf($html, $nombre)
 {
     $pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('');
     $pdf->SetTitle('');
     $pdf->SetSubject('');
     $pdf->SetKeywords('');
     $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . '', PDF_HEADER_STRING, array(255, 255, 255), array(255, 255, 255));
     $pdf->SetFooterData($tc = array(0, 64, 0), $lc = array(255, 255, 255));
     $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', '', 10, '', true);
     $pdf->AddPage();
     $pdf->writeHTML($html, true, false, true, false, '');
     $nombre_archivo = utf8_decode($nombre . date('Y-m-d-His') . ".pdf");
     $pdf->Output($nombre_archivo, 'I');
 }
Example #3
0
 public function imprimir_detalle()
 {
     $data['id'] = $this->input->post('id');
     $data['cliente'] = $this->clientes->buscar_cliente_detalle($data);
     $data['orden'] = $this->clientes->buscar_orden_detalle($data);
     $html = $this->load->view('pdf/detalle_cliente', $data, true);
     /////////////
     $this->load->library('Pdf');
     $pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetTitle('Titulo Generación de Etiqueta');
     $pdf->SetSubject('Subtitulo');
     $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->setImageScale(PDF_IMAGE_SCALE_RATIO);
     $pdf->setFontSubsetting(true);
     $pdf->SetFont('freemono', '', 14, '', true);
     $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
     $pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     $pdf->SetMargins(10, 10, 10);
     $pdf->SetAutoPageBreak(true, -10);
     $pdf->AddPage('P', array(215.9, 279.4));
     //en mm 21.59cm por 27.94cm
     $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
     $nombre_archivo = utf8_decode("informe" . ".pdf");
     $pdf->Output($nombre_archivo, 'I');
 }
Example #4
0
 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');
 }
Example #5
0
 function ImprimirPdf($pedido)
 {
     $total = 0;
     foreach ($pedido as $idx => $p) {
         $pdf = new Pdf();
         $pdf->AddPage();
         $pdf->SetFont('Arial', 'B', 14);
         $pdf->Cell(40, 7, "Pedido: " . $pedido[$idx]['codigo_pedido'], 0);
         $pdf->Cell(70, 7, "Estado: " . $pedido[$idx]['Estado'], 0);
         $pdf->Cell(70, 7, "Fecha: " . $pedido[$idx]['fecha'], 0);
         $pdf->Ln();
         $pdf->Ln();
         $pdf->Ln();
         $pdf->Cell(70, 7, "Nombre del producto", 1);
         $pdf->Cell(26, 7, "Cantidad", 1);
         $pdf->Cell(40, 7, "Precio", 1);
         $pdf->Ln();
         foreach ($pedido[$idx]['lineas'] as $linea) {
             $pdf->Cell(70, 7, $linea['Nombre'], 1);
             $pdf->Cell(26, 7, $linea['Cantidad'], 1);
             $pdf->Cell(40, 7, $linea['Precio'] . iconv('UTF-8', 'windows-1252', '€'), 1);
             $pdf->Ln();
             $total = $total + $linea['Precio'];
         }
         $pdf->Ln();
         $pdf->Ln();
         $pdf->Cell(100, 7, "Total del pedido: " . $total . iconv('UTF-8', 'windows-1252', '€'), 1);
         $pdf->Ln();
         $pdf->Ln();
         $pdf->Ln();
         $pdf->Cell(100, 7, "* Impuestos y descuento aplicados ", 0);
         // diferenciamos si va para mostrar en navegador o para guardar en local y posteriormente enviar por correo.
         if (isset($_SESSION['Fin_Compra'])) {
             $pdf->Output('F', 'asset/pedidos/pedido_' . $pedido[$idx]['codigo_pedido'] . ".pdf", true);
         } else {
             $pdf->Output('I', 'pedido : ' . $pedido[$idx]['codigo_pedido']);
         }
     }
 }
Example #6
0
 public function index()
 {
     if (strlen($this->getParam()) == 0) {
         App::redirectUrl($this->registry->router->generate('frontend.home', true));
     }
     $product = App::getModel('product/product')->getProductAndAttributesById((int) $this->registry->core->getParam());
     $range = App::getModel('product/product')->getRangeType((int) $this->registry->core->getParam());
     App::getModel('product/product')->getPhotos($product);
     if (empty($product)) {
         App::redirectUrl($this->registry->router->generate('frontend.home', true));
     }
     $product['photo']['normal'][0] = 'design/' . str_replace(DESIGNPATH, '', $product['photo']['normal'][0]);
     $selectAttributes = App::getModel('product/product')->getProductAttributeGroups($product);
     $attset = App::getModel('product/product')->getProductVariant($product);
     $this->registry->template->assign('product', $product);
     $this->registry->template->assign('attributes', $selectAttributes);
     $this->registry->template->assign('attset', $attset);
     $this->registry->template->assign('ROOTPATH', ROOTPATH);
     $htmlcontent = $this->registry->template->fetch($this->loadTemplate('index.tpl'));
     $pdf = new Pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true);
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Gekosale');
     $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, 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->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->setLanguageArray(1);
     $pdf->SetFont('dejavusans', '', 10);
     $pdf->AddPage();
     $pdf->writeHTML($htmlcontent, true, 0, true, 0);
     @ob_clean();
     $pdf->Output($product['seo'], 'D');
 }
$data = new Data();
session_start();
?>
 

  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
    <h4 class="modal-title" id="myModalLabel">Report</h4>
  </div>
  <div class="modal-body">	
    <h4 class="text-center">Click the button below to generate the daily sales report and inventory system</h4>
  </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);
Example #8
0
 public function MatricRollNoGroupwise()
 {
     // DebugBreak()  ;
     $this->load->helper('url');
     //Load the library
     $this->load->library('html2pdf');
     $grp_cd = $this->uri->segment(3);
     $sess = 1;
     $class = 10;
     $year = 2016;
     $this->load->library('session');
     $Logged_In_Array = $this->session->all_userdata();
     $user = $Logged_In_Array['logged_in'];
     //DebugBreak();
     $this->load->library('Pdf');
     $pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);
     $pdf->setHeaderData('', 0, '', '', array(0, 0, 0), array(255, 255, 255));
     $pdf->SetPrintHeader(false);
     $pdf->SetPrintFooter(false);
     $pdf->SetTitle('Matric Roll Number Slip');
     $pdf->SetHeaderMargin(1);
     $pdf->SetTopMargin(1);
     $pdf->setFooterMargin(1);
     $pdf->SetFont('helvetica', '', 8);
     $pdf->SetAutoPageBreak(TRUE, 0);
     $pdf->SetAuthor('BiseGrw');
     $pdf->SetMargins(4, 1, 4, true);
     $Inst_Id = $user['Inst_Id'];
     $this->load->model('RollNoSlip_model');
     // DebugBreak();
     $studeninfo = array('data' => $this->RollNoSlip_model->get10thrslipWith_Grp_CD($class, $year, $sess, $grp_cd, $Inst_Id));
     $template_pdf = '';
     $totalslips = count($studeninfo['data']['slip']);
     $studentslip = array();
     //DebugBreak();
     for ($i = 0; $i < count($studeninfo['data']['info']); $i++) {
         $pdf->AddPage();
         $rno = $studeninfo['data']['info'][$i]['Rno'];
         $temp = "{$rno}@{$class}@{$sess}@{$year}@{$Inst_Id}";
         $image = $this->set_barcode($temp);
         $studeninfo['data']['info'][$i]['barcode'] = $image;
         for ($j = 0; $j < $totalslips; $j++) {
             if ($rno == $studeninfo['data']['slip'][$j]['rno']) {
                 $studeninfo['data']['info'][$i]['slips'][] = $studeninfo['data']['slip'][$j];
             }
         }
         // DebugBreak();
         $html = $this->load->view('RollNoSlip/MatricRollNoCombine', $studeninfo['data']['info'][$i], true);
         $pdf->writeHTML($html, true, false, true, false, '');
         if ($i == 0) {
             break;
         }
     }
     $pdf->Output('pdfexample.pdf', 'I');
     //$this->html2pdf->html($this->load->view('RollNoSlip/MatricRollNoCombine', $studeninfo['data'], true));
     //  $this->html2pdf->html($template_pdf);
     /* if($this->html2pdf->create('downlaod')) {
        if($class == 10)
        redirect('RollNoSlip/TenthStd');
        else if($class == 9)
        redirect('RollNoSlip/NinthStd');
        }      */
 }
Example #9
0
 public function printAbstract($title = "", $vendorName, $total, $startDate, $endDate)
 {
     set_time_limit(0);
     $pdf = new Pdf("P", PDF_UNIT, "A4", true, 'UTF-8', false);
     $date = date('d-m-Y');
     $filename = $vendorName . "_" . $startDate . "_" . $endDate . "_" . $date;
     // set header and footer fonts
     // set margins
     $pdf->setTitle('');
     $pdf->Header();
     $pdf->Footer();
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT, true);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     //$pdf->SetMargins (15, 27, 15, true);
     $pdf->SetFont('times', '', 14);
     $pdf->SetAutoPageBreak(TRUE, 50);
     $pdf->AddPage();
     $pdf->Cell(0, 0, 'ENGINEERING COLLEGE HOSTELS', 0, 0, 'C');
     $pdf->Ln();
     $pdf->SetFont('times', '', 12);
     $pdf->Cell(0, 0, 'COLLEGE OF ENGINEERING, GUINDY', 0, 0, 'C');
     $pdf->Ln();
     $pdf->Cell(0, 0, 'ANNA UNIVERSITY, CHENNAI-25', 0, 0, 'C');
     $pdf->Ln();
     $pdf->SetFont('times', '', 14);
     $pdf->Cell(0, 0, 'ABSTRACT OF SUPPLIER\'S BILL', 0, 0, 'C');
     $pdf->Ln();
     $pdf->Ln();
     $pdf->SetFont('times', '', 14);
     $text = "BILL RECEIVED FROM " . $vendorName . " FOR THE SUPPLIES MADE";
     $pdf->Cell(0, 0, $text, 0, 0, 'L');
     if ($startDate == $endDate) {
         $text = "ON " . $startDate;
     } else {
         $text = "BETWEEN " . $startDate . " AND " . $endDate;
     }
     $pdf->Ln();
     $pdf->Cell(0, 0, $text, 0, 0, 'L');
     $pdf->SetFont('times', '', 12);
     $html = "";
     //create html
     $html .= '<html><head><title>Report</title>';
     $html .= '</head><body >';
     $base_path = base_url();
     $html .= '<style>tr,th{border: 1px solid black;}</style>';
     $html .= $_POST['toSend'];
     $html .= '</body></html>';
     $pdf->writeHTML($html, false, false, false, false, '');
     $inWords = $this->convert_number($total);
     $text = "BILL PASSED FOR RUPEES " . $inWords;
     $pdf->SetFont('times', '', 14);
     $pdf->Ln();
     $pdf->Cell(0, 0, $text, 0, 0, 'L');
     $pdf->Ln();
     $pdf->Ln();
     $pdf->Ln();
     $pdf->Ln();
     $pdf->Ln();
     $html = '<table><tr><th>Store Manager</th><th>Deputy Warden</th><th>Hostel Warden</th></tr></table>';
     $pdf->writeHTML($html, false, false, false, false, '');
     //	$pdf->Output('C:\xampp\htdocs\cegMessStore\reports\report.pdf', 'FD');  //save pdf
     if (strpos($title, "Vegetable") !== false) {
         $dir = "Vegetable Abstract/" . $filename . ".pdf";
     } else {
         $dir = "Items Abstract/" . $filename . ".pdf";
     }
     $pdf->Output("/var/www/cegMessStore/reports/" . $dir, 'FD');
     //save pdf
     //		$pdf->Output('file.pdf', 'I'); // show pdf
     return true;
 }
/**
* Generates statistics
*
* @param int $surveyid The survey id
* @param mixed $allfields
* @param mixed $q2show
* @param mixed $usegraph
* @param string $outputType Optional - Can be xls, html or pdf - Defaults to pdf
* @param string $pdfOutput Sets the target for the PDF output: DD=File download , F=Save file to local disk
* @param string $statlangcode Lamguage for statistics
* @param mixed $browse  Show browse buttons
* @return buffer
*/
function generate_statistics($surveyid, $allfields, $q2show = 'all', $usegraph = 0, $outputType = 'pdf', $pdfOutput = 'I', $statlangcode = null, $browse = true)
{
    global $pdfdefaultfont, $pdffontsize;
    $astatdata = array();
    //astatdata generates data for the output page's javascript so it can rebuild graphs on the fly
    //load surveytranslator helper
    Yii::import('application.helpers.surveytranslator_helper', true);
    $statisticsoutput = "";
    //This string carries all the actual HTML code to print.
    $imagedir = Yii::app()->getConfig("imagedir");
    $tempdir = Yii::app()->getConfig("tempdir");
    $tempurl = Yii::app()->getConfig("tempurl");
    $clang = Yii::app()->lang;
    $pdf = array();
    //Make sure $pdf exists - it will be replaced with an object if a $pdf is actually being created
    // Used for getting coordinates for google maps
    $agmapdata = array();
    //pick the best font file if font setting is 'auto'
    if (is_null($statlangcode)) {
        $statlangcode = getBaseLanguageFromSurveyID($surveyid);
    } else {
        $statlang = new Limesurvey_lang($statlangcode);
    }
    /*
     * this variable is used in the function shortencode() which cuts off a question/answer title
     * after $maxchars and shows the rest as tooltip (in html mode)
     */
    $maxchars = 13;
    //we collect all the html-output within this variable
    $statisticsoutput = '';
    /**
     * $outputType: html || pdf ||
     */
    /**
     * get/set Survey Details
     */
    //no survey ID? -> come and get one
    if (!isset($surveyid)) {
        $surveyid = returnGlobal('sid');
    }
    //Get an array of codes of all available languages in this survey
    $surveylanguagecodes = Survey::model()->findByPk($surveyid)->additionalLanguages;
    $surveylanguagecodes[] = Survey::model()->findByPk($surveyid)->language;
    $fieldmap = createFieldMap($surveyid, "full", false, false, $statlang->getlangcode());
    // Set language for questions and answers to base language of this survey
    $language = $statlangcode;
    if ($q2show == 'all') {
        $summarySql = " SELECT gid, parent_qid, qid, type " . " FROM {{questions}} WHERE parent_qid=0" . " AND sid={$surveyid} ";
        $summaryRs = Yii::app()->db->createCommand($summarySql)->query()->readAll();
        foreach ($summaryRs as $field) {
            $myField = $surveyid . "X" . $field['gid'] . "X" . $field['qid'];
            // Multiple choice get special treatment
            if ($field['type'] == "M") {
                $myField = "M{$myField}";
            }
            if ($field['type'] == "P") {
                $myField = "P{$myField}";
            }
            //numerical input will get special treatment (arihtmetic mean, standard derivation, ...)
            if ($field['type'] == "N") {
                $myField = "N{$myField}";
            }
            if ($field['type'] == "|") {
                $myField = "|{$myField}";
            }
            if ($field['type'] == "Q") {
                $myField = "Q{$myField}";
            }
            // textfields get special treatment
            if ($field['type'] == "S" || $field['type'] == "T" || $field['type'] == "U") {
                $myField = "T{$myField}";
            }
            //statistics for Date questions are not implemented yet.
            if ($field['type'] == "D") {
                $myField = "D{$myField}";
            }
            if ($field['type'] == "F" || $field['type'] == "H") {
                //Get answers. We always use the answer code because the label might be too long elsewise
                $query = "SELECT code, answer FROM {{answers}} WHERE qid='" . $field['qid'] . "' AND scale_id=0 AND language='{$language}' ORDER BY sortorder, answer";
                $result = Yii::app()->db->createCommand($query)->query();
                $counter2 = 0;
                //check all the answers
                foreach ($result->readAll() as $row) {
                    $row = array_values($row);
                    $myField = "{$myField}{$row[0]}";
                }
                //$myField = "{$surveyid}X{$flt[1]}X{$flt[0]}{$row[0]}[]";
            }
            if ($q2show == 'all') {
                $summary[] = $myField;
            }
            //$allfields[]=$myField;
        }
    } else {
        // This gets all the 'to be shown questions' from the POST and puts these into an array
        if (!is_array($q2show)) {
            $summary = returnGlobal('summary');
        } else {
            $summary = $q2show;
        }
        //print_r($_POST);
        //if $summary isn't an array we create one
        if (isset($summary) && !is_array($summary)) {
            $summary = explode("+", $summary);
        }
    }
    /**
     * pdf Config
     */
    if ($outputType == 'pdf') {
        //require_once('classes/tcpdf/config/lang/eng.php');
        global $l;
        $l['w_page'] = $statlang->gT("Page", 'unescaped');
        //require_once('classes/tcpdf/mypdf.php');
        Yii::import('application.libraries.admin.pdf', true);
        // create new PDF document
        $pdf = new Pdf();
        $pdf->SetFont($pdfdefaultfont, '', $pdffontsize);
        $surveyInfo = getSurveyInfo($surveyid, $language);
        // set document information
        $pdf->SetCreator(PDF_CREATOR);
        $pdf->SetAuthor('LimeSurvey');
        $pdf->SetTitle('Statistic survey ' . $surveyid);
        $pdf->SetSubject($surveyInfo['surveyls_title']);
        $pdf->SetKeywords('LimeSurvey, Statistics, Survey ' . $surveyid . '');
        $pdf->SetDisplayMode('fullpage', 'two');
        // set header and footer fonts
        $pdf->setHeaderFont(array($pdfdefaultfont, '', PDF_FONT_SIZE_MAIN));
        $pdf->setFooterFont(array($pdfdefaultfont, '', PDF_FONT_SIZE_DATA));
        // set default header data
        $pdf->SetHeaderData("statistics.png", 10, $statlang->gT("Quick statistics", 'unescaped'), $statlang->gT("Survey") . " " . $surveyid . " '" . flattenText($surveyInfo['surveyls_title'], false, true, 'UTF-8') . "'");
        // set default monospaced font
        $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
        //set margins
        $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
        $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
        $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
        //set auto page breaks
        $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
        //set image scale factor
        $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
        //set some language-dependent strings
        $pdf->setLanguageArray($l);
    }
    if ($outputType == 'xls') {
        /**
         * Initiate the Spreadsheet_Excel_Writer
         */
        Yii::import('application.libraries.admin.pear.Spreadsheet.Excel.Xlswriter', true);
        if ($pdfOutput == 'F') {
            $sFileName = $tempdir . '/statistic-survey' . $surveyid . '.xls';
            $workbook = new Xlswriter($sFileName);
        } else {
            $workbook = new Xlswriter();
        }
        $workbook->setVersion(8);
        // Inform the module that our data will arrive as UTF-8.
        // Set the temporary directory to avoid PHP error messages due to open_basedir restrictions and calls to tempnam("", ...)
        $workbook->setTempDir($tempdir);
        // Inform the module that our data will arrive as UTF-8.
        // Set the temporary directory to avoid PHP error messages due to open_basedir restrictions and calls to tempnam("", ...)
        if (!empty($tempdir)) {
            $workbook->setTempDir($tempdir);
        }
        if ($pdfOutput != 'F') {
            $workbook->send('statistic-survey' . $surveyid . '.xls');
        }
        // Creating the first worksheet
        $sheet =& $workbook->addWorksheet(utf8_decode('results-survey' . $surveyid));
        $sheet->setInputEncoding('utf-8');
        $sheet->setColumn(0, 20, 20);
        $separator = "~|";
        /**XXX*/
    }
    /**
     * Start generating
     */
    $selects = buildSelects($allfields, $surveyid, $language);
    //count number of answers
    $query = "SELECT count(*) FROM {{survey_{$surveyid}}}";
    //if incompleted answers should be filtert submitdate has to be not null
    if (incompleteAnsFilterState() == "inc") {
        $query .= " WHERE submitdate is null";
    } elseif (incompleteAnsFilterState() == "filter") {
        $query .= " WHERE submitdate is not null";
    }
    $result = Yii::app()->db->createCommand($query)->query();
    //$total = total number of answers
    $row = $result->read();
    $total = reset($row);
    //are there any filters that have to be taken care of?
    if (isset($selects) && $selects) {
        //filter incomplete answers?
        if (incompleteAnsFilterState() == "filter" || incompleteAnsFilterState() == "inc") {
            $query .= " AND ";
        } else {
            $query .= " WHERE ";
        }
        //add filter criteria to SQL
        $query .= implode(" AND ", $selects);
    }
    //get me some data Scotty
    $result = Yii::app()->db->createCommand($query)->query();
    //put all results into $results
    $row = $result->read();
    $results = reset($row);
    if ($total) {
        $percent = sprintf("%01.2f", $results / $total * 100);
    }
    switch ($outputType) {
        case "xls":
            $xlsRow = 0;
            $sheet->write($xlsRow, 0, $statlang->gT("Number of records in this query:", 'unescaped'));
            $sheet->write($xlsRow, 1, $results);
            ++$xlsRow;
            $sheet->write($xlsRow, 0, $statlang->gT("Total records in survey:", 'unescaped'));
            $sheet->write($xlsRow, 1, $total);
            if ($total) {
                ++$xlsRow;
                $sheet->write($xlsRow, 0, $statlang->gT("Percentage of total:", 'unescaped'));
                $sheet->write($xlsRow, 1, $percent . "%");
            }
            break;
        case 'pdf':
            // add summary to pdf
            $array = array();
            //$array[] = array($statlang->gT("Results"),"");
            $array[] = array($statlang->gT("Number of records in this query:", 'unescaped'), $results);
            $array[] = array($statlang->gT("Total records in survey:", 'unescaped'), $total);
            if ($total) {
                $array[] = array($statlang->gT("Percentage of total:", 'unescaped'), $percent . "%");
            }
            $pdf->addPage('P', 'A4');
            $pdf->Bookmark($pdf->delete_html($statlang->gT("Results", 'unescaped')), 0, 0);
            $pdf->titleintopdf($statlang->gT("Results", 'unescaped'), $statlang->gT("Survey", 'unescaped') . " " . $surveyid);
            $pdf->tableintopdf($array);
            $pdf->addPage('P', 'A4');
            break;
        case 'html':
            $statisticsoutput .= "<br />\n<table class='statisticssummary' >\n" . "\t<thead><tr><th colspan='2'>" . $statlang->gT("Results") . "</th></tr></thead>\n" . "\t<tr><th >" . $statlang->gT("Number of records in this query:") . '</th>' . "<td>{$results}</td></tr>\n" . "\t<tr><th>" . $statlang->gT("Total records in survey:") . '</th>' . "<td>{$total}</td></tr>\n";
            //only calculate percentage if $total is set
            if ($total) {
                $percent = sprintf("%01.2f", $results / $total * 100);
                $statisticsoutput .= "\t<tr><th align='right'>" . $statlang->gT("Percentage of total:") . '</th>' . "<td>{$percent}%</td></tr>\n";
            }
            $statisticsoutput .= "</table>\n";
            break;
        default:
            break;
    }
    //put everything from $selects array into a string connected by AND
    //This string ($sql) can then be passed on to other functions so you can
    //browse these results
    if (isset($selects) && $selects) {
        $sql = implode(" AND ", $selects);
    } elseif (!empty($newsql)) {
        $sql = $newsql;
    }
    if (!isset($sql) || !$sql) {
        $sql = "NULL";
    }
    //only continue if we have something to output
    if ($results > 0) {
        if ($outputType == 'html' && $browse === true) {
            //add a buttons to browse results
            $statisticsoutput .= "<form action='" . Yii::app()->getController()->createUrl("admin/responses/index/surveyid/{$surveyid}") . "' method='post' target='_blank'>\n" . "\t\t<p>" . "\t\t\t<input type='submit' value='" . $statlang->gT("Browse") . "'  />\n" . "\t\t\t<input type='hidden' name='sid' value='{$surveyid}' />\n" . "\t\t\t<input type='hidden' name='sql' value=\"{$sql}\" />\n" . "\t\t\t<input type='hidden' name='subaction' value='all' />\n" . "\t\t</p>" . "\t\t</form>\n";
        }
    }
    //end if (results > 0)
    /* Show Summary results
     * The $summary array contains each fieldname that we want to display statistics for
     *
     * */
    if (isset($summary) && $summary) {
        //let's run through the survey
        $runthrough = $summary;
        //START Chop up fieldname and find matching questions
        //loop through all selected questions
        foreach ($runthrough as $rt) {
            //Step 1: Get information about this response field (SGQA) for the summary
            $outputs = buildOutputList($rt, $language, $surveyid, $outputType, $sql, $statlang);
            $statisticsoutput .= $outputs['statisticsoutput'];
            //2. Collect and Display results #######################################################################
            if (isset($outputs['alist']) && $outputs['alist']) {
                $display = displayResults($outputs, $results, $rt, $outputType, $surveyid, $sql, $usegraph, $browse, $pdf, $statlang);
                $statisticsoutput .= $display['statisticsoutput'];
                $astatdata = array_merge($astatdata, $display['astatdata']);
            }
            //end if -> collect and display results
            //Delete Build Outputs data
            unset($outputs);
            unset($display);
        }
        // end foreach -> loop through all questions
        //output
        if ($outputType == 'html') {
            $statisticsoutput .= "<br />&nbsp;\n";
        }
    }
    //end if -> show summary results
    switch ($outputType) {
        case 'xls':
            $workbook->close();
            if ($pdfOutput == 'F') {
                return $sFileName;
            } else {
                return;
            }
            break;
        case 'pdf':
            $pdf->lastPage();
            if ($pdfOutput == 'F') {
                // This is only used by lsrc to send an E-Mail attachment, so it gives back the filename to send and delete afterwards
                $pdf->Output($tempdir . "/" . $statlang->gT('Survey') . '_' . $surveyid . "_" . $surveyInfo['surveyls_title'] . '.pdf', $pdfOutput);
                return $tempdir . "/" . $statlang->gT('Survey') . '_' . $surveyid . "_" . $surveyInfo['surveyls_title'] . '.pdf';
            } else {
                return $pdf->Output($statlang->gT('Survey') . '_' . $surveyid . "_" . $surveyInfo['surveyls_title'] . '.pdf', $pdfOutput);
            }
            break;
        case 'html':
            $statisticsoutput .= "<script type=\"text/javascript\" src=\"http://maps.googleapis.com/maps/api/js?sensor=false\"></script>\n" . "<script type=\"text/javascript\">var site_url='" . Yii::app()->baseUrl . "';var temppath='{$tempurl}';var imgpath='" . Yii::app()->getConfig('adminimageurl') . "';var aGMapData=" . ls_json_encode($agmapdata) . ";var aStatData=" . ls_json_encode($astatdata) . "</script>";
            return $statisticsoutput;
            break;
        default:
            return $statisticsoutput;
            break;
    }
}
    function export_pdf07()
    {
        $this->load->library('pdf');
        ob_clean();
        $pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);
        $tbl = '';
        $tbl .= '
				<h3><u>MASTER USER</u></h3>
				<table border="0"  cellpadding="0" cellspacing="0" >
				 <tr >';
        $tbl .= '<th  align="center" bgcolor="#359AFF" width="30" >NO</th>';
        $tbl .= '<th   valign="middle" bgcolor="#359AFF" width="200" >USER NAME</th>';
        $tbl .= '<th   valign="middle" bgcolor="#359AFF" width="250" >NAMA PEGAWAI</th>';
        $tbl .= '<th   valign="middle" bgcolor="#359AFF" width="180" >NAMA GROUP</th>';
        $tbl .= '<th   valign="middle" bgcolor="#359AFF" width="100" >AKTIF</th>';
        $tbl .= '</tr>';
        $sql = "select user_id,user_name,user_pwd,user_group_id, user_pegawai,if(user_aktif=1,'aktif','tidak aktif') st_user,user_aktif,group_id, group_nama from v_user where group_aktif=1";
        $data = $this->m_global->grid_view($sql)->result_array();
        $no = 1;
        foreach ($data as $row) {
            $bg = $no % 2;
            if ($bg == 0) {
                $bg = ' bgcolor="#E1F0FF" ';
            } else {
                $bg = ' bgcolor="#FFFFFF" ';
            }
            $tbl .= '
					<tr>
					<td ' . $bg . '  align="center" width="30">' . $no . '</td>';
            $tbl .= '<td ' . $bg . '  width="200" >' . $row['user_name'] . '</td>';
            $tbl .= '<td ' . $bg . '  width="250" >' . $row['user_pegawai'] . '</td>';
            $tbl .= '<td ' . $bg . '  width="180" >' . $row['group_nama'] . '</td>';
            $tbl .= '<td ' . $bg . '  width="100" >' . $row['st_user'] . '</td>';
            $tbl .= '</tr>';
            $no++;
        }
        $tbl .= '</table>';
        $pdf->AddPage();
        $pdf->SetFont('helvetica', '', 8);
        $pdf->writeHTML($tbl, true, false, false, false, '');
        $pdf->Output('example_048.pdf', 'I');
    }
Example #12
0
 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&Iacute;</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>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
	<p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
	<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
    <p>&nbsp;</p></td>
  </tr>
    <tr>
        <td style="text-align: right;" colspan="3">Pemeriksa, </td>
    </tr>
	<tr>
    <td><p>&nbsp;</p>
    <p>&nbsp;</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');
    }
Example #15
0
 public function generate_letter_support_pdf($arrData, $pData)
 {
     $this->load->model('setup_model');
     $letter = $this->setup_model->get_by(array('name' => 'Letter'));
     $ward_letter = $this->setup_model->get_by(array('name' => 'Ward Leader Letter'));
     $support_letter = $this->setup_model->get_by(array('name' => 'Letter of Support'));
     $this->load->library('pdf');
     $pdf = new Pdf('L', 'mm', 'LETTER', true, 'ISO-8859-1', false);
     $pdf->SetTitle($pData['brgy'] . '-LETTER-' . date("YmdHis"));
     $pdf->SetHeaderMargin(0);
     $pdf->SetTopMargin(10);
     $pdf->SetLeftMargin(20);
     $pdf->SetRightMargin(20);
     $pdf->setFooterMargin(10);
     $pdf->SetAutoPageBreak(true, 10);
     $pdf->SetFontSize(10);
     $pdf->SetAuthor('Author');
     // set font
     $pdf->SetFont('freeserif', '', 10);
     $ctr = 0;
     foreach ($arrData as $result) {
         if ($ctr % 2 == 0) {
             $pdf->AddPage('P', 'LEGAL');
             $pdf->setY(15);
         } else {
             $pdf->setY(190);
         }
         $result = (object) $result;
         $voter_name = explode(",", htmlentities($result->full_name));
         $html = "";
         $html .= "<br/>";
         $html .= '<b>' . trim(htmlentities($result->full_name)) . '</b>';
         $html .= "<br/>";
         $html .= '<b>' . trim($result->brgy) . '</b>';
         $html .= "<br/>";
         $html .= '<b>' . trim($result->precinct) . '</b>';
         $html .= "<br/>";
         $html .= "<br/>";
         $html .= 'Minamahal na <b>' . (trim($result->gender) == 'M' ? 'G.' : 'Bb/Gng.') . " " . ucfirst(trim(strtolower(htmlentities($voter_name[0])))) . ":</b>";
         $html .= "<br/>";
         //            $html .= $is_ward ? $ward_letter['content'] : $letter['content'];
         $html .= $support_letter['content'];
         $html .= "<br/>";
         $html .= '<table>' . '<tr>' . '<td width="60%"></td>' . '<td>Gumagalang, </td>' . '</tr>' . '<tr>' . '<td width="60%"></td>' . '</tr>' . '<tr>' . '<td width="50%" align="center"><b> <img src="' . base_url('assets/images/alexander_pajarillo_sign.jpg') . '" height="55" width="150"/></b></td>' . '<td width="50%" align="center"><b> <img src="' . base_url('assets/images/edgardo_tallado_sign.jpg') . '" height="55" width="150"/></b></td>' . '</tr>' . '<tr>' . '<td width="50%" align="center"><i>Mayor</i></td>' . '<td width="50%" align="center"><i>Governor</i></td>' . '</tr>' . '<tr>' . '<td width="60%"></td>' . '</tr>' . '<tr>' . '<td width="100%" align="center"><u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>' . trim(htmlentities($result->full_name)) . '</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</u></td>' . '</tr>' . '<tr>' . '<td width="100%" align="center">Lagda</td>' . '</tr>' . '</table>';
         $pdf->writeHTML($html, true, false, false, false, '');
         $ctr++;
         //            if($ctr == 1){
         //                $pdf->setY(100);
         //                $ctr = 0;
         //            }
     }
     $pdf->Output('letter.pdf', 'I');
     exit;
     pe($letter);
 }
Example #16
0
 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 pdf()
    {
        $data['matricula'] = $this->input->post('matricula');
        $data['nombre'] = $this->input->post('nombre');
        $data['paterno'] = $this->input->post('paterno');
        $data['materno'] = $this->input->post('materno');
        $data['fecha_carga'] = $this->input->post('fecha_carga');
        $data['id_archivo'] = $this->input->post('id_archivo');
        $data['curp'] = $this->input->post('curp');
        $data['correo'] = $this->input->post('correo');
        $data['tel'] = $this->input->post('tel');
        $data['institucion'] = $this->input->post('institucion');
        $data['plantel'] = $this->input->post('plantel');
        $data['grado'] = $this->input->post('grado');
        $data['turno'] = $this->input->post('turno');
        $data['promedio'] = $this->input->post('promedio');
        $data['modalidad'] = $this->input->post('sistema');
        $data['padre'] = $this->input->post('padre');
        $data['madre'] = $this->input->post('madre');
        $data['ecivil'] = $this->input->post('e_civil');
        $data['sexo'] = $this->input->post('sexo');
        $data['fecha_nac'] = $this->input->post('fecha_nac');
        //$data['']= $this->input->post('');
        $data['cel'] = $this->input->post('cel');
        if ($data['cel'] == '') {
            $data['cel'] = '----';
        }
        $data['calle'] = $this->input->post('calle');
        if ($data['calle'] == '') {
            $data['calle'] = '----';
        }
        $data['noext'] = $this->input->post('noext');
        if ($data['noext'] == '') {
            $data['noext'] = '----';
        }
        $data['noint'] = $this->input->post('noint');
        if ($data['noint'] == '') {
            $data['noint'] = '----';
        }
        $data['manzana'] = $this->input->post('manzana');
        if ($data['manzana'] == '') {
            $data['manzana'] = '----';
        }
        $data['lote'] = $this->input->post('lote');
        if ($data['lote'] == '') {
            $data['lote'] = '----';
        }
        $data['noedif'] = $this->input->post('noedif');
        if ($data['noedif'] == '') {
            $data['noedif'] = '----';
        }
        $data['nodpto'] = $this->input->post('nodpto');
        if ($data['nodpto'] == '') {
            $data['nodpto'] = '----';
        }
        $data['andador'] = $this->input->post('andador');
        if ($data['andador'] == '') {
            $data['andador'] = '----';
        }
        $data['rampa'] = $this->input->post('rampa');
        if ($data['rampa'] == '') {
            $data['rampa'] = '----';
        }
        $data['pasillo'] = $this->input->post('pasillo');
        if ($data['pasillo'] == '') {
            $data['pasillo'] = '----';
        }
        $data['villa'] = $this->input->post('villa');
        if ($data['villa'] == '') {
            $data['villa'] = '----';
        }
        $data['entrada'] = $this->input->post('entrada');
        if ($data['entrada'] == '') {
            $data['entrada'] = '----';
        }
        $data['colonia'] = $this->input->post('colonia');
        if ($data['colonia'] == '') {
            $data['colonia'] = '----';
        }
        $data['delegacion'] = $this->input->post('delegacion');
        if ($data['delegacion'] == '') {
            $data['delegacion'] = '----';
        }
        $data['cp'] = $this->input->post('cp');
        if ($data['cp'] == '') {
            $data['cp'] = '----';
        }
        $this->load->library('Pdf');
        $pdf = new Pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
        $pdf->SetCreator(PDF_CREATOR);
        $pdf->SetAuthor('Cony Jaramillo');
        $pdf->SetTitle('Documentos Prepa Si');
        $pdf->SetSubject('Reimpresión de Documentos');
        $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
        ob_start();
        //remove default header/footer
        $pdf->setPrintHeader(false);
        $pdf->setPrintFooter(false);
        // set default header data
        // set margins
        $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
        $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
        //$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
        // set image scale factor
        $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
        // set some language-dependent strings (optional)
        if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
            require_once dirname(__FILE__) . '/lang/eng.php';
            $pdf->setLanguageArray($l);
        }
        ///////////////////////////////////////////////////---------------///////////////////////////////////////////////////
        ///////////////////////////////////////////////////FORMATO ENTREGA///////////////////////////////////////////////////
        ///////////////////////////////////////////////////---------------///////////////////////////////////////////////////
        // establecer el modo de fuente por defecto
        $pdf->setFontSubsetting(true);
        // Establecer el tipo de letra
        $pdf->SetFont('helvetica', '', 10);
        //Normal
        $arriba = 6;
        $izq = 10;
        $der = 10;
        $pdf->AddPage('L', 'LETTER');
        $pdf->SetFont('pdfahelvetica', '', 10);
        //Normal
        //$pdf->SetFont('pdfahelveticai', '', 10); // S
        $pdf->SetTextColor(0, 0, 0);
        $style = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,20,5,10', 'phase' => 10, 'color' => array(255, 0, 0));
        $style2 = array('width' => 0.2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0));
        $style3 = array('width' => 0.2, 'cap' => 'round', 'join' => 'round', 'dash' => '2,10', 'color' => array(0, 0, 0));
        $style4 = array('L' => 0, 'T' => array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => '20,10', 'phase' => 10, 'color' => array(100, 100, 255)), 'R' => array('width' => 0.5, 'cap' => 'round', 'join' => 'miter', 'dash' => 0, 'color' => array(50, 50, 127)), 'B' => array('width' => 0.75, 'cap' => 'square', 'join' => 'miter', 'dash' => '30,10,5,10'));
        $style5 = array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 64, 128));
        $style6 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,10', 'color' => array(0, 128, 0));
        $style7 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 128, 0));
        # Marco
        //$pdf->RoundedRect(5, 15-$arriba, 268, 200, 0, '1010', 'NULL');
        $pdf->RoundedRect(12, 15 - $arriba, 120, 200, 0, '1000', 'NULL');
        $pdf->RoundedRect(23 + 125, 15 - $arriba, 120, 200, 0, '1000', 'NULL');
        # Linea encabezado
        //$pdf->Line(15, 44, 264.4, 44, $style2);
        # Linea media punteada
        $pdf->Line(140, 5 - $arriba, 140, 210 + $arriba, $style3);
        # Logos de Encabezado
        $pdf->Image('resources/img/cdmx.png', 85 - $izq, 20 - $arriba, 50, 13, 'PNG', '', '', true, 100, '', false, false, 0, false, false, false);
        # Textos
        $pdf->Text(60 - $izq, 10 - $arriba, 'Formato para Prepa Sí');
        $pdf->SetFont('pdfahelveticab', '', 9);
        // Negrita
        $pdf->Text(35 - $izq, 40 - $arriba, 'Entrega – Recepción Documentos PREPA SÍ 2015-2016');
        $pdf->SetFont('pdfahelvetica', '', 9);
        // Normal
        $pdf->SetLineStyle(array('width' => 0.2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
        $pdf->RoundedRect(34 - $izq, 39 - $arriba, 87, 6, 3, '0000', 'NULL');
        $pdf->Text(44 - $izq, 51 - $arriba, 'Fecha de registro electrónico: ___________________');
        $pdf->Text(27 - $izq, 62 - $arriba, 'Nombre: ____________________________________________________');
        $pdf->Text(27 - $izq, 72 - $arriba, '1.- Solicitud de');
        $pdf->RoundedRect(126 - $izq, 72 - $arriba, 8, 5, 3, '0000', 'NULL');
        $pdf->Text(27 - $izq, 80 - $arriba, '2.- Comprobante de domicilio, expedido dentro de los 3 meses');
        $pdf->Text(33 - $izq, 84 - $arriba, 'anteriores al mes en el que se realice la entrega de los');
        $pdf->Text(33 - $izq, 88 - $arriba, 'documentos (copia y original para cotejo):.....................................');
        $pdf->RoundedRect(126 - $izq, 88 - $arriba, 8, 5, 3, '0000', 'NULL');
        $pdf->Text(27 - $izq, 96 - $arriba, '3.- Comprobante de Inscripcion (vigente), sellado por tu');
        $pdf->Text(32 - $izq, 100 - $arriba, ' institución educativa (copia y original para cotejo):........................');
        $pdf->RoundedRect(126 - $izq, 100 - $arriba, 8, 5, 3, '0000', 'NULL');
        $pdf->Text(27 - $izq, 108 - $arriba, '4.- Comprobante de calificaciones vigente y sellado');
        $pdf->Text(32 - $izq, 112 - $arriba, '(copia y original para cotejo):...........................................................');
        $pdf->RoundedRect(126 - $izq, 112 - $arriba, 8, 5, 3, '0000', 'NULL');
        $pdf->Text(27 - $izq, 120 - $arriba, '5.- Identificación con fotografia (copia y original para cotejo):..............');
        $pdf->RoundedRect(126 - $izq, 121 - $arriba, 8, 5, 3, '0000', 'NULL');
        $pdf->Text(48 - $izq, 167 - $arriba, 'Fecha de recepción de expediente: ___________________');
        $pdf->Text(115 - $izq, 171 - $arriba, 'día/mes/año');
        $pdf->SetFont('pdfahelveticab', '', 8);
        //Negrita
        $pdf->Rect(25 - $izq, 161 + 15 - $arriba, 115, 16, 'DF', null, array(192, 192, 192));
        $pdf->Text(25 - $izq, 161 + 15 - $arriba, 'Tus documentos y datos, seran revisados en oficinas centrales. Si se detecta alguna');
        $pdf->Text(25 - $izq, 165 + 15 - $arriba, 'inconsistencia no procederá tu tramite en tanto no regularices la situación. Te lo');
        $pdf->Text(25 - $izq, 169 + 15 - $arriba, 'notificaremos vía correo electrónico, por lo que consúltalo regularmente, ya que de');
        $pdf->Text(25 - $izq, 173 + 15 - $arriba, 'no regularizarlo no podremos incorporarte al programa.');
        $pdf->SetFont('pdfahelvetica', '', 9);
        // Normal
        $pdf->endLayer();
        //***********************************************************hoja 2**********************************************************//////////
        # Logos de Encabezado
        $pdf->Image('resources/img/cdmx.png', 117 + 85 + $der, 20 - $arriba, 50, 13, 'PNG', '', '', true, 100, '', false, false, 0, false, false, false);
        # Textos
        $pdf->Text(127 + 55 + $der, 10 - $arriba, 'Formato para el Beneficiario');
        $pdf->SetFont('pdfahelveticab', '', 9);
        // Negrita
        $pdf->Text(114 + 45 + $der, 40 - $arriba, 'Entrega – Recepción Documentos PREPA SÍ 2015-2016');
        $pdf->SetFont('pdfahelvetica', '', 9);
        // Normal
        $pdf->SetLineStyle(array('width' => 0.2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
        $pdf->RoundedRect(158 + $der, 39 - $arriba, 87, 6, 3, '0000', 'NULL');
        $pdf->Text(115 + 50 + $der, 51 - $arriba, 'Fecha de registro electrónico: ___________________');
        $pdf->Text(115 + 27 + $der, 62 - $arriba, 'Nombre: ____________________________________________________');
        $pdf->Text(115 + 27 + $der, 72 - $arriba, '1.- Solicitud de');
        $pdf->RoundedRect(105 + 136 + $der, 72 - $arriba, 8, 5, 3, '0000', 'NULL');
        $pdf->Text(115 + 27 + $der, 80 - $arriba, '2.- Comprobante de domicilio, expedido dentro de los 3 meses');
        $pdf->Text(115 + 33 + $der, 84 - $arriba, 'anteriores al mes en el que se realice la entrega de los');
        $pdf->Text(115 + 33 + $der, 88 - $arriba, 'documentos (copia y original para cotejo):.....................................');
        $pdf->RoundedRect(105 + 136 + $der, 88 - $arriba, 8, 5, 3, '0000', 'NULL');
        $pdf->Text(115 + 27 + $der, 96 - $arriba, '3.- Comprobante de Inscripcion (vigente), sellado por tu');
        $pdf->Text(115 + 32 + $der, 100 - $arriba, 'institución educativa (copia y original para cotejo):.........................');
        $pdf->RoundedRect(105 + 136 + $der, 100 - $arriba, 8, 5, 3, '0000', 'NULL');
        $pdf->Text(115 + 27 + $der, 108 - $arriba, '4.- Comprobante de calificaciones vigente y sellado');
        $pdf->Text(115 + 32 + $der, 112 - $arriba, '(copia y original para cotejo):...........................................................');
        $pdf->RoundedRect(105 + 136 + $der, 112 - $arriba, 8, 5, 3, '0000', 'NULL');
        $pdf->Text(115 + 27 + $der, 120 - $arriba, '5.- Identificación con fotografia (copia y original para cotejo):..............');
        $pdf->RoundedRect(105 + 136 + $der, 121 - $arriba, 8, 5, 3, '0000', 'NULL');
        $pdf->Text(110 + 55 + $der, 167 - $arriba, 'Fecha de recepción de expediente: ___________________');
        $pdf->Text(110 + 122 + $der, 171 - $arriba, 'día/mes/año');
        if ($data['id_archivo'] == 1) {
            $pdf->SetFont('pdfahelvetica', '', 9);
            //$pdf->Text(17, 148+16, 'Entregó expediente _____________________________      ____________');
            $pdf->Text(27 - $izq, 128 + 17 - $arriba, 'Entregó expediente _____________________________     ____________');
            $pdf->SetFont('pdfahelvetica', '', 8);
            $pdf->Text(78 - $izq, 132 + 17 - $arriba, 'Nombre');
            $pdf->Text(118 - $izq, 132 + 17 - $arriba, 'Firma');
            $pdf->SetFont('pdfahelvetica', '', 9);
            //$pdf->Text(17, 136+16, 'Recibió / Cotejó: _______________________________      ____________');
            $pdf->Text(27 - $izq, 140 + 16 - $arriba, 'Recibió / Cotejó: _______________________________     ____________');
            $pdf->SetFont('pdfahelvetica', '', 8);
            $pdf->Text(78 - $izq, 146 + 14 - $arriba, 'Nombre');
            $pdf->Text(118 - $izq, 146 + 14 - $arriba, 'Firma');
            $pdf->SetFont('pdfahelvetica', '', 9);
            //$pdf->Text(124+17, 148+16, 'Entregó expediente _____________________________      ____________');
            $pdf->Text(27 + 115 + $der, 128 + 17 - $arriba, 'Entregó expediente _____________________________     ____________');
            $pdf->SetFont('pdfahelvetica', '', 8);
            $pdf->Text(78 + 115 + $der, 132 + 17 - $arriba, 'Nombre');
            $pdf->Text(118 + 115 + $der, 132 + 17 - $arriba, 'Firma');
            $pdf->SetFont('pdfahelvetica', '', 9);
            //$pdf->Text(124+17, 136+16, 'Recibió / Cotejó: _______________________________      ____________');
            $pdf->Text(27 + 115 + $der, 140 + 16 - $arriba, 'Recibió / Cotejó: _______________________________     ____________');
            $pdf->SetFont('pdfahelvetica', '', 8);
            $pdf->Text(78 + 115 + $der, 144 + 16 - $arriba, 'Nombre');
            $pdf->Text(118 + 115 + $der, 144 + 16 - $arriba, 'Firma');
        } else {
            $pdf->Text(27 - $izq, 136 - $arriba, 'Entregó expediente _____________________________     ____________');
            $pdf->Text(78 - $izq, 140 - $arriba, 'Nombre');
            $pdf->Text(118 - $izq, 140 - $arriba, 'Firma');
            $pdf->Text(27 - $izq, 149 + 3 - $arriba, 'Recibió / Cotejó: _______________________________     ____________');
            $pdf->Text(78 - $izq, 154 + 3 - $arriba, 'Nombre');
            $pdf->Text(118 - $izq, 154 + 3 - $arriba, 'Firma');
            $pdf->Text(27 + 115 + $der, 136 - $arriba, 'Entregó expediente _____________________________     ____________');
            $pdf->Text(78 + 115 + $der, 140 - $arriba, 'Nombre');
            $pdf->Text(118 + 115 + $der, 140 - $arriba, 'Firma');
            $pdf->Text(27 + 115 + $der, 149 + 3 - $arriba, 'Recibió / Cotejó: _______________________________     ____________');
            $pdf->Text(78 + 115 + $der, 154 + 3 - $arriba, 'Nombre');
            $pdf->Text(118 + 115 + $der, 154 + 3 - $arriba, 'Firma');
        }
        $pdf->SetFont('pdfahelveticab', '', 8);
        //Negrita
        $pdf->Rect(125 + 16 + $der, 161 + 15 - $arriba, 115, 16, 'DF', null, array(192, 192, 192));
        //$pdf->Rect(25-$izq, 163+15-$arriba, 115, 16, 'DF', null, array(192,192,192));
        $pdf->Text(125 + 16 + $der, 161 + 15 - $arriba, 'Tus documentos y datos, seran revisados en oficinas centrales. Si se detecta alguna');
        $pdf->Text(125 + 16 + $der, 165 + 15 - $arriba, 'inconsistencia no procederá tu tramite en tanto no regularices la situación. Te lo');
        $pdf->Text(125 + 16 + $der, 169 + 15 - $arriba, 'notificaremos vía correo electrónico, por lo que consúltalo regularmente, ya que de');
        $pdf->Text(125 + 16 + $der, 173 + 15 - $arriba, 'no regularizarlo no podremos incorporarte al programa.');
        $pdf->Text(125 - $izq, 189, 'F-1516-01');
        $pdf->Text(125 + 116 + $der, 189, 'F-1516-01');
        $pdf->SetFont('pdfahelvetica', '', 9);
        // Normal
        ///////////////////////////////////////////////////////
        //	Datos de ENTREGA RECEPCION DE DOCUMENTOS
        ///////////////////////////////////////////////////////
        $pdf->SetFont('pdfahelvetica', '', 9);
        // Normal
        if ($data['id_archivo'] == 1) {
            $tramite = "Inscripción";
            $puntos = "................................................";
            $pdf->Text(27 - $izq, 128 - $arriba, '6.- Número de Monedero Electrónico (Tarjeta Prepa Sí):');
            $pdf->Text(118 + 24 + $der, 128 - $arriba, '6.- Número de Monedero Electrónico (Tarjeta Prepa Sí):');
            $pdf->Line(27 - $izq, 140 - $arriba, 126, 140 - $arriba, $style2);
            $pdf->Line(120 + 24 + $der, 140 - $arriba, 145 + 116, 140 - $arriba, $style2);
            //	$pdf->RoundedRect(20, 128, 60, 5, 3, '0000', 'NULL');
            $pdf->SetFont('pdfahelvetica', '', 9);
            $pdf->Text(27 - $izq, 140 + 9 - $arriba, 'y Recibió Tarjeta');
            $pdf->Text(124 + 18 + $der, 140 + 9 - $arriba, 'y Recibió Tarjeta');
        }
        if ($data['id_archivo'] == 2) {
            $tramite = "Reinscripción";
            $puntos = "............................................";
        }
        if ($data['id_archivo'] == 3) {
            $tramite = "Universitario";
            $puntos = "..............................................";
        }
        $estilo = array('padding' => 'auto');
        //Negrita
        $pdf->SetFont('pdfahelveticab', '', 8);
        $pdf->Text(87 - $izq, 51 - $arriba, fecha_con_letra($data['fecha_carga']));
        $pdf->SetFont('pdfahelveticab', '', 9);
        $pdf->Text(42 - $izq, 62 - $arriba, $data['paterno'] . ' ' . $data['materno'] . ' ' . $data['nombre']);
        $pdf->SetFont('pdfahelvetica', '', 9);
        $pdf->Text(49 - $izq, 72 - $arriba, $tramite . ' (impresión):' . $puntos);
        $pdf->SetFont('pdfahelveticab', '', 8);
        $pdf->Text(65, 192, $data['matricula']);
        $pdf->endLayer();
        $pdf->Text(124 + 84 + $der, 45, fecha_con_letra($data['fecha_carga']));
        $pdf->Text(124 + 32 + $der, 62 - $arriba, $data['paterno'] . ' ' . $data['materno'] . ' ' . $data['nombre']);
        $pdf->SetFont('pdfahelvetica', '', 9);
        $pdf->Text(164 + $der, 72 - $arriba, $tramite . ' (impresión):' . $puntos);
        $pdf->SetFont('pdfahelveticab', '', 8);
        $pdf->Text(124 + 70 + $der, 192, $data['matricula']);
        $pdf->endLayer();
        $pdf->write1DBarcode($data['matricula'], 'C128', 65 - $izq, 184, 50, 10, 0.4, $estilo, 'N');
        $pdf->Image('resources/img/logo_fide_ps.jpg', 26 - $izq, 187, 21, 8, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        $pdf->write1DBarcode($data['matricula'], 'C128', 112 + 70 + $der, 184, 50, 10, 0.4, $estilo, 'N');
        $pdf->Image('resources/img/logo_fide_ps.jpg', 125 + 18 + $der, 187, 21, 8, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        ///////////////////////////////////////////////////---------------///////////////////////////////////////////////////
        ///////////////////////////////////////////////////DATOS PERSONALES//////////////////////////////////////////////////
        ///////////////////////////////////////////////////---------------///////////////////////////////////////////////////
        $bajar = 3;
        $pdf->AddPage('P', 'LETTER');
        //$fontname = $pdf->addTTFfont('./font/DejaVuSans.ttf', 'TrueTypeUnicode', '', 32);
        //$pdf->SetFont('dejavusans', '', 10);
        //$pdf->SetFont('pdfahelveticab', '', 10); //Negrita
        $pdf->SetFont('pdfahelvetica', '', 9);
        //Normal
        //$pdf->SetFont('pdfahelveticai', '', 10); // S
        $pdf->SetTextColor(0, 0, 0);
        $style = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,20,5,10', 'phase' => 10, 'color' => array(255, 0, 0));
        $style2 = array('width' => 0.2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0));
        $style3 = array('width' => 0.5, 'cap' => 'round', 'join' => 'round', 'dash' => '2,10', 'color' => array(0, 0, 0));
        $style4 = array('L' => 0, 'T' => array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => '20,10', 'phase' => 10, 'color' => array(100, 100, 255)), 'R' => array('width' => 0.5, 'cap' => 'round', 'join' => 'miter', 'dash' => 0, 'color' => array(50, 50, 127)), 'B' => array('width' => 0.75, 'cap' => 'square', 'join' => 'miter', 'dash' => '30,10,5,10'));
        $style5 = array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 64, 128));
        $style6 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,10', 'color' => array(0, 128, 0));
        $style7 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 128, 0));
        # Imagenes del Encabezado
        //-$pdf->Image('../images/angel2.jpg', 15, 6, 23, 23, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        //-$pdf->Image('../images/fideicomiso.jpg', 38, 6, 23, 23, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        //-$pdf->Image('../images/prepasi.png', 180, 6, 21, 23, 'PNG', '', '', true, 100, '', false, false, 0, false, false, false);
        $pdf->Image('resources/img/cdmx.png', 153, 8, 50, 13, 'PNG', '', '', true, 100, '', false, false, 0, false, false, false);
        //$pdf->SetFontSize(7);
        $pdf->SetFont('pdfahelvetica', '', 7);
        //Normal
        // create some HTML content
        $html = '
		
<div align="justify"><br /><br /><br /><br /><br /><br />
  <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td><div align="justify">Yo ' . $data['nombre'] . " " . $data['paterno'] . " " . $data['materno'] . ' declaro bajo protesta o exhorto de decir verdad que <b>NO CUENTO CON OTRA BECA </b>y/o ayuda igual o similar a la que por este   medio pido me otorgue <b>Prepa Sí</b> (FIDEGAR). <br />
        <br />
        <br />
        <br />
      Así mismo, manifiesto mi voluntad de contribuir con el programa Prepa Sí, para lo cual estoy dispuesto y <b>ME COMPROMETO A PARTICIPAR EN ACTIVIDADES EN COMUNIDAD </b>durante el periodo en el que el estímulo me sea otorgado. </div></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
    <br />
  </table>
  <p><br />
    <br /><br /><br /><br />
    Los datos personales recabados serán protegidos, incorporados y tratados en el sistema denominado Sistema de Datos Personales del Programa <b>Prepa Sí</b> del Fideicomiso Educación Garantizada del Distrito Federal (FIDEGAR), lo cual se funda en los artículos 6, 7 y demás relativos de la Ley de Protección de Datos Personales para el D. F, con el  fin de verificar que se cumplan las Reglas de Operación del Programa e integrar la base de datos de los beneficiarios de éste.
    <br /><br />
    Los datos marcados con asterisco (*) son obligatorios. Sin ellos no podrás acceder al Programa. Tus datos no podrán ser difundidos sin tu conocimiento expreso, salvo la excepciones previstas en la Ley.  La responsable del Sistema de Datos Personales es Mónica Pérez Egüis, Subdirectora de Control de Entregas e Incidencias. El lugar  donde podrás ejercer los derechos de acceso, rectificación, cancelación y oposición, así como la renovación del consentimiento es la Oficina de Información Pública del FIDEGAR, ubicada en Ejército Nacional N° 359, Col. Granada, Delegación Miguel Hidalgo, D.F. C.P.11520. <b>Tel. 11021730 ext.4079. Pág. web: www.fideicomisoed.df.gob.mx y e-mail oip@fideicomisoed.df.gob.mx. </b>El interesado podrá dirigirse al Instituto de Acceso a la Información Pública del D. F., donde recibirá asesoría sobre los derechos que tutela la Ley de Protección de Datos Personales, al tel.56534636; correo  datos.personales@infodf.org.mx o www.infodf.org.mx. En tal virtud, con base en el art. 16 de la Ley de Protección de Datos Personales para el D. F. <b>otorgo mi consentimiento para que mis datos personales tengan un tratamiento sólo para los fines del Programa Prepa Sí </b>durante el tiempo en cual me encuentre inscrito(a).<br>
    <br>
    <br>
  <em>
  <br>
  </em></p>
</div>
<div align="center"><em><br>Este programa es de carácter público, no es patrocinado ni promovido por partido político alguno y  sus recursos provienen de los impuestos que pagan todos los contribuyentes. Está  prohibido el uso de este programa con fines políticos, electorales, de lucro y  otros distintos a los establecidos. Quien haga uso indebido de los recursos de  este programa en el Distrito Federa, será sancionado de acuerdo con la ley  aplicable y ante la autoridad competente</em></div>
		
		
';
        // output the HTML content
        $pdf->writeHTML($html, true, 0, true, 0);
        ##############################################################################
        # SOLICITUD DE INSCRIPCIÓN
        ##############################################################################
        $pdf->SetFont('pdfahelveticab', '', 9);
        //Negrita
        $pdf->Text(15, 8, 'GOBIERNO DEL DISTRITO FEDERAL');
        $pdf->Text(15, 12, 'FIDEICOMISO EDUCACIÓN GARANTIZADA');
        $pdf->Text(15, 16, 'PROGRAMA DE ESTÍMULOS PARA EL BACHILLERATO UNIVERSAL');
        if ($data['id_archivo'] == 1) {
            $tipo = "INSCRIPCION";
        }
        if ($data['id_archivo'] == 2) {
            $tipo = "REINSCRIPCION";
        }
        if ($data['id_archivo'] == 3) {
            $tipo = "UNIVERSITARIO";
        }
        $pdf->Text(88, 20, 'SOLICITUD DE ' . $tipo . '');
        $pdf->SetFont('pdfahelvetica', '', 10);
        //Normal
        $pdf->SetFontSize(10);
        $pdf->Text(15, 25, 'FECHA DE TRAMITE:');
        $pdf->RoundedRect(55, 25, 50, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(150, 25, 51, 5, 3, '0000', 'NULL');
        $pdf->SetFontSize(7);
        $pdf->Text(170, 30, '*CURP');
        $pdf->SetFontSize(10);
        $pdf->SetTextColor(0, 100, 50, 0);
        $pdf->Text(15, 31, '1.- IDENTIFICACIÓN:');
        $pdf->SetTextColor(0, 0, 0, 100);
        $pdf->RoundedRect(15, 36, 60, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(78, 36, 60, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(141, 36, 60, 5, 3, '0000', 'NULL');
        $pdf->SetFontSize(7);
        $pdf->Text(34, 41, '*Apellido Paterno');
        $pdf->Text(95, 41, '*Apellido Materno');
        $pdf->Text(165, 41, '*Nombre(s)');
        $pdf->RoundedRect(15, 45, 60, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(78, 45, 60, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(141, 45, 60, 5, 3, '0000', 'NULL');
        $pdf->SetFontSize(7);
        $pdf->Text(34, 50, '*Correo electrónico');
        $pdf->Text(96, 50, '*Teléfono particular');
        $pdf->Text(163, 50, '*Teléfono celular');
        $pdf->RoundedRect(15, 54, 90, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(110, 54, 90, 5, 3, '0000', 'NULL');
        $pdf->SetFontSize(7);
        $pdf->Text(38, 59, 'Nombre del padre');
        $pdf->Text(114, 59, 'Nombre de la madre');
        $pdf->SetFontSize(10);
        $pdf->SetTextColor(0, 100, 50, 0);
        $pdf->Text(15, 57 + $bajar + 2, '2.- DOMICILIO:');
        $pdf->SetTextColor(0, 0, 0, 100);
        $pdf->RoundedRect(15, 62 + $bajar + 2, 96, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(112, 62 + $bajar + 2, 17, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(130, 62 + $bajar + 2, 17, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(148, 62 + $bajar + 2, 17, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(166, 62 + $bajar + 2, 17, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(184, 62 + $bajar + 2, 17, 5, 3, '0000', 'NULL');
        $pdf->SetFontSize(7);
        $pdf->Text(60, 67 + $bajar + 2, '*Calle');
        $pdf->Text(111, 67 + $bajar + 2, '*No Exterior');
        $pdf->Text(131, 67 + $bajar + 2, 'No Interior');
        $pdf->Text(150, 67 + $bajar + 2, 'Manzana');
        $pdf->Text(171, 67 + $bajar + 2, 'Lote');
        $pdf->Text(185, 67 + $bajar + 2, 'No Edificio');
        $pdf->RoundedRect(15, 72 + $bajar + 2, 16, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(32, 72 + $bajar + 2, 16, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(49, 72 + $bajar + 2, 16, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(66, 72 + $bajar + 2, 16, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(83, 72 + $bajar + 2, 16, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(100, 72 + $bajar + 2, 16, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(117, 72 + $bajar + 2, 84, 5, 3, '0000', 'NULL');
        $pdf->Text(16, 77 + $bajar + 2, 'No Depto');
        $pdf->Text(33, 77 + $bajar + 2, 'Andador');
        $pdf->Text(51, 77 + $bajar + 2, 'Rampa');
        $pdf->Text(69, 77 + $bajar + 2, 'Pasillo');
        $pdf->Text(87, 77 + $bajar + 2, 'Villa');
        $pdf->Text(102, 77 + $bajar + 2, 'Entrada');
        $pdf->Text(152, 77 + $bajar + 2, '*Colonia');
        $pdf->RoundedRect(15, 82 + $bajar + 2, 86, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(102, 82 + $bajar + 2, 25, 5, 3, '0000', 'NULL');
        $pdf->Text(51, 87 + $bajar + 2, '*Delegacion');
        $pdf->Text(104, 87 + $bajar + 2, '*Código Postal');
        //$pdf->RoundedRect(15, 69, 95, 4, 3, '0000', 'NULL');
        $pdf->SetFontSize(10);
        $pdf->SetTextColor(0, 100, 50, 0);
        $pdf->Text(15, 92 + $bajar + 2, '3.- DATOS ESCOLARES:');
        $pdf->SetTextColor(0, 0, 0, 100);
        $pdf->RoundedRect(15, 97 + $bajar + 2, 95, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(111, 97 + $bajar + 2, 90, 5, 3, '0000', 'NULL');
        $pdf->SetFontSize(7);
        $pdf->Text(51, 102 + $bajar + 2, '*Institución');
        $pdf->Text(155, 102 + $bajar + 2, '*Plantel');
        $pdf->RoundedRect(15, 107 + $bajar + 2, 67, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(83, 107 + $bajar + 2, 40, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(124, 107 + $bajar + 2, 46, 5, 3, '0000', 'NULL');
        $pdf->RoundedRect(171, 107 + $bajar + 2, 30, 5, 3, '0000', 'NULL');
        $pdf->Text(47, 112 + $bajar + 2, 'Grado');
        $pdf->Text(98, 112 + $bajar + 2, 'Turno');
        $pdf->Text(139, 112 + $bajar + 2, 'Modalidad');
        $pdf->Text(179, 112 + $bajar + 2, 'Promedio');
        $pdf->SetFont('pdfahelveticab', '', 9);
        //Negrita
        $pdf->Text(35, 117 + $bajar, 'La inscripción al Programa de Estímulos para el Bachillerato Universal (en lo sucesivo Prepa Sí)');
        $pdf->Text(39, 121 + $bajar, 'queda sujeta al cumplimiento de los requisitos de la Convocatoria y la verificación de datos.');
        $pdf->Text(15, 127 + $bajar, 'Tu trámite quedará invalidado:');
        $pdf->SetFont('pdfahelvetica', '', 9);
        //Normal
        $pdf->Text(15, 132 + $bajar, '• Si la institución educativa en la que te inscribiste no coincide con la que indicaste en tu hoja de registro.');
        $pdf->Text(15, 136 + $bajar, '• Si el promedio que señalaste no corresponde con tu comprobante de calificaciones.');
        $pdf->Text(15, 140 + $bajar, '• Si eres ');
        $pdf->SetFont('pdfahelveticab', '', 9);
        //Negrita
        $pdf->Text(28, 140 + $bajar, 'Prepa Sí ');
        $pdf->SetFont('pdfahelvetica', '', 9);
        //Normal
        $pdf->Text(42, 140 + $bajar, 'y te registraste como Universitario');
        $pdf->SetFont('pdfahelveticab', '', 9);
        //Negrita
        $pdf->Text(91, 140 + $bajar, 'Prepa Sí');
        $pdf->SetFont('pdfahelvetica', '', 9);
        //Normal
        $pdf->Text(105, 140 + $bajar, 'o viceversa.');
        //$pdf->RoundedRect(15, 104+15+2, 45, 5, 3, '0000', 'NULL');
        //$pdf->SetFont('pdfahelveticai', '', 6); // S
        $pdf->SetFont('pdfahelveticabi', '', 6);
        // S N
        $pdf->Text(140, 157 + $bajar + 2, 'Firma del alumno o alumna');
        $pdf->Text(140, 173 + $bajar + 2, 'Firma del alumno o alumna');
        # Linea para firma
        $pdf->Line(120, 157 + $bajar + 2, 190, 157 + $bajar + 2, $style2);
        $pdf->Line(120, 173 + $bajar + 2, 190, 173 + $bajar + 2, $style2);
        $pdf->SetFont('pdfahelveticab', '', 9);
        //Negrita
        $pdf->Text(27, 220 + $bajar, 'He leído, comprendo y acepto los términos y condiciones generales establecidas en este documento:');
        $pdf->SetFont('pdfahelvetica', '', 9);
        //Normal
        $pdf->SetFont('pdfahelveticabi', '', 6);
        // S N
        $pdf->Text(32, 232 + $bajar, 'Firma del padre/madre o tutor');
        $pdf->Text(24, 234 + $bajar, '(En caso que el alumno(a) sea menor de edad)');
        $pdf->Text(140, 232 + $bajar, 'Firma del alumno o alumna');
        $pdf->SetFont('pdfahelveticab', '', 8);
        //Negrita
        //$pdf->Text(79, 229, 'Firma del padre/madre o tutor');
        $pdf->Line(23, 232 + $bajar, 75, 232 + $bajar, $style2);
        $pdf->Line(120, 232 + $bajar, 190, 232 + $bajar, $style2);
        $pdf->SetFont('pdfahelvetica', '', 9);
        //Normal
        ///////////////////////////////////////////////////////
        //	Datos de DATOS PERSONALES
        ///////////////////////////////////////////////////////
        $pdf->SetFont('pdfahelveticab', '', 10);
        //Negrita
        //$pdf->SetFont('pdfahelvetica',	'', 10);	// Normal
        $pdf->Text(55, 25, $data['fecha_carga']);
        $pdf->Text(150, 25, $data['curp']);
        //$pdf->Text(34, 49, '*Apellido Paterno');
        $pdf->Text(16, 36, $data['paterno']);
        $pdf->Text(79, 36, $data['materno']);
        $pdf->Text(142, 36, $data['nombre']);
        $pdf->SetFont('pdfahelveticab', '', 8);
        $pdf->Text(16, 45, $data['correo']);
        $pdf->SetFont('pdfahelveticab', '', 10);
        $pdf->Text(79, 45, $data['tel']);
        $pdf->Text(142, 45, $data['cel']);
        $pdf->Text(16, 54, $data['padre']);
        $pdf->Text(110, 54, $data['madre']);
        $pdf->Text(16, 63 + $bajar + 2, $data['calle']);
        $pdf->Text(112, 63 + $bajar + 2, $data['noext']);
        $pdf->Text(130, 63 + $bajar + 2, $data['noint']);
        $pdf->Text(148, 63 + $bajar + 2, $data['manzana']);
        $pdf->Text(166, 63 + $bajar + 2, $data['lote']);
        $pdf->Text(184, 63 + $bajar + 2, $data['noedif']);
        $pdf->Text(15, 73 + $bajar + 2, $data['nodpto']);
        $pdf->Text(32, 73 + $bajar + 2, $data['andador']);
        $pdf->Text(49, 73 + $bajar + 2, $data['rampa']);
        $pdf->Text(66, 73 + $bajar + 2, $data['rampa']);
        $pdf->Text(83, 73 + $bajar + 2, $data['villa']);
        $pdf->Text(100, 73 + $bajar + 2, $data['entrada']);
        $pdf->Text(117, 73 + $bajar + 2, $data['colonia']);
        $pdf->Text(16, 83 + $bajar + 2, $data['delegacion']);
        $pdf->Text(108, 83 + $bajar + 2, $data['cp']);
        $pdf->SetFont('pdfahelveticab', '', 7);
        //Negrita
        $pdf->Text(16, 98 + $bajar + 2, $data['institucion']);
        $pdf->Text(112, 98 + $bajar + 2, $data['plantel']);
        $pdf->SetFont('pdfahelveticab', '', 10);
        //Negrita
        $pdf->Text(16, 108 + $bajar + 2, $data['grado']);
        $pdf->Text(84, 108 + $bajar + 2, $data['turno']);
        $pdf->Text(123.5, 108 + $bajar + 2, $data['modalidad']);
        $pdf->Text(176, 108 + $bajar + 2, $data['promedio']);
        $pdf->endLayer();
        //cambio de 6 a 14 el sexto parametro
        $estilo = array('padding' => 'auto');
        $pdf->write1DBarcode($data['matricula'], 'C128', 142, 251, 40, 7, 0.4, $estilo, 'N');
        $pdf->SetFont('pdfahelveticab', '', 7);
        $pdf->Text(147, 255, $data['matricula']);
        $pdf->SetFont('pdfahelveticab', '', 8);
        $pdf->Text(185, 255, 'F-1516-02');
        //$pdf->write1DBarcode('F-1314-02', 'C128', 160, 250, 40, 14, 0.4, $stylecb, 'N');
        ///////////////////////////////////////////////////---------------///////////////////////////////////////////////////
        ///////////////////////////////////////////////////POLIZA DE SEGURO///////////////////////////////////////////////////
        ///////////////////////////////////////////////////---------------///////////////////////////////////////////////////
        $pdf->AddPage('P', 'LETTER');
        //$pdf->SetFont('pdfahelveticab',	'', 10);	// Negrita
        //$pdf->SetFont('pdfahelveticabi',	'', 6);		// S N
        //$pdf->SetFont('pdfahelvetica',	'', 10);	// Normal
        //$pdf->SetFont('pdfahelveticai',	'', 10);	// S
        $pdf->SetTextColor(0, 0, 0);
        $style = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,20,5,10', 'phase' => 10, 'color' => array(255, 0, 0));
        $style2 = array('width' => 0.3, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0));
        $style3 = array('width' => 0.5, 'cap' => 'round', 'join' => 'round', 'dash' => '2,10', 'color' => array(0, 0, 0));
        $style4 = array('L' => 0, 'T' => array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => '20,10', 'phase' => 10, 'color' => array(100, 100, 255)), 'R' => array('width' => 0.5, 'cap' => 'round', 'join' => 'miter', 'dash' => 0, 'color' => array(50, 50, 127)), 'B' => array('width' => 0.75, 'cap' => 'square', 'join' => 'miter', 'dash' => '30,10,5,10'));
        $style5 = array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 64, 128));
        $style6 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,10', 'color' => array(0, 128, 0));
        $style7 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 128, 0));
        $style8 = array('width' => 0.2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0));
        # Imagenes del Encabezado
        $pdf->Image('resources/img/banorte.jpg', 15, 10, 75, 15, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        $pdf->SetFontSize(9);
        // create some HTML content
        $html = '<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
		
<div align="justify">
Advertencia: Si designas a menores de edad como beneficiarios, no es necesario señalar a un mayor de edad como representante para cobrar el seguro, ya que si lo haces, el representante tiene derecho a disponer de la suma asegurada, pues no queda obligado jurídicamente a entregársela a el o los beneficiarios del seguro.
</div>
		
<div align="justify">En el caso de que el beneficiario sea menor de edad, el padre o tutor deberá firmar de manera obligatoria este documento para su validez.</div>';
        // output the HTML content
        $pdf->writeHTML($html, true, 0, true, 0);
        //$pdf->SetFontSize(6);
        $pdf->SetFont('pdfahelvetica', '', 6);
        //Normal
        $html1 = '
<br />
<div align="justify">Los datos personales recabados serán protegidos, incorporados y tratados en el sistema denominado Sistema de Datos Personales del Programa Prepa Sí del Fideicomiso Educación Garantizada del Distrito Federal, el cual tiene su fundamento jurídico conforme a lo dispuesto en los artículos 6, 7 y demás relativos de la Ley de Protección de Datos Personales para el Distrito Federal, así como en el Contrato 21562 y sus convenios modificatorios, cuya finalidad es la integración de las bases de datos de los beneficiarios del Programa de Estímulos para el Bachillerato Universal para proporcionar los apoyos y estímulos correspondientes a los beneficiarios del Programa Educación Garantizada, Programa de Estímulos para el Bachillerato Universal, Programa de Niñ@s y Jóvenes Talento y del Programa de Seguro Contra Accidentes Personales de Escolares, así como aquellos programas que en su caso instruya el C. Jefe de Gobierno y el Comité Técnico de este Fideicomiso apruebe de conformidad con los lineamientos, reglas y/o mecanismos de operación correspondientes y podrán ser transmitidos únicamente al titular de los mismos datos o a su representante legal, además de otras transmisiones previstas en la Ley de Protección de Datos Personales para el Distrito Federal.
<br>
<br>
Los datos marcados con asterisco (*) son obligatorios y sin ellos no podrá acceder al servicio hasta completar el trámite Solicitud de ingreso o reingreso al Programa de Estímulos para el Bachillerato Universal, PREBU, Prepa Sí”. Asimismo, se le informa, que sus datos no podrán ser difundidos sin su conocimiento expreso, salvo las excepciones previstas en la Ley.
<br />
El responsable del Sistema de Datos Personales es la Lic. Mónica Pérez Egüis, Subdirectora de Control de Entregas e Incidencias y el domicilio en donde podrá ejercer los derechos de acceso, rectificación, cancelación y oposición, así como la renovación del consentimiento es la Oficina de Información Pública de este Fideicomiso Educación Garantizada, ubicada en Ejército Nacional No. 359, Col. Granada, Delegación Miguel Hidalgo, C.P. 11520, México, Distrito Federal, Número de Teléfono: 11021730 ext. 4079, Página de Internet: www.fideicomisoed.df.gob.mx y correo electrónico: oip@fideicomisoed.df.gob.mx.
<br />
El interesado podrá dirigirse al Instituto de Acceso a la Información Pública del Distrito Federal, donde recibirá asesoría sobre los derechos que tutela la Ley de Protección de Datos Personales para el Distrito Federal al teléfono 56364636; correo electrónico: datos.personales@infodf.org.mx o www.infodf.org.mx.
<br />
<br />
Este programa es de carácter público, no es patrocinado ni promovido por partido político alguno y sus recursos provienen de los impuestos que pagan todos los contribuyentes. Está prohibido el uso de este programa con fines políticos, electorales, de lucro y otros distintos a los establecidos. Quien haga uso indebido de los recursos de este programa en el Distrito Federal, será sancionado de acuerdo con la ley aplicable y ante la autoridad competente.
<br />
<br />
Con fundamento en el artículo 16 de la Ley de Protección de Datos Personales para el Distrito Federal y el Numeral 23 de los Lineamientos para la Protección de Datos Personales en el Distrito Federal, <b>' . $data['paterno'] . ' ' . $data['materno'] . ' ' . $data['nombre'] . '</b> otorgo mi consentimiento expreso para que mis datos personales tengan un tratamiento específicamente para la operación que desarrolla el Programa de Estímulos para el Bachillerato Universal durante el tiempo en el cual me encuentre inscrito.</div>
<br />
';
        $pdf->writeHTML($html1, true, 0, true, 0);
        //$pdf->SetFontSize(6);
        $pdf->SetFont('pdfahelvetica', '', 9);
        //Normal
        $html2 = '
<br />
<div align="justify"><strong>IMPORTANTE<br/>
Si eres menor de edad, debe firmar el padre, la madre o el tutor.
</strong></div>';
        $pdf->writeHTML($html2, true, 0, true, 0);
        $pdf->SetFont('pdfahelveticab', '', 9);
        //Negrita
        $pdf->Text(92, 18, 'Consentimiento de seguro: ACCIDENTES PERSONALES COLECTIVO');
        # Linea 1
        $pdf->Line(15, 28, 200, 28, $style2);
        $pdf->SetFontSize(10);
        $pdf->Text(15, 30, 'Nombre del contratante BANCO MERCANTIL DEL NORTE, S.A.                                      1274/01');
        # Linea 2
        $pdf->Line(15, 35, 130, 35, $style2);
        # Linea 2 continuacion
        $pdf->Line(155, 35, 175, 35, $style2);
        $pdf->SetFont('pdfahelvetica', '', 10);
        // Normal
        $pdf->Text(56, 35, 'No Certificado');
        # Linea 3
        $pdf->Line(15, 41, 200, 41, $style2);
        $pdf->Text(15, 41, 'Nombre del Asegurado');
        $pdf->Text(120, 41, 'Sexo');
        $pdf->Text(170, 41, 'Estado Civil');
        # Linea 4
        $pdf->Line(15, 52, 200, 52, $style2);
        $pdf->Text(20, 52, '         Fecha de                    Fecha de Ingreso al                                                             Vigencia del Seguro ');
        $pdf->Text(20, 56, '        Nacimiento             Servicio del Contratante         Puesto u ocupación              Desde                   Hasta ');
        $pdf->Text(20, 60, '      Dia   Mes   Año              Dia   Mes   Año                                                         Dia  Mes  Año      Dia  Mes  Año');
        $pdf->Text(64, 65, '01     09    2015');
        # Linea 5
        $pdf->Line(15, 71, 200, 71, $style2);
        //Datos de (de los) asegurado(s)
        $pdf->Text(15, 72, 'Datos de (de los) asegurado (s)');
        $pdf->SetLineStyle(array('width' => 0.3, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
        # Rectangulo de contenido
        $pdf->RoundedRect(15, 77, 185, 15, 3, '0000', 'NULL');
        # Lineas del Rectangulo
        $pdf->Line(75, 77, 75, 92, $style2);
        $pdf->Line(112, 77, 112, 92, $style2);
        $pdf->Line(132, 77, 132, 92, $style2);
        $pdf->Line(167, 77, 167, 92, $style2);
        $pdf->Text(18, 81, 'Nombre y Apellidos Completos');
        $pdf->Text(75, 77, 'Fecha de Nacimiento');
        $pdf->Text(136, 77, 'Fecha de Alta');
        $pdf->Text(78, 81, 'Dia     Mes     Año');
        $pdf->Text(116, 81, 'Sexo');
        $pdf->Text(134, 81, 'Dia     Mes     Año');
        $pdf->Text(173, 81, 'Parentesco');
        # Linea 6
        $pdf->Line(15, 94, 200, 94, $style2);
        $pdf->Text(15, 94.5, 'Regla para determinar la suma asegurada: Suma Asegurada fija igual a $10,000.00');
        # Linea 7
        $pdf->Line(15, 100, 200, 100, $style2);
        $pdf->SetFontSize(9);
        $pdf->Text(15, 100, 'Beneficios:');
        $pdf->SetFontSize(10);
        $pdf->Text(15, 105, 'MUERTE ACCIDENTAL');
        # Linea 8
        $pdf->Line(15, 110, 200, 110, $style2);
        $pdf->SetFont('pdfahelveticab', '', 9);
        //Negrita
        $pdf->Text(15, 111, 'Nombre completo de los Beneficiarios (para efectos de identificación) y porcentaje de participación');
        # Linea 9
        $pdf->Line(15, 121.5, 200, 121.5, $style2);
        $pdf->SetFont('pdfahelvetica', '', 7);
        // Normal
        $pdf->Text(16, 243, 'FIRMA DEL REPRESENTANTE DEL');
        $pdf->Text(87, 243, 'FIRMA DEL PADRE O TUTOR');
        $pdf->Text(148, 243, 'FIRMA DEL BENEFICIARIO/ALUMNO');
        $pdf->Text(15, 246, 'CONTRATANTE (BANCO MERCANTIL');
        $pdf->Text(163, 246, 'ASEGURADO');
        $pdf->Text(28, 249, 'DEL NORTE, S.A.)');
        $pdf->Line(15, 243, 67, 243, $style2);
        $pdf->Line(81, 243, 133, 243, $style2);
        $pdf->Line(147, 243, 199, 243, $style2);
        //$pdf->Line(15, 262, 200, 262, $style8);
        //$pdf->Line(15, 94, 255, 94, $style2);
        //$pdf->Text(185, 255, 'F-1415-02');
        ///////////////////////////////////////////////////////
        //	Datos de DATOS PERSONALES
        ///////////////////////////////////////////////////////
        $pdf->SetFont('pdfahelveticab', '', 10);
        //Negrita
        //$pdf->SetFont('pdfahelvetica',	'', 10);	// Normal
        $pdf->Text(15, 48, $data['paterno'] . ' ' . $data['materno'] . ' ' . $data['nombre']);
        $pdf->Text(118, 48, $data['sexo']);
        $pdf->Text(165, 48, $data['ecivil']);
        $pdf->Text(26, 65, substr($data['fecha_nac'], 8, 2));
        $pdf->Text(35, 65, substr($data['fecha_nac'], 5, 2));
        $pdf->Text(43, 65, substr($data['fecha_nac'], 0, 4));
        $pdf->Text(152, 254, $data['matricula']);
        $pdf->endLayer();
        $estilo = array('padding' => 'auto');
        $pdf->write1DBarcode($data['matricula'], 'C128', 150, 247.5, 40, 9, 0.4, $estilo, 'N');
        /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
        ///////////////////////////////////////////////////---------------///////////////////////////////////////////////////
        ///////////////////////////////////////////////////FORMATO TARJETAS//////////////////////////////////////////////////
        ///////////////////////////////////////////////////---------------//////////////////////////////////////////////////
        $pdf->AddPage('P', 'LETTER');
        //$pdf->SetXY(110, 200);
        $pdf->SetFontSize(13);
        $pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
        # Primer Credencial
        $pdf->RoundedRect(8, 33, 95, 63, 3, '1111', 'NULL');
        //-$pdf->Image('../images/angel2.jpg', 10, 35, 23, 23, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        //-$pdf->Image('../images/fideicomiso.jpg', 40, 35, 20, 20, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        //-$pdf->Image('../images/prepasi.png', 80, 35, 20, 20, 'PNG', '', '', true, 100, '', false, false, 0, false, false, false);
        $pdf->Image('resources/img/tarjeta_cdmx.jpg', 11, 37, 87, 14, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        $codarr = '';
        # Primer Codigo de Barras
        $params = $pdf->serializeTCPDFtagParameters(array($data['matricula'], 'C128', '25', '68', 60, 20, 0.4, array('position' => 'S', 'border' => false, 'padding' => 4, 'fgcolor' => array(0, 0, 0), 'bgcolor' => array(255, 255, 255), 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4), 'N'));
        $codarr .= '<tcpdf method="write1DBarcode" params="' . $params . '" />';
        $pdf->Text(30, 61, '' . $data['nombre'] . '');
        $pdf->Text(135, 61, '' . $data['nombre'] . '');
        $pdf->Text(10, 56, 'Nombre: ' . $data['paterno'] . ' ' . $data['materno'] . '');
        $pdf->Text(115, 56, 'Nombre: ' . $data['paterno'] . ' ' . $data['materno'] . '');
        $pdf->writeHTML($codarr, '', '', '', 0);
        # Segunda Credencial
        $pdf->RoundedRect(112, 33, 95, 63, 3, '1111', 'NULL');
        //-$pdf->Image('../images/angel2.jpg', 114, 35, 23, 23, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        //-$pdf->Image('../images/fideicomiso.jpg', 144, 35, 20, 20, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        //-$pdf->Image('../images/prepasi.png', 184, 35, 20, 20, 'PNG', '', '', true, 100, '', false, false, 0, false, false, false);
        $pdf->Image('resources/img/tarjeta_cdmx.jpg', 115, 37, 87, 14, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        # Segundo Codigo de Barras
        $params = $pdf->serializeTCPDFtagParameters(array($data['matricula'], 'C128', '130', '68', 60, 20, 0.4, array('position' => 'S', 'border' => false, 'padding' => 4, 'fgcolor' => array(0, 0, 0), 'bgcolor' => array(255, 255, 250), 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4), 'N'));
        $codarr .= '<tcpdf method="write1DBarcode" params="' . $params . '" />';
        $pdf->writeHTML($codarr, '', '', '', 0);
        # Tercer Credencial
        $pdf->RoundedRect(8, 105, 95, 63, 3, '1111', 'NULL');
        /*$pdf->Image('../images/angel2.jpg', 10, 107, 23, 23, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        		 $pdf->Image('../images/fideicomiso.jpg', 40, 107, 20, 20, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        		$pdf->Image('../images/prepasi.png', 80, 107, 20, 20, 'PNG', '', '', true, 100, '', false, false, 0, false, false, false);*/
        $pdf->Image('resources/img/tarjeta_cdmx.jpg', 11, 109, 87, 14, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        # Tercer Codigo de Barras 140+72
        $params = $pdf->serializeTCPDFtagParameters(array($data['matricula'], 'C128', '25', '140', 60, 20, 0.4, array('position' => 'S', 'border' => false, 'padding' => 4, 'fgcolor' => array(0, 0, 0), 'bgcolor' => array(255, 255, 255), 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4), 'N'));
        $codarr .= '<tcpdf method="write1DBarcode" params="' . $params . '" />';
        $pdf->writeHTML($codarr, '', '', '', 0);
        # Cuarta Credencial
        $pdf->RoundedRect(112, 105, 95, 63, 3, '1111', 'NULL');
        /*$pdf->Image('../images/angel2.jpg', 114, 107, 23, 23, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        		 $pdf->Image('../images/fideicomiso.jpg', 144, 107, 20, 20, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        		$pdf->Image('../images/prepasi.png', 184, 107, 20, 20, 'PNG', '', '', true, 100, '', false, false, 0, false, false, false);*/
        $pdf->Image('resources/img/tarjeta_cdmx.jpg', 115, 109, 87, 14, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        # Cuarto Codigo de Barras 140+72
        $params = $pdf->serializeTCPDFtagParameters(array($data['matricula'], 'C128', '130', '140', 60, 20, 0.4, array('position' => 'S', 'border' => false, 'padding' => 4, 'fgcolor' => array(0, 0, 0), 'bgcolor' => array(255, 255, 250), 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4), 'N'));
        $codarr .= '<tcpdf method="write1DBarcode" params="' . $params . '" />';
        $pdf->writeHTML($codarr, '', '', '', 0);
        # Quinta Credencial
        $pdf->RoundedRect(8, 177, 95, 63, 3, '1111', 'NULL');
        /*$pdf->Image('../images/angel2.jpg', 10, 179, 23, 23, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        		 $pdf->Image('../images/fideicomiso.jpg', 40, 179, 20, 20, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        		$pdf->Image('../images/prepasi.png', 80, 179, 20, 20, 'PNG', '', '', true, 100, '', false, false, 0, false, false, false);*/
        $pdf->Image('resources/img/tarjeta_cdmx.jpg', 11, 181, 87, 14, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        # Quinto Codigo de Barras 140+72
        $params = $pdf->serializeTCPDFtagParameters(array('' . $data['matricula'] . '', 'C128', '25', '212', 60, 20, 0.4, array('position' => 'S', 'border' => false, 'padding' => 4, 'fgcolor' => array(0, 0, 0), 'bgcolor' => array(255, 255, 255), 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4), 'N'));
        $codarr .= '<tcpdf method="write1DBarcode" params="' . $params . '" />';
        $pdf->writeHTML($codarr, '', '', '', 0);
        # Sexta Credencial
        $pdf->RoundedRect(112, 177, 95, 63, 3, '1111', 'NULL');
        /*$pdf->Image('../images/angel2.jpg', 114, 179, 23, 23, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        		 $pdf->Image('../images/fideicomiso.jpg', 144, 179, 20, 20, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        		$pdf->Image('../images/prepasi.png', 184, 179, 20, 20, 'PNG', '', '', true, 100, '', false, false, 0, false, false, false);*/
        $pdf->Image('resources/img/tarjeta_cdmx.jpg', 115, 181, 87, 14, 'JPG', '', '', true, 100, '', false, false, 0, false, false, false);
        # Sexto Codigo de Barras 140+72
        $params = $pdf->serializeTCPDFtagParameters(array('' . $data['matricula'] . '', 'C128', '130', '212', 60, 20, 0.4, array('position' => 'S', 'border' => false, 'padding' => 4, 'fgcolor' => array(0, 0, 0), 'bgcolor' => array(255, 255, 250), 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4), 'N'));
        $codarr .= '<tcpdf method="write1DBarcode" params="' . $params . '" />';
        $pdf->writeHTML($codarr, '', '', '', 0);
        $pdf->Text(30, 133, '' . $data['nombre'] . '');
        $pdf->Text(135, 133, '' . $data['nombre'] . '');
        $pdf->Text(30, 205, '' . $data['nombre'] . '');
        $pdf->Text(135, 205, '' . $data['nombre'] . '');
        $pdf->Text(10, 128, 'Nombre: ' . $data['paterno'] . ' ' . $data['materno'] . '');
        $pdf->Text(115, 128, 'Nombre: ' . $data['paterno'] . ' ' . $data['materno'] . '');
        $pdf->Text(10, 200, 'Nombre: ' . $data['paterno'] . ' ' . $data['materno'] . '');
        $pdf->Text(115, 200, 'Nombre: ' . $data['paterno'] . ' ' . $data['materno'] . '');
        $pdf->setCellPaddings(1, 1, 1, 1);
        // set cell margins
        $pdf->setCellMargins(1, 1, 1, 1);
        // ---------------------------------------------------------
        //$pdf->writeHTML($html, '', '', '', 0);
        $pdf->SetFont('helvetica', '', 5);
        // print a message
        $txt = '“Este programa es de carácter público, no es patrocinado ni promovido por partido político alguno y sus recursos provienen de los impuestos que pagan todos los contribuyentes. Está prohibido el uso de este programa con fines políticos, electorales, de lucro y otros distintos a los establecidos. Quien haga uso indebido de los recursos de este programa en el Distrito Federal, será sancionado de acuerdo con la ley aplicable y ante la autoridad competente.”';
        $pdf->MultiCell(90, 0, $txt, 0, 'C', false, 1, 10, 82, true, 0, false, true, 0, 'T', false);
        $pdf->Ln(2);
        $txt = '“Este programa es de carácter público, no es patrocinado ni promovido por partido político alguno y sus recursos provienen de los impuestos que pagan todos los contribuyentes. Está prohibido el uso de este programa con fines políticos, electorales, de lucro y otros distintos a los establecidos. Quien haga uso indebido de los recursos de este programa en el Distrito Federal, será sancionado de acuerdo con la ley aplicable y ante la autoridad competente.”';
        $pdf->MultiCell(90, 0, $txt, 0, 'C', false, 1, 115, 82, true, 0, false, true, 0, 'T', false);
        $pdf->Ln(2);
        $txt = '“Este programa es de carácter público, no es patrocinado ni promovido por partido político alguno y sus recursos provienen de los impuestos que pagan todos los contribuyentes. Está prohibido el uso de este programa con fines políticos, electorales, de lucro y otros distintos a los establecidos. Quien haga uso indebido de los recursos de este programa en el Distrito Federal, será sancionado de acuerdo con la ley aplicable y ante la autoridad competente.”';
        $pdf->MultiCell(90, 0, $txt, 0, 'C', false, 1, 10, 154, true, 0, false, true, 0, 'T', false);
        $pdf->Ln(2);
        $txt = '“Este programa es de carácter público, no es patrocinado ni promovido por partido político alguno y sus recursos provienen de los impuestos que pagan todos los contribuyentes. Está prohibido el uso de este programa con fines políticos, electorales, de lucro y otros distintos a los establecidos. Quien haga uso indebido de los recursos de este programa en el Distrito Federal, será sancionado de acuerdo con la ley aplicable y ante la autoridad competente.”';
        $pdf->MultiCell(90, 0, $txt, 0, 'C', false, 1, 115, 154, true, 0, false, true, 0, 'T', false);
        $pdf->Ln(2);
        $txt = '“Este programa es de carácter público, no es patrocinado ni promovido por partido político alguno y sus recursos provienen de los impuestos que pagan todos los contribuyentes. Está prohibido el uso de este programa con fines políticos, electorales, de lucro y otros distintos a los establecidos. Quien haga uso indebido de los recursos de este programa en el Distrito Federal, será sancionado de acuerdo con la ley aplicable y ante la autoridad competente.”';
        $pdf->MultiCell(90, 0, $txt, 0, 'C', false, 1, 10, 226, true, 0, false, true, 0, 'T', false);
        $pdf->Ln(2);
        $txt = '“Este programa es de carácter público, no es patrocinado ni promovido por partido político alguno y sus recursos provienen de los impuestos que pagan todos los contribuyentes. Está prohibido el uso de este programa con fines políticos, electorales, de lucro y otros distintos a los establecidos. Quien haga uso indebido de los recursos de este programa en el Distrito Federal, será sancionado de acuerdo con la ley aplicable y ante la autoridad competente.”';
        $pdf->MultiCell(90, 0, $txt, 0, 'C', false, 1, 115, 226, true, 0, false, true, 0, 'T', false);
        $pdf->Ln(2);
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        // reset pointer to the last page
        //$pdf->lastPage();
        $nombre_archivo = utf8_decode("Registro_" . $data['matricula'] . ".pdf");
        $pdf->Output($nombre_archivo, 'I');
        ob_end_flush();
    }
Example #18
0
    function make_pdf($PDF_html, $PDF_name='Ads2Trade_Document', $PDF_Title='Ads2Trade Dcoument', $PDF_Orientation="L")
    {
        $CI =& get_instance();
        $CI->load->library('pdf'); // load library (if not already loaded - CI will handle this check for us though)

        // create new PDF document
        //$pdf = new TCPDF($PDF_Orientation, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
        $pdf = new Pdf($PDF_Orientation, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

        $html = $PDF_html;

        //Make sure orientation is valid i.e. either P or L
        if($PDF_Orientation != 'P' && $PDF_Orientation != 'L'){
            $PDF_Orientation = 'L'; //default to landscape if invalid value supplied
        }

        $pdf->setPageOrientation($PDF_Orientation); //custom class seemed to not be picking up orientation in constructor

        if($PDF_name == '' or  is_null($PDF_name)){
            $PDF_name = 'Ads2Trade_Document'; //default to landscape if invalid value supplied
        }

        // set document information
        //$pdf->SetCreator(PDF_CREATOR);
        $pdf->SetCreator("Ads2Trade");
        $pdf->SetAuthor('Ads2Trade');
        $pdf->SetTitle('Ads2Trade Document Title Goes Here');
        $pdf->SetSubject('Ads2Trade');
        $pdf->SetKeywords('Ads2Trade, PDF, asset, auction, advertising');

        // set default header data
        $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, $PDF_Title, PDF_HEADER_STRING);

        // set header and footer fonts
        $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
        $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));

        // set default monospaced font
        $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

        // set margins
        $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
        $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
        $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);

        // set auto page breaks
        $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

        // set image scale factor
        $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

        // set some language-dependent strings (optional)
        if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
            require_once(dirname(__FILE__).'/lang/eng.php');
            $pdf->setLanguageArray($l);
        }


        // ---------------------------------------------------------

        // set font
        $pdf->SetFont('dejavusans', '', 10);

        // add a page
        $pdf->AddPage();

        // create some HTML content
        if (is_null($html) or ($html == '')) {
                $html = '<!DOCTYPE html>
                <html>
                  <head>
                  <title></title>
                          <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
                  </head>
                 <body>
                     <p>ERROR: No Document Data Supplied</p>
                 </body>
                 </html>';

        }

        // output the HTML content
        $pdf->writeHTML($html, true, false, true, false, '');


        // reset pointer to the last page
        $pdf->lastPage();

        // ---------------------------------------------------------

        //Close and output PDF document
        $pdf->Output($PDF_name.'.pdf', 'I');

    }
Example #19
0
 public function index()
 {
     $this->load->library('Pdf');
     $hashqid = $_GET['qid'];
     $this->load->model('quotationmodel');
     $data = $this->quotationmodel->fetchQuotationDetails($hashqid);
     //$this->load->view('admin/pdfquotation',$data);
     $pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);
     ob_clean();
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     //set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     // set document information
     $pdf->SetCreator('Gizmoland');
     $pdf->SetTitle("Quotation");
     // set default header data
     //$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));
     // set header and footer fonts
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     //set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     //set auto page breaks
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     //set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     //set some language-dependent strings
     //$pdf->setLanguageArray($l);
     // ---------------------------------------------------------
     // set default font subsetting mode
     $pdf->setFontSubsetting(true);
     // Set font
     // dejavusans is a UTF-8 Unicode font, if you only need to
     // print standard ASCII chars, you can use core fonts like
     // helvetica or helvetica to reduce file size.
     $pdf->SetFont('helvetica', '', 14, '', true);
     // Add a page
     // This method has several options, check the source code documentation for more information.
     $pdf->AddPage();
     $pdf->SetXY(15, 8);
     $pdf->SetFont('helvetica', 'B', 12);
     $pdf->SetTextColor(0, 0, 0, 100);
     $pdf->Cell(0, 0, 'Quotation', 0, 1, 'C', 0, '', 0);
     $pdf->SetXY(5, 5);
     $pdf->SetXY(0, 28);
     $pdf->SetFont('helvetica', 'B', 12);
     $pdf->Cell(65, 5, 'Customer Details', 0, 1, 'C', 0, '', 0);
     $pdf->SetXY(0, 28);
     $pdf->Cell(325, 5, 'Consolidated Premium Retailers', 0, 1, 'C', 0, '', 0);
     $pdf->Ln(2);
     $pdf->SetFont('helvetica', '', 10);
     $pdf->SetTextColor(0, 0, 0, 100);
     $pdf->SetXY(15, 35);
     //Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=0, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M')
     $pdf->Cell(25, 5, 'Customer Name :', 0, 1, 'L', 0, '', 0);
     $pdf->Cell(25, 5, 'Contact :', 0, 1, 'L', 0, '', 0);
     $pdf->Cell(25, 5, 'Address :', 0, 1, 'L', 0, '', 0);
     $pdf->SetFont('helvetica', '', 10);
     $pdf->SetXY(45, 35);
     $pdf->Cell(25, 5, ucfirst($data['name']), 0, 1, 'L', 0, '', 0);
     $pdf->SetXY(30, 40);
     $pdf->Cell(25, 5, $data['contact'], 0, 1, 'L', 0, '', 0);
     $pdf->SetXY(30, 45);
     //$pdf->Cell(25, 5, $data['address'], 0, 1, 'L', 0, '', 0);
     $pdf->Cell(25, 5, '', 0, 1, 'L', 0, '', 0);
     $pdf->writeHTMLCell($w = 80, $h = 0, $x = 15, $y = '', $data['address'], $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
     //$pdf->SetXY(40, 50);
     $style4 = array('L' => 0, 'T' => array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => '20,10', 'phase' => 10, 'color' => array(100, 100, 255)), 'R' => array('width' => 0.5, 'cap' => 'round', 'join' => 'miter', 'dash' => 0, 'color' => array(50, 50, 127)), 'B' => array('width' => 0.75, 'cap' => 'square', 'join' => 'miter', 'dash' => '30,10,5,10'));
     //$style = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0));
     //$pdf->Line(5, 10, 80, 30, $style);
     $pdf->SetFont('helvetica', '', 10);
     $pdf->SetXY(131, 35);
     $pdf->Cell(25, 5, 'Contact :', 0, 1, 'L', 0, '', 0);
     $pdf->SetXY(131, 40);
     $pdf->Cell(25, 5, 'Email :', 0, 1, 'L', 0, '', 0);
     $pdf->SetXY(131, 45);
     $pdf->Cell(25, 5, 'TIN :', 0, 1, 'L', 0, '', 0);
     $pdf->SetXY(131, 50);
     $pdf->Cell(25, 5, 'CST :', 0, 1, 'L', 0, '', 0);
     $pdf->SetXY(131, 55);
     $pdf->Cell(25, 5, 'Sales Person :', 0, 1, 'L', 0, '', 0);
     $pdf->SetFont('helvetica', '', 10);
     $pdf->SetXY(147, 35);
     $pdf->Cell(25, 5, $data['retailcontact'], 0, 1, 'L', 0, '', 0);
     $pdf->SetXY(143, 40);
     $pdf->Cell(25, 5, $data['maildid'], 0, 1, 'L', 0, '', 0);
     $pdf->SetXY(140, 45);
     $pdf->Cell(25, 5, $data['tin'], 0, 1, 'L', 0, '', 0);
     $pdf->SetXY(140, 50);
     $pdf->Cell(25, 5, $data['cst'], 0, 1, 'L', 0, '', 0);
     $pdf->SetXY(155, 55);
     $pdf->Cell(25, 5, $data['salesperson'], 0, 1, 'L', 0, '', 0);
     $invoicedetails = '<table><thead><tr><th  style="font-weight:bold;" width="35%">Quotation Details</th><th></th></tr></thead><tbody>';
     $invoicedetails .= '<tr><td  width="25%">Quotation Number:</td><td>' . $data['qid'] . '</td></tr>';
     $invoicedetails .= '<tr><td  width="25%">Quotation Date:</td><td>' . date("m/d/y", $data['quotationdate']) . '</td></tr>';
     $pdf->Ln(20);
     $pdf->writeHTMLCell($w = 0, $h = 0, $x = 15, $y = '', $invoicedetails, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
     $pdf->Line(15, 100, 195, 100, $style4);
     $pdf->Line(15, 110, 195, 110, $style4);
     $pos = 105;
     $pdf->SetFont('helvetica', '', 10);
     $itemdetails = '<table  cellpadding="5" cellspacing="10"><thead><tr style="font-weight:bold;"><th width="15%" style="text-align:center;">Item Code</th><th width="27%" style="text-align:center;">Description of Goods</th><th width="7%">QTY</th><th width="13%" style="text-align:center;">Price</th><th width="9%"  style="text-align:center;">TAX%</th><th width="15%"  style="text-align:center;">DIS%</th><th width="14%" style="text-align:center;">Net</th></tr></thead><tbody>';
     foreach ($data['itemdetails'] as $row) {
         $actualprice = $row['price'] * $row['quantity'];
         $disvalue = $row['quantity'] * $row['price'] * $row['dis'] / 100;
         $taxvalue = ($actualprice - $disvalue) * $row['taxpercent'] / 100;
         $rowtotal = $actualprice - ($disvalue + $taxvalue);
         $itemdetails .= '<tr><td width="15%">' . $row['itemcode'] . '</td><td  width="27%">' . $row['description'] . '</td><td width="7%">' . $row['quantity'] . '</td><td width="13%"  style="text-align:right;">' . number_format($row['price'], 2, '.', ',') . '</td><td width="9%" style="text-align:right;">' . number_format($row['taxpercent'], 2, '.', ',') . '</td><td  width="15%" style="text-align:right;">' . number_format($row['dis'], 2, '.', ',') . '</td><td width="14%" style="text-align:right;">' . number_format($rowtotal, 2, '.', ',') . '</td></tr>';
         $pos = $pos + 10;
     }
     $itemdetails .= '</tbody></table>';
     $pos = $pos + 50;
     $pdf->Ln(5);
     $pdf->writeHTMLCell($w = 0, $h = 0, $x = 15, $y = '', $itemdetails, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
     $pdf->Ln(2);
     $pdf->Line(15, $pos, 195, $pos, $style4);
     $subdetails = '<table><thead><tr><th  style="font-weight:bold;" width="50%"></th><th></th></tr></thead><tbody>';
     $subdetails .= '<tr><td  width="50%" style="font-weight:bold;">Subtotal  :</td><td  style="text-align:right;">' . number_format($data['subtotal'], 2, '.', ',') . '</td></tr>';
     $subdetails .= '<tr><td  width="50%" style="font-weight:bold;">Tax Total :</td><td  style="text-align:right;">' . number_format($data['taxtotal'], 2, '.', ',') . '</td></tr>';
     $subdetails .= '<tr><td  width="50%" style="font-weight:bold;">Round Off :</td><td  style="text-align:right;">' . number_format($data['roundoff'], 2, '.', ',') . '</td></tr>';
     $subdetails .= '<tr><td  width="50%" style="font-weight:bold;">Net Amount:</td><td style="text-align:right;">' . number_format($data['netamount'], 2, '.', ',') . '</td></tr>';
     $subdetails .= '</tbody></table>';
     //$pdf->Ln(5);
     $pdf->SetXY(140, $pos);
     $pdf->writeHTMLCell($w = 52, $h = 0, $x = 125, $y = '', $subdetails, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = 'right', $autopadding = true);
     $remarksdetails = '<table><thead><tr><th  style="font-weight:bold;" width="50%"></th><th></th></tr></thead><tbody>';
     $remarksdetails .= '<tr><td  width="50%"></td><td  style="text-align:right;"></td></tr>';
     $remarksdetails .= '<tr><td  width="50%"></td><td  style="text-align:right;"></td></tr>';
     $remarksdetails .= '<tr><td  width="50%"></td><td  style="text-align:right;"></td></tr>';
     //$remarksdetails .= '<tr><td  width="95%">Rupees '.ucfirst($this->no_to_words($data['netamount']).' only/-').'</td><td   width="5%"></td></tr>';
     $remarksdetails .= '<tr><td  width="50%"></td><td  style="text-align:right;"></td></tr>';
     $remarksdetails .= '<tr><td  width="50%" style="font-weight:bold;">Term&Condition</td><td style="text-align:right;"></td></tr>';
     $remarksdetails .= '<tr><td  width="90%" style="text-align:Justify;">' . $data['term'] . '</td><td width="10%"></td></tr>';
     $remarksdetails .= '<tr><td  width="50%"></td><td></td></tr>';
     $remarksdetails .= '<tr><th  style="font-weight:bold;text-align:right;" width="95%">For CONSOLIDATED PREMIUM RETAILERS</th></tr>';
     $remarksdetails .= '<tr><td  width="50%"></td><td></td></tr>';
     $remarksdetails .= '<tr><td  width="50%"></td><td></td></tr>';
     $remarksdetails .= '<tr><td  width="50%"></td><td></td></tr>';
     $remarksdetails .= '<tr><td  style="text-align:right; width:80%;">Authorised Signatory</td><td></td></tr>';
     $remarksdetails .= '</tbody></table>';
     $pdf->SetXY(140, $pos);
     //$pdf->Ln(5);
     $pdf->writeHTMLCell($w = 180, $h = 0, $x = 15, $y = '', $remarksdetails, $border = 0, $ln = 1, $fill = 0, $reseth = false, $align = 'right', $autopadding = true);
     /*
     $footerdetails = '<table><thead><tr><th></th><th  style="font-weight:bold;" width="75%">For CONSOLIDATED PREMIUM RETAILERS</th></tr></thead><tbody>';
     $footerdetails .= '<tr><td  width="50%"></td><td></td></tr>';
     $footerdetails .= '<tr><td  width="50%"></td><td></td></tr>';
     $footerdetails .= '<tr><td  width="50%"></td><td></td></tr>';
     $footerdetails .= '<tr><td  style="text-align:right; width:80%;">Authorised Signatory</td><td></td></tr>';
     $footerdetails .= '<tr><td  style="text-align:center;" width="30%"></td><td></td></tr>';
     $footerdetails .= '<tr><td style="text-align:left;" width="50%"></td><td></td></tr>';
     $footerdetails .= '</tbody></table>';
     
     //$pdf->SetXY(160, 150);
     $pdf->Ln(5);
     //$pdf->writeHTMLCell($w=180, $h=0, $x=15, $y='',$footerdetails, $border=1, $ln=1, $fill=0, $reseth=false, $align='right', $autopadding=true);
     */
     $pdf->Output($data['qid'] . '.pdf', 'I');
 }
    function export_pdf39()
    {
        $this->load->library('pdf');
        ob_clean();
        $pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);
        $tbl = '';
        $tbl .= '
				<h3><u>MASTER DIAGNOSA</u></h3>
				<table border="0"  cellpadding="0" cellspacing="0" >
				 <tr >';
        $tbl .= '<th  align="center" bgcolor="#359AFF" width="30" >NO</th>';
        $tbl .= '<th   valign="middle" bgcolor="#359AFF" width="100" >DIAG_KODE</th>';
        $tbl .= '<th   valign="middle" bgcolor="#359AFF" width="230" >DIAG_NAMA</th>';
        $tbl .= '<th   valign="middle" bgcolor="#359AFF" width="80" >ST_DIAG</th>';
        $tbl .= '</tr>';
        $sql = "select diag_kode, diag_nama, diag_level,case when diag_aktif=1 then 'aktif' else 'tidak aktif' end \nas st_diag,  diag_aktif,diag_id from billing.b_ms_diagnosa";
        $data = $this->m_global->grid_view($sql)->result_array();
        $no = 1;
        foreach ($data as $row) {
            $bg = $no % 2;
            if ($bg == 0) {
                $bg = ' bgcolor="#E1F0FF" ';
            } else {
                $bg = ' bgcolor="#FFFFFF" ';
            }
            $tbl .= '
					<tr>
					<td ' . $bg . '  align="center" width="30">' . $no . '</td>';
            $tbl .= '<td ' . $bg . '  width="100" >' . $row['diag_kode'] . '</td>';
            $tbl .= '<td ' . $bg . '  width="230" >' . $row['diag_nama'] . '</td>';
            $tbl .= '<td ' . $bg . '  width="80" >' . $row['st_diag'] . '</td>';
            $tbl .= '</tr>';
            $no++;
        }
        $tbl .= '</table>';
        $pdf->AddPage();
        $pdf->SetFont('helvetica', '', 8);
        $pdf->writeHTML($tbl, true, false, false, false, '');
        $pdf->Output('example_048.pdf', 'I');
    }
Example #21
0
 public function generarReporteEventoGeneralSeleccionFecha()
 {
     $fecha = date("Y-m-d", strtotime($this->input->get('fecha')));
     $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->SetFooterMargin(PDF_MARGIN_FOOTER);
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING, array(0, 64, 255), array(0, 64, 128));
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     $pdf->setFontSubsetting(true);
     $pdf->SetFont('times', '', 12, '', true);
     $pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
     $pdf->AddPage();
     $html = null;
     $pdf->SetFont('Times', 'B', 14);
     $pdf->Image("imagen/logo/bannerprevengo2.png", $x = 5, $y = 5, $w = 290, $h = 40, $type = 'PNG', $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->SetTextColor('0', '25', '215');
     $pdf->Text(130, 12, "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(130, 17, "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(130, 23, "Oficina de Personal--División de Planificación y Presupuesto.", $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->SetTextColor('8', '8', '8');
     // $pdf->Text(50, 35, 'Reporte General de Eventos.');
     // $pdf->Ln(20);
     //$pdf->Text(30, 40, 'Fecha:' . date('d-m-Y'),  $align = 'rigth');
     $pdf->Ln(15);
     $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="2"><p align="center"><b></b></p></td>
                     <td colspan="2" ><p align="center"><b></b></p></td>
                     <td colspan="2"><p align="center"><b>Barquisimeto, ' . $dia . ' de ' . $mes . ' del ' . $ano . '</b></p></td>
                 </tr>
                 </table>';
     $html .= "<h1>Reporte General de Eventos con  las siguientes caracteristicas: </h1>";
     $html .= '
                 <table border="1">
                 <tr colspan="1"  width="5" heigth="5">
                     <td colspan="1" bgColor="#429DED"><p align="center"><b> Fecha </b></p></td>
                 </tr>
                   <tr colspan="1"  width="5" heigth="5">    
                     <td colspan="1" bgColor=""><p align="center"><b> ' . date("Y-m-d", strtotime($this->input->get('fecha'))) . '</b></p></td>
                 </tr>
                  
                 </table>';
     $condicion = 'evento.fechatope="' . $fecha . '"';
     $reporte = $this->evento_model->cargarListaEventoSeleccionPDF($condicion);
     $html .= "<H1></h1>";
     if ($reporte->num_rows() > 0) {
         $html .= '
                 <table border="1">
                
                 <tr colspan="8">
                     <td colspan="3" bgColor="#429DED"><p align="center"><b>Titulo</b></p></td>
                     <td colspan="10" bgColor="#429DED"><p align="center"><b>Descripción</b></p></td>
                     <td colspan="2" bgColor="#429DED"><p align="center"><b>Tipo de Evento</b></p></td>
                      <td colspan="2" bgColor="#429DED"><p align="center"><b>Sector</b></p></td>
                       <td colspan="2" bgColor="#429DED"><p align="center"><b>Alcance</b></p></td>
                     <td colspan="2" bgColor="#429DED"><p align="center"><b>Agente</b></p></td>
                     <td colspan="2.5" bgColor="#429DED"><p align="center"><b>Estatus</b></p></td>
                     
                 </tr>';
         foreach ($reporte->result_array() as $fila2) {
             $html .= '<tr colspan="8">
                         <td colspan="3"><p align="center">' . $fila2['titulo'] . '</p></td>
                         <td colspan="10"><p align="center">' . $fila2['descripcion'] . '</p></td>
                         <td colspan="2"><p align="center">' . $fila2['tipoEv'] . '</p></td>
                         <td colspan="2"><p align="center">' . $fila2['sector'] . '</p></td>
                              <td colspan="2"><p align="center">' . $fila2['alcance'] . '</p></td>
                         <td colspan="2"><p align="center">' . $fila2['agente'] . '</p></td>
                         <td colspan="2.5"><p align="center">' . $fila2['estatus'] . '</p></td>
                         
                     </tr>';
         }
         $html .= '<tr>
                      <td colspan="21"><p align="right"> Cantidad de Eventos:  </p></td>
                      <td colspan="2"><p align="center">' . $reporte->num_rows() . '</p></td>
                     </tr>
                 </table>';
     } else {
         $html .= '<h1>No se encuentra eventos registrados para la fecha seleccionada.</h1>';
     }
     $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');
 }
Example #22
0
 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');
 }
Example #23
0
 public function actionPdfAdmin($year, $month, $nip)
 {
     $roles = Rights::getAssignedRoles(Yii::app()->user->Id);
     foreach ($roles as $role) {
         $cekrole = $role->name;
     }
     if ($cekrole == 'employee') {
         $status = Yii::app()->user->Id;
         //$nip = $this->loadModel2($status); /*User::model()->findByAttributes(array('id'=>$status));*/
         $command = Yii::app()->db->createCommand();
         $nipUser = $command->select('*')->from('profiles')->where('user_id=:id', array(':id' => $status))->queryRow();
     }
     if ($cekrole != 'supervisorMorena' and $cekrole != 'Admin' and $cekrole != 'adminMorena' and $nipUser['nip'] != $nip) {
         throw new CHttpException(403, 'You are not authorized to perform this action.');
     }
     $pdf = new Pdf('L', 'mm', 'A4');
     $noSlip = $year . $month . $nip;
     $model = $this->loadModelPdfAdmin($noSlip);
     if ($model == null) {
         throw new CHttpException(772, 'Salary Slip cannot be found in Database, please check NIP, Year, or Month in Payroll Management.');
     }
     $model2 = $this->loadModel2($nip);
     if ($model2 == null) {
         throw new CHttpException(772, 'Data Employee not found!');
     }
     $pdf->AliasNbPages();
     $pdf->AddPage();
     $pdf->SetFont('Arial', '', 12);
     $pdf->mySurat($model2['firstname'], $model2['lastname'], $model2['position'], $model2['departement'], $model2['location'], $model2['class'], $model2['marriageStatus'], $model->noSlipGaji, $model->year, $model->month, $model->nip, $model->workDays, $model->grossSalary, $model->fixAllowance, $model->pulse, $model->medicalAllowance, $model->overtime, $model->bonus, $model->thr, $model->correctionPlus, $model->incentive, $model->jobAllowance, $model->marriageAllowance, $model->houseAllowance, $model->maternityAllowance, $model->glassesAllowance, $model->condolanceAllowance, $model->separationPay, $model->opex, $model->coc, $model->pph21, $model->bpjs, $model->jamsostek, $model->benefitMin, $model->copAllowanceMin, $model->koperasi, $model->mcs, $model->loan, $model->meal, $model->transport, $model->taskForceAllowance);
     $pdf->Output("SALARY-SLIP-" . $model->nip . '-' . $model->month . '-' . $model->year . ".pdf", 'D');
     //	}
     //	else {
     //				throw new CHttpException(403,'You are not authorized to perform this action.');
     //				}
 }
Example #24
0
    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 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');
 }
Example #26
0
    exit(0);
}
$query = "select count(scantime) as count from vuln_nessus_results t1\n       where report_id  in ({$report_id}) and falsepositive='N'";
$result = $dbconn->execute($query);
$numofresults = $result->fields['count'];
if ($numofresults < 1) {
    die(_("No vulnerabilities recorded"));
}
$chinese = false;
// the language is not chinese by default
//start pdf file, add page, set font
$pdf = new Pdf();
$pdf->AddGBFont();
$pdf->AddBig5Font();
$pdf->AddPage();
$pdf->SetFont('Helvetica', 'B', 13);
if (Session::is_pro()) {
    if ($siteLogo != '') {
        $pdf->Image($siteLogo, 10, 11, 40);
    } else {
        $pdf->Image("../pixmaps/logo_siempdf.png", 10, 11, 40);
    }
} else {
    $pdf->Image("../pixmaps/logo_ossimpdf.png", 10, 11, 40);
}
$pdf->Ln();
$pdf->Cell(0, 16, "    {$siteBranding}: I.T Security Vulnerability Report", 1, 1, 'C', 0);
$scan_time = _("Scan time");
$generated = _("Generated");
if (preg_match('/&#(\\d{4,5});/', $scan_time)) {
    $scan_time = mb_convert_encoding($scan_time, 'Big5', 'HTML-ENTITIES');
Example #27
0
 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');
 }
 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');
 }
Example #29
0
 public function ticketPdf()
 {
     $ticket = $this->input->get("ticket");
     $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;
     $buscarTicket = $this->ticket_model->buscarTicket($ticket);
     $buscarTicketSector = $this->ticket_model->buscarTicketSector($ticket);
     if ($buscarTicket) {
         foreach ($buscarTicket as $fila1) {
             $html = '';
             $html .= "<style type=text/css>";
             $html .= "td{ color: #222}";
             $html .= "</style>";
             $html .= '<table border="0">
             <tr colspan="6">                        
                 <td colspan="2" align="left"><img alt="Imagen" src="imagen/logo/logoborde.png" width="220" heigth="90"/></td>
                 <td colspan="2" ><br></td>
                 <td colspan="2"><p align="right"><b>República Bolivariana de Venezuela<br>Gobernación del Estado Lara</b></p></td>
             </tr><br>
             <tr colspan="6">
                 <td colspan="6" align="right"><b>Ticket: ' . $fila1->codigo . '</b></td><br>
             </tr>
             <tr colspan="6">
                 <td colspan="6" align="right"><b>Barquisimeto, ' . $fila1->fecha . '</b></td>
             </tr><br>
             <tr colspan="6">
                 <td colspan="6" align="center"><b>REQUERIMIENTO</b></td>
             </tr>
             </table><br>
             
             <table border="1">                
             <tr colspan="6">
                 <td colspan="2" bgColor="#DCDCDC"><p align="center"><b>Solicitante:</b></p></td>
                 <td colspan="4"><p align="center">' . $fila1->solicitante . '</p></td><br>
             </tr>
             <tr colspan="6">
                 <td colspan="2" bgColor="#DCDCDC"><p align="center"><b>Tipo de requerimiento:</b></p></td>
                 <td colspan="4"><p align="center">' . $fila1->nombretipo . '</p></td><br>
             </tr>
             </table><br>';
             if ($fila1->tipoticket == 3) {
                 $html .= '
                 <table border="1">
                 <tr colspan="8">
                     <td colspan="8" bgColor="#DCDCDC"><p align="center"><b>DESCRIPCIÓN REQUERIMIENTO.-</b></p></td>
                 </tr>
                 <tr colspan="8">
                     <td colspan="3" bgColor="#DCDCDC"><p align="center"><b>Tipo de ayuda</b></p></td>
                     <td colspan="3" bgColor="#DCDCDC"><p align="center"><b>Descripción</b></p></td>
                     <td colspan="2" bgColor="#DCDCDC"><p align="center"><b>Cantidad</b></p></td>
                 </tr>';
                 foreach ($buscarTicketSector as $fila2) {
                     $variable = $fila2->nombresector;
                     $html .= '<tr colspan="8">
                         <td colspan="3"><p align="center">' . $fila2->ayudaticket . '</p></td>
                         <td colspan="3"><p align="center">' . $fila2->descripcion . '</p></td>
                         <td colspan="2"><p align="center">' . $fila2->cantidad . '</p></td>
                     </tr>';
                 }
                 $html .= '<tr colspan="8">
                     <td colspan="8" bgColor="#DCDCDC"><p align="center">SECTOR RELACIONADO AL REQUERIMIENTO: ' . $variable . '</p></td><br>
                 </tr>
                 </table>';
             } else {
                 $html .= '<table border="1">
                 <tr colspan="6">
                     <td colspan="6" bgColor="#DCDCDC"><p align="center">SECTOR RELACIONADO AL REQUERIMIENTO: ' . $fila1->nombresector . '</p></td><br>
                 </tr>
                 <tr colspan="6">
                     <td colspan="6" bgColor="#DCDCDC"><p align="center">DESCRIPCIÓN REQUERIMIENTO.-</p></td><br>
                 </tr>                
                 <tr colspan="6">
                     <td colspan="6"><p align="justify">' . $fila1->descripcion . '</p></td><br>
                 </tr>
                 </table>';
             }
         }
     } else {
         $pdf->SetFont('Times', 'B', 18);
         $pdf->Text(5, 25, 'No se encuentra Documento con las características indicadas.');
     }
     $nombre_archivo = utf8_decode("ticket.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');
 }
Example #30
0
    public function exportInvoice($ids)
    {
        $pdf = new Pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8');
        $pdf->SetCreator(PDF_CREATOR);
        $pdf->SetAuthor('Gekosale');
        $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, 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->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->setLanguageArray(1);
        $pdf->SetFont('dejavusans', '', 10);
        $sql = 'SELECT 
					*
				FROM invoice
				WHERE 
					idinvoice IN (' . implode(',', $ids) . ')';
        $stmt = Db::getInstance()->prepare($sql);
        $stmt->execute();
        $Data = array();
        while ($rs = $stmt->fetch()) {
            switch ($rs['contenttype']) {
                case 'html':
                    $data = $rs['contentcopy'];
                    $pdf->AddPage();
                    $pdf->writeHTML($data, true, 0, true, 0);
                    break;
            }
        }
        @ob_clean();
        $pdf->Output('Faktury z ' . date('Y-m-d'), 'D');
    }