Advertisement
Guest User

Untitled

a guest
Feb 24th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. <!-- MODULO CABECERA -->
  2. <?php
  3. include "views/modules/cabecera.php";
  4. ?>
  5.  
  6. <!-- MODULO BOTONERA -->
  7. <?php
  8. include "views/modules/botonera.php";
  9. ?>
  10.  
  11. <?php
  12.  
  13. if(isset($_POST['pdfPrint'])){
  14.  
  15. require_once "../lib/tcpdf/tcpdf/tcpdf.php";
  16.  
  17. $pdf = new TCPDF('P', 'mm', 'A4', true, 'UTF-8', false);
  18. $pdf->SetCreator(PDF_CREATOR);
  19. $pdf->SetAuthor('Miguel Caro');
  20. $pdf->SetTitle($_POST['reporte_name']);
  21. $pdf->setPrintHeader(false);
  22. $pdf->setPrintFooter(false);
  23. $pdf->SetMargins(20, 20, 20, false);
  24. $pdf->SetAutoPageBreak(true, 20);
  25. $pdf->SetFont('Helvetica', '', 10);
  26. $pdf->addPage();
  27.  
  28. $content = '';
  29.  
  30. $content .= '
  31. <div class="row">
  32. <div class="col-md-12">
  33.  
  34. <table border="1" cellpadding="5">
  35. <thead>
  36. <tr>
  37. <th>DNI</th>
  38. <th>A. PATERNO</th>
  39. <th>A. MATERNO</th>
  40. <th>NOMBRES</th>
  41. <th>AREA</th>
  42. <th>SUELDO</th>
  43. </tr>
  44. </thead>
  45. ';
  46.  
  47. $content .= '</table>';
  48.  
  49. $content .= '
  50. <div class="row padding">
  51. <div class="col-md-12" style="text-align:center;">
  52. <span>Pdf Creator </span><a href="http://www.redecodifica.com">By Miguel Angel</a>
  53. </div>
  54. </div>
  55.  
  56. ';
  57.  
  58. $pdf->writeHTML($content, true, 0, true, 0);
  59.  
  60. $pdf->lastPage();
  61. $pdf->output('Reporte.pdf', 'I');
  62. }
  63.  
  64. ?>
  65.  
  66.  
  67. <!-- Content Wrapper. Contains page content -->
  68. <div class="content-wrapper">
  69. <!-- Content Header (Page header) -->
  70. <section class="content-header">
  71. <h1>
  72. Reportes
  73. <small>Reporte de Lote y Orden de Trabajo</small>
  74. </h1>
  75. </section>
  76. <!-- Main content -->
  77. <section class="content container-fluid">
  78. <br><br><br>
  79.  
  80. <div class="reporte">
  81. <input type="text" id="loteReport" class="text" placeholder="Digite el lote">
  82. <button class="btn btn-primary" id="reportBtn">Buscar lote para reporte</button>
  83. </div>
  84. <form action="POST">
  85. <button class="btn btn-secondary" name="pdfPrint">Imprimir</button>
  86. </form>
  87. <br><br>
  88.  
  89. </section>
  90. <!-- /.content -->
  91. </div>
  92. <!-- /.content-wrapper -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement