Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/11/2004, 08:12
Gunslinger
 
Fecha de Ingreso: noviembre-2004
Mensajes: 4
Antigüedad: 19 años, 5 meses
Puntos: 0
analisa este codigo y me avisas!!!!

include ("conexion.php");
$conexion=conexion();
if (!isset($pag))
$pag = 1; // Por defecto, pagina 1
$tampag = 10;
$reg1 = ($pag-1) * $tampag;
if ($ip!=''){
$stmt = OCIParse($conexion,"select ip.ip, pc.nombre_red, pc.mac,pc.grupo_red,usuario.nombre, depto.depto from ip,pc,usuario,depto where pc.ip=ip.idip and pc.usuario=usuario.id and usuario.depto=depto.iddepto and ip.ip like '$ip%'");
}else{
$nombre1=strtolower($nombre);
$nombres=ucwords($nombre1);
$stmt = OCIParse($conexion,"select ip.ip, pc.nombre_red, pc.mac,pc.grupo_red,usuario.nombre, depto.depto from ip,pc,usuario,depto where pc.ip=ip.idip and pc.usuario=usuario.id and usuario.depto=depto.iddepto and usuario.nombre like '$nombres%'");
}
OCIExecute($stmt);
$nrows = OCIFetchStatement($stmt,$results);
if ( $nrows > 0 ) {
echo "<TABLE BORDER=1>";
echo "<TR><th><B>N° IP</B></TH> <th><B>Nombre de Red</B></TH>
<th><B>Mac</B></TH> <th><B>Grupo de Red</B></TH>
<th><B>Nombre</B></TH> <th><B>Depto</B></TH></TR>";
for ($i=$reg1; $i<(min($reg1+$tampag, $nrows)); $i++) {
reset($results);
echo "<TR>";
while ( $column = each($results) ) {
$data = $column['value'];
echo "<TD>$data[$i]</TD>";
}
echo "</TR>";
}
echo "</TABLE>";
} else {
echo "No hay datos en la consulta<BR>";
}
echo "$total Registros seleccionados<BR>";
OCIFreeStatement($stmt);
OCILogoff($conexion);
echo paginar($pag, $nrows, $tampag, "consulta.php?pag=");
print "</PRE>";
print "</HTML>\n";
?>