PageRenderTime 39ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/sicpri/12_usuarios/_pdf.php

https://bitbucket.org/webdev_pe/dmejiasoft
PHP | 75 lines | 67 code | 2 blank | 6 comment | 0 complexity | d97f3d4cb7c1525e74a823f19fc43fb2 MD5 | raw file
  1. <?php
  2. session_start();
  3. ob_start();
  4. require("../../poo/clases/getConection.php");
  5. $cn=new getConection();
  6. $sql=utf8_decode(base64_decode($_GET['s']));
  7. $cn->ejecutar_sql(base64_encode($sql));
  8. ?>
  9. <style type="text/css">
  10. <!--
  11. table.page_header {width: 100%; border: none; background-color: #ededed; color:#666666; border-bottom: solid 1mm #666666; padding: 2mm }
  12. table.page_footer {width: 100%; border: none; background-color: #ededed; color:#666666; border-top: solid 1mm #666666; padding: 2mm}
  13. #list_rpt{ margin:0 auto; font-size:10px;}
  14. -->
  15. </style>
  16. <page backtop="15mm" backbottom="15mm" backleft="3mm" backright="3mm" style="font-size: 11pt">
  17. <page_header>
  18. <table class="page_header">
  19. <tr><td style="width: 100%; text-align: left">Sistema Integral de Control y Procesos de Racaudaci&oacute;n de Inmuebles</td></tr>
  20. </table>
  21. </page_header>
  22. <page_footer>
  23. <table class="page_footer">
  24. <tr><td style="width: 100%; text-align: right">p&aacute;gina [[page_cu]]/[[page_nb]]</td></tr>
  25. </table>
  26. </page_footer>
  27. <!-- ############################################## inicio ############################################## -->
  28. <table id="list_rpt" style="width: 100%;" align="center">
  29. <thead>
  30. <tr bgcolor="#b9bdc4">
  31. <th style="width: 2%; text-align: center;">N&ordm;</th>
  32. <th style="width: 8%; text-align: center;">CODIGO</th>
  33. <th style="width: 25%; text-align: center;">NOMBRES Y APELLIDOS</th>
  34. <th style="width: 10%; text-align: center;">DOCUMENTO</th>
  35. <th style="width: 10%; text-align: center;">N&ordm;</th>
  36. <th style="width: 20%; text-align: center;">EMAIL</th>
  37. <th style="width: 15%; text-align: center;">USUARIO</th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. <?php $i=1; while($cell=$cn->resultado_sql()){ ?>
  42. <tr bgcolor="<?=($i%2==0)?"#ffffff":"#e2e4ff"?>">
  43. <td align="center"><?=$i++?></td>
  44. <td align="center"><?=$cell['cod_usu']?></td>
  45. <td align="center"><?=$cell['nombres']?></td>
  46. <td align="center"><?=$cell['tipo_doc']?></td>
  47. <td align="center"><?=$cell['num_dni']?></td>
  48. <td align="center"><?=$cell['eml_usu']?></td>
  49. <td align="center"><?=$cell['user']?></td>
  50. </tr>
  51. <?php } $cn->limpiar_sql(); $cn->cerrar_sql(); ?>
  52. </tbody>
  53. </table>
  54. <!-- ############################################## inicio ############################################## -->
  55. </page>
  56. <?php
  57. $content = ob_get_clean();
  58. $nombre="reporte.pdf";
  59. #$fuente=$cell['fuente'];
  60. require_once('../../poo/html2pdf_v4.03/html2pdf.class.php');
  61. try{
  62. #$html2pdf = new HTML2PDF('P', 'A4', 'fr');
  63. $html2pdf = new HTML2PDF('P', 'A4', 'es', true, 'UTF-8', 0);
  64. #$html2pdf->pdf->IncludeJS($script);
  65. #$html2pdf->setDefaultFont($fuente);
  66. $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
  67. #$html2pdf->createIndex('Índice', 25, 12, false, true, 1);
  68. $html2pdf->Output("sicpri_reporte_usuarios.pdf");
  69. }catch(HTML2PDF_exception $e) {
  70. echo $e;
  71. exit;
  72. }
  73. ?>