Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- MODULO CABECERA -->
- <?php
- include "views/modules/cabecera.php";
- ?>
- <!-- MODULO BOTONERA -->
- <?php
- include "views/modules/botonera.php";
- ?>
- <?php
- if(isset($_POST['pdfPrint'])){
- require_once "../lib/tcpdf/tcpdf/tcpdf.php";
- $pdf = new TCPDF('P', 'mm', 'A4', true, 'UTF-8', false);
- $pdf->SetCreator(PDF_CREATOR);
- $pdf->SetAuthor('Miguel Caro');
- $pdf->SetTitle($_POST['reporte_name']);
- $pdf->setPrintHeader(false);
- $pdf->setPrintFooter(false);
- $pdf->SetMargins(20, 20, 20, false);
- $pdf->SetAutoPageBreak(true, 20);
- $pdf->SetFont('Helvetica', '', 10);
- $pdf->addPage();
- $content = '';
- $content .= '
- <div class="row">
- <div class="col-md-12">
- <table border="1" cellpadding="5">
- <thead>
- <tr>
- <th>DNI</th>
- <th>A. PATERNO</th>
- <th>A. MATERNO</th>
- <th>NOMBRES</th>
- <th>AREA</th>
- <th>SUELDO</th>
- </tr>
- </thead>
- ';
- $content .= '</table>';
- $content .= '
- <div class="row padding">
- <div class="col-md-12" style="text-align:center;">
- <span>Pdf Creator </span><a href="http://www.redecodifica.com">By Miguel Angel</a>
- </div>
- </div>
- ';
- $pdf->writeHTML($content, true, 0, true, 0);
- $pdf->lastPage();
- $pdf->output('Reporte.pdf', 'I');
- }
- ?>
- <!-- Content Wrapper. Contains page content -->
- <div class="content-wrapper">
- <!-- Content Header (Page header) -->
- <section class="content-header">
- <h1>
- Reportes
- <small>Reporte de Lote y Orden de Trabajo</small>
- </h1>
- </section>
- <!-- Main content -->
- <section class="content container-fluid">
- <br><br><br>
- <div class="reporte">
- <input type="text" id="loteReport" class="text" placeholder="Digite el lote">
- <button class="btn btn-primary" id="reportBtn">Buscar lote para reporte</button>
- </div>
- <form action="POST">
- <button class="btn btn-secondary" name="pdfPrint">Imprimir</button>
- </form>
- <br><br>
- </section>
- <!-- /.content -->
- </div>
- <!-- /.content-wrapper -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement