Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('conexion.php');
- $desde = $_POST['desde'];
- $hasta = $_POST['hasta'];
- //COMPROBAMOS QUE LAS FECHAS EXISTAN
- if(isset($desde)==false){
- $desde = $hasta;
- }
- if(isset($hasta)==false){
- $hasta = $desde;
- }
- //EJECUTAMOS LA CONSULTA DE BUSQUEDA
- $registro = "SELECT * FROM tarificado.rep_con WHERE fecha_dcms BETWEEN '$desde' AND '$hasta'";
- echo '<table class="table table-striped table-condensed table-hover">
- <tr>
- <th width="200">central</th>
- <th width="150">centrales_nombre</th>
- <th width="150">fecha_dcms</th>
- <th width="150">archivo_dcms</th>
- <th width="150">correlativo_dcms</th>
- <th width="150">bytes_dcms</th>
- <th width="150">archivo_ivr</th>
- <th width="150">correlativo_ivr</th>
- <th width="150">fecha_ivr</th>
- <th width="150">bytes_ivr</th>
- <th width="150">ivr_num_eventos</th>
- <th width="150">dif_bytes</th>
- </tr>';
- if(($registro)>0);
- {
- while($registro2 =($registro)){
- echo '<tr>
- <td>'.$registro2['Central'].'</td>
- <td>'.$registro2['centrales_nombre'].'</td>
- <td>'.$registro2['fecha_dcms'].'</td>
- <td>'.$registro2['archivo_dcms'].'</td>
- <td>'.$registro2['correlativo_dcms'].'</td>
- <td>'.$registro2['bytes_dcms'].'</td>
- <td>'.$registro2['archivo_ivr'].'</td>
- <td>'.$registro2['correlativo_ivr'].'</td>
- <td>'.$registro2['fecha_ivr'].'</td>
- <td>'.$registro2['bytes_ivr'].'</td>
- <td>'.$registro2['ivr_num_eventos'].'</td>
- <td>'.$registro2['dif_bytes'].'</td>
- </tr>';
- }
- **}else{** <---- esta es la linea 55.
- echo '<tr>
- <td colspan="6">No se encontraron resultados</td>
- </tr>';
- }
- echo '</table>';
- ?>
- <?php
- function conectar_PostgreSQL( $usuario, $pass, $host, $bd )
- {
- $conexion = pg_connect( "user=".$usuario." ".
- "password=".$pass." ".
- "host=".$host." ".
- "dbname=".$bd
- ) or die( "Error al conectar: ".pg_last_error() );
- return $conexion;
- }
- ?>
- <?php
- function buscarPersona( $conexion, $id )
- {
- $sql = "SELECT * FROM tbl_personas WHERE id=".$id."";
- $devolver = null;
- // Ejecutar la consulta:
- $rs = pg_query( $conexion, $sql );
- if( $rs )
- {
- // Si se encontrĂ³ el registro, se obtiene un objeto en PHP con los datos de los campos:
- if( pg_num_rows($rs) > 0 )
- $devolver = pg_fetch_object( $rs, 0 );
- }
- return $devolver;
- }
- ?>
Add Comment
Please, Sign In to add comment