Guest User

Untitled

a guest
Apr 18th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.84 KB | None | 0 0
  1. <?php
  2. include('conexion.php');
  3.  
  4. $desde = $_POST['desde'];
  5. $hasta = $_POST['hasta'];
  6.  
  7. //COMPROBAMOS QUE LAS FECHAS EXISTAN
  8. if(isset($desde)==false){
  9. $desde = $hasta;
  10. }
  11.  
  12. if(isset($hasta)==false){
  13. $hasta = $desde;
  14. }
  15.  
  16. //EJECUTAMOS LA CONSULTA DE BUSQUEDA
  17.  
  18. $registro = "SELECT * FROM tarificado.rep_con WHERE fecha_dcms BETWEEN '$desde' AND '$hasta'";
  19.  
  20.  
  21. echo '<table class="table table-striped table-condensed table-hover">
  22. <tr>
  23. <th width="200">central</th>
  24. <th width="150">centrales_nombre</th>
  25. <th width="150">fecha_dcms</th>
  26. <th width="150">archivo_dcms</th>
  27. <th width="150">correlativo_dcms</th>
  28. <th width="150">bytes_dcms</th>
  29. <th width="150">archivo_ivr</th>
  30. <th width="150">correlativo_ivr</th>
  31. <th width="150">fecha_ivr</th>
  32. <th width="150">bytes_ivr</th>
  33. <th width="150">ivr_num_eventos</th>
  34. <th width="150">dif_bytes</th>
  35. </tr>';
  36. if(($registro)>0);
  37. {
  38. while($registro2 =($registro)){
  39. echo '<tr>
  40. <td>'.$registro2['Central'].'</td>
  41. <td>'.$registro2['centrales_nombre'].'</td>
  42. <td>'.$registro2['fecha_dcms'].'</td>
  43. <td>'.$registro2['archivo_dcms'].'</td>
  44. <td>'.$registro2['correlativo_dcms'].'</td>
  45. <td>'.$registro2['bytes_dcms'].'</td>
  46. <td>'.$registro2['archivo_ivr'].'</td>
  47. <td>'.$registro2['correlativo_ivr'].'</td>
  48. <td>'.$registro2['fecha_ivr'].'</td>
  49. <td>'.$registro2['bytes_ivr'].'</td>
  50. <td>'.$registro2['ivr_num_eventos'].'</td>
  51. <td>'.$registro2['dif_bytes'].'</td>
  52. </tr>';
  53. }
  54. **}else{** <---- esta es la linea 55.
  55. echo '<tr>
  56. <td colspan="6">No se encontraron resultados</td>
  57. </tr>';
  58. }
  59.  
  60. echo '</table>';
  61. ?>
  62.  
  63. <?php
  64. function conectar_PostgreSQL( $usuario, $pass, $host, $bd )
  65. {
  66. $conexion = pg_connect( "user=".$usuario." ".
  67. "password=".$pass." ".
  68. "host=".$host." ".
  69. "dbname=".$bd
  70. ) or die( "Error al conectar: ".pg_last_error() );
  71. return $conexion;
  72. }
  73. ?>
  74.  
  75. <?php
  76. function buscarPersona( $conexion, $id )
  77. {
  78. $sql = "SELECT * FROM tbl_personas WHERE id=".$id."";
  79. $devolver = null;
  80. // Ejecutar la consulta:
  81. $rs = pg_query( $conexion, $sql );
  82. if( $rs )
  83. {
  84. // Si se encontrĂ³ el registro, se obtiene un objeto en PHP con los datos de los campos:
  85. if( pg_num_rows($rs) > 0 )
  86. $devolver = pg_fetch_object( $rs, 0 );
  87. }
  88. return $devolver;
  89. }
  90. ?>
Add Comment
Please, Sign In to add comment