Example #1
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');
 }
Example #2
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');
 }
$pdf->AddPage();
$pdf->SetFont('Arial', '', 12);
$pdf->SetY(40);
$pdf->SetFont('Arial', '');
$pdf->SetY(60);
$pdf->MultiCell(0, 15, "Cashier: " . $data->get_fullname($_SESSION['id']));
$pdf->MultiCell(0, 15, "Date: " . date('F j,Y'));
$pdf->MultiCell(0, 15, "Shift: " . $_SESSION['shift']);
$y_axis_initial = 110;
$pdf->SetY($y_axis_initial);
$pdf->SetX(45);
//print column titles
$pdf->SetFillColor(252, 124, 5);
$pdf->SetLineWidth(1);
$pdf->SetFont('Arial', '', 11);
$pdf->Cell(265, 16, 'Item Name', 1, 0, 'C', 1);
$pdf->Cell(60, 16, 'Beg. In.', 1, 0, 'C', 1);
$pdf->Cell(50, 16, 'Add. In.', 1, 0, 'C', 1);
$pdf->Cell(50, 16, 'Add. Out.', 1, 0, 'C', 1);
$pdf->Cell(50, 16, 'End. In.', 1, 0, 'C', 1);
$pdf->Cell(50, 16, 'Sold', 1, 0, 'C', 1);
$row_height = 16;
$y_axis = $y_axis_initial + $row_height;
$connect = new mysqli('localhost', 'root', '', 'dsr');
$resultX = mysqli_query($connect, "SELECT * FROM particulars");
$x = 0;
while ($row = mysqli_fetch_object($resultX)) {
    $item_name = $row->item_name;
    $inventory = $row->inventory;
    $additional_in = $row->additional_in;
    $additional_out = $row->additional_out;
 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();
 }
Example #5
0
$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');
    $generated = mb_convert_encoding($generated, 'Big5', 'HTML-ENTITIES');
    $pdf->SetFont('Big5', '', 9);
    $chinese = true;
} else {
    $scan_time = mb_convert_encoding($scan_time, 'ISO-8859-1', 'HTML-ENTITIES');
    $generated = mb_convert_encoding($generated, 'ISO-8859-1', 'HTML-ENTITIES');
    $pdf->SetFont('Helvetica', '', 9);
}
$job_label = _("Job Name:");
if (!empty($report_id)) {
    // Check if exists _feed tables
Example #6
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;
 }
Example #7
0
$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_ossimpdf.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');
    $generated = mb_convert_encoding($generated, 'Big5', 'HTML-ENTITIES');
    $pdf->SetFont('Big5', '', 9);
    $chinese = true;
} else {
    $scan_time = mb_convert_encoding($scan_time, 'ISO-8859-1', 'HTML-ENTITIES');
    $generated = mb_convert_encoding($generated, 'ISO-8859-1', 'HTML-ENTITIES');
    $pdf->SetFont('Helvetica', '', 9);
}
$pdf->Cell(30, 6, $scan_time . ":", 1, 0, 'L');
$scan_time_value = $ipl == '' ? "{$scanyear}-{$scanmonth}-{$scanday} {$scanhour}:{$scanmin}:{$scansec}" : '-';
$pdf->Cell(65, 6, $scan_time_value, 1, 0, 'L');
Example #8
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 #9
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');
 }
Example #10
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');
 }
 public function download_receipt()
 {
     $startDate = new DateTime($this->get_data_from_post_or_session('arrival_date'));
     $endDate = new DateTime($this->get_data_from_post_or_session('departure_date'));
     $room = $this->Room->get_room($this->get_data_from_post_or_session('room'));
     $first_name = $this->get_data_from_post_or_session('first_name');
     $last_name = $this->get_data_from_post_or_session('last_name');
     $email = $this->get_data_from_post_or_session('email');
     $stripeToken = $this->get_data_from_post_or_session('stripeToken');
     $pdf = new Pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     $pdf->AddPage();
     $pdf->SetFont('times', 'B', 20);
     $pdf->Cell(0, 10, 'Reservation Receipt', 0, 1, 'L');
     $pdf->SetFont('times', 'B', 16);
     $pdf->Cell(0, 10, 'Arrival Date', 0, 1, 'L');
     $pdf->SetFont('times', '', 16);
     $pdf->Cell(0, 10, $startDate->format('Y-m-d'), 0, 1, 'L');
     $pdf->SetFont('times', 'B', 16);
     $pdf->Cell(0, 10, 'Departure Date', 0, 1, 'L');
     $pdf->SetFont('times', '', 16);
     $pdf->Cell(0, 10, $endDate->format('Y-m-d'), 0, 1, 'L');
     $pdf->SetFont('times', 'B', 16);
     $pdf->Cell(0, 10, 'Room', 0, 1, 'L');
     $pdf->SetFont('times', '', 16);
     $pdf->Cell(0, 10, $room->number . ', ' . $room->name, 0, 1, 'L');
     $pdf->SetFont('times', 'B', 16);
     $pdf->Cell(0, 10, 'Rate', 0, 1, 'L');
     $pdf->SetFont('times', '', 16);
     $pdf->Cell(0, 10, '$' . $room->rate, 0, 1, 'L');
     $pdf->SetFont('times', 'B', 16);
     $pdf->Cell(0, 10, 'Name', 0, 1, 'L');
     $pdf->SetFont('times', '', 16);
     $pdf->Cell(0, 10, $first_name . ' ' . $last_name, 0, 1, 'L');
     $pdf->SetFont('times', 'B', 16);
     $pdf->Cell(0, 10, 'Email', 0, 1, 'L');
     $pdf->SetFont('times', '', 16);
     $pdf->Cell(0, 10, $email, 0, 1, 'L');
     $pdf->Output('reservation_receipt.pdf', 'D');
 }