Les pongo es codigo del script:
Código PHP:
<?
session_start();
?>
<html>
<head>
<title>Listado Inmueble</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<link href="../../vista/css/estilos.css" rel="stylesheet" type="text/css">
<link href="../css/estilos.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="Layer1" style="position:absolute; width:800px; height:600px; z-index:1; left: 10; top: 10; visibility: visible;">
<?
if(!$_GET['pg']){
$i = 0;
$cantidad=2; // cantidad de resultados por página
$j = $cantidad;
$pg = 0; // $pg es la pagina actual
}else{
$cantidad=2; // cantidad de resultados por página
$i = $pg * $cantidad;
$j = $i + $cantidad;
}
$contar = sizeof($s_datos_inmueble);
$pages = intval($contar / $cantidad);
?>
<table width="800" border="0" cellspacing="0">
<tr bgcolor="#66FF66">
<th width="150" bgcolor="#66FF66">CÓDIGO INMUEBLE</th>
<th width="150">PAIS</th>
<th width="200">PROVINCIA</th>
<th width="150">TIPO INMUEBLE</th>
<th width="150">OPCIÓN</th>
</tr>
<?
// Imprimiendo los resultados
for($i;$i<$j;$i++){
if(($i % 2) == 0){?>
<tr bgcolor="#00CCFF" onMouseOver='this.style.background="#FF0000"' onMouseOut='this.style.background="#00CCFF"'>
<?
}else{
?>
<tr bgcolor="#33FFFF" onMouseOver='this.style.background="#FF0000"' onMouseOut='this.style.background="#33FFFF"'>
<?
}
?>
<td><div align="center"><a href="../../clases/clase_controlador.php?operacion=Mostrar Datos Inmueble&opcion=Consulta Inmueble&codigo=<?echo $s_datos_inmueble[$i]['Codigo_Inmueble']?>"><?echo $s_datos_inmueble[$i]['Codigo_Inmueble']?></a></div></td>
<td><div align="center"><?echo $s_datos_inmueble[$i]['Pais']?></div></td>
<td><div align="center"><?echo $s_datos_inmueble[$i]['Provincia']?></div></td>
<td><div align="center"><?echo $s_datos_inmueble[$i]['Tipo_Inmueble']?></div></td>
<td><div align="center"><?echo $s_datos_inmueble[$i]['Opcion']?></div></td>
</tr>
<?
}
?>
</table>
<br>
<?
// Creando los enlaces de paginación
?>
<div align="center"><br>
<br>
LINKS<br>
<br>
<?
if($pg <> 0){
$url = $pg - 1;
?>
<a href="../busquedas/listado_inmueble.php?pg=<?echo $url?>">««ANTERIOR««</a>
<?
}else{
echo "««ANTERIOR«« ";
}
for($k = 0; $k<($pages); $k++){
if($k == $pg){
?>
<font face=Arial size=4 color=ff0000><b><? echo $k ?></b></font>
<?
}else{
?>
<a href="../busquedas/listado_inmueble.php?pg=<?echo $k?>"><? echo $k ?></a>
<?
}
}
if($pg < $pages - 1){
$url = $pg + 1;
?>
<a href="../busquedas/listado_inmueble.php?pg=<?echo $url?>">»»SIGUIENTE»»</a>
<?
}else{
echo " »»SIGUIENTE»»";
}
?>
</div>
</div>
</body>
</html>