PageRenderTime 65ms CodeModel.GetById 35ms RepoModel.GetById 0ms app.codeStats 0ms

/sicpri/01_cobranzas/_pdf.php

https://bitbucket.org/webdev_pe/dmejiasoft
PHP | 89 lines | 81 code | 2 blank | 6 comment | 0 complexity | d428d3f1c89222b846cf9cc14b5dfde9 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: 8%; text-align: center;">FECHA REG.</th>
  34. <th style="width: 10%; text-align: center;">ESTADO</th>
  35. <th style="width: 5%; text-align: center;">TIPO</th>
  36. <th style="width: 10%; text-align: center;">UBICACI&Oacute;N</th>
  37. <th style="width: 10%; text-align: center;">OPERACI&Oacute;N</th>
  38. <th style="width: 10%; text-align: center;">PRECIO</th>
  39. <th style="width: 10%; text-align: center;">AREA TOTAL</th>
  40. <th style="width: 10%; text-align: center;">AREA CONST</th>
  41. </tr>
  42. </thead>
  43. <tbody>
  44. <?php $i=1; while($cell=$cn->resultado_sql()){ ?>
  45. <tr bgcolor="<?=($i%2==0)?"#ffffff":"#e2e4ff"?>">
  46. <td align="center"><?=$i++?></td>
  47. <td align="center"><?=$cell['cod_prp']?></td>
  48. <td align="center"><?=$cell['fecha']?></td>
  49. <td align="center"><?=$cell['est']?></td>
  50. <td align="center">
  51. <?php
  52. echo ($cell['residencial']==1)?" R":"";
  53. echo ($cell['comercial']==1)?" C":"";
  54. echo ($cell['industrial']==1)?" I":"";
  55. echo ($cell['terreno']==1)?" T":"";
  56. echo ($cell['proyecto']==1)?" P":"";
  57. ?>
  58. </td>
  59. <td align="left"><?=$cell['nom_dep']." - ".$cell['nom_prv']." - ".$cell['nom_dst'];?></td>
  60. <td align="center"><?=$cell['opr']?></td>
  61. <td align="right"><span><?=($cell['mon_prp']=="$")?$cell['mon_prp']:"S/."?></span><?=number_format($cell['prc_prp'],2,".",",")?></td>
  62. <td align="right"><?=$cell['art_prp']?></td>
  63. <td align="right"><?=$cell['act_prp']?></td>
  64. </tr>
  65. <?php } $cn->limpiar_sql(); $cn->cerrar_sql(); ?>
  66. </tbody>
  67. </table>
  68. <!-- ############################################## inicio ############################################## -->
  69. </page>
  70. <?php
  71. $content = ob_get_clean();
  72. $nombre="reporte.pdf";
  73. #$fuente=$cell['fuente'];
  74. require_once('../../poo/html2pdf_v4.03/html2pdf.class.php');
  75. try{
  76. #$html2pdf = new HTML2PDF('P', 'A4', 'fr');
  77. $html2pdf = new HTML2PDF('P', 'A4', 'es', true, 'UTF-8', 0);
  78. #$html2pdf->pdf->IncludeJS($script);
  79. #$html2pdf->setDefaultFont($fuente);
  80. $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
  81. #$html2pdf->createIndex('Índice', 25, 12, false, true, 1);
  82. $html2pdf->Output("sicpri_reporte_propiedades.pdf");
  83. }catch(HTML2PDF_exception $e) {
  84. echo $e;
  85. exit;
  86. }
  87. ?>