Foros del Web » Programando para Internet » PHP »

Ayuda con El PAGINATOR

Estas en el tema de Ayuda con El PAGINATOR en el foro de PHP en Foros del Web. Hola buenos dias me llamo aitor y llevo 4 dias peleando con el paginator. O no me pagina o me da Errores tontos alguien puede ...
  #1 (permalink)  
Antiguo 30/10/2010, 03:17
 
Fecha de Ingreso: octubre-2010
Mensajes: 1
Antigüedad: 13 años, 5 meses
Puntos: 0
Ayuda con El PAGINATOR

Hola
buenos dias
me llamo aitor
y llevo 4 dias peleando con el paginator.
O no me pagina o me da Errores tontos
alguien puede ayudarme?
es importante
gracias


<?php

$existen=0;
$contador=0;

//conexión a la base de datos
$con=mysql_connect("mysql5.gestionar.info","ab0308 ","anvi29");
mysql_select_db(ab4946,$con);
//tipo de artículo
$tipo=$_POST['tipo'];
$venta=$_POST['compra'];
$poblacion=$_POST['poblaciones'];

if ($venta=="si") {
$_pagi_sql="SELECT `pisos`. *
FROM pisos
WHERE (
(`pisos`.`tipo` = \"$tipo\") AND (`pisos`.`venta` = \"Venta\")
) ORDER BY `pisos`.`codigo` ASC";
}

if ($venta=="no") {
$_pagi_sql="SELECT `pisos`. *
FROM pisos
WHERE (
`pisos`.`tipo` = \"$tipo\" AND `pisos`.`venta` = \"Alquiler\"
) ORDER BY `pisos`.`codigo` ASC";
}

if ($poblacion<>"no") {
if ($venta=="si") {
$_pagi_sql="SELECT `pisos`. *
FROM pisos
WHERE (
(`pisos`.`tipo` = \"$tipo\") AND (`pisos`.`venta` = \"Venta\") AND (`pisos`.`localidad` = \"$poblacion\")
) ORDER BY `pisos`.`codigo` ASC";
}

if ($venta=="no") {
$_pagi_sql="SELECT `pisos`. *
FROM pisos
WHERE (
`pisos`.`tipo` = \"$tipo\" AND `pisos`.`venta` = \"Alquiler\" AND (`pisos`.`localidad` = \"$poblacion\")
) ORDER BY `pisos`.`codigo` ASC";
}
}
//cantidad de resultados por página (opcional, por defecto 20)
$_pagi_cuantos = 2;
//incluye paginator
include("paginator.inc.php")

//recorrer registros
while($srow = mysql_fetch_array($_pagi_result,MYSQL_NUM)){
$codigo=$row [0];
$venta=$row [1];
$tipo=$row [2];
$titulo=$row [3];
$texto=$row [4];
$precio=$row [5];
$foto=$row [6];
$foto2=$row [7];
$foto3=$row [8];
$foto4=$row [9];
$foto5=$row [10];
$localidad=$row [11];
}

$existen=1;

if ($tipo!="no") {

//tabla per al tipo y titulo
echo "<br>";
echo "<table width=\"570\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\"><tr><td class=tipo colspan=2>";
echo "<p><b>$venta $tipo</b></p>";
echo "</td></tr><tr><td colspan=2>";
echo "$titulo";
echo "</td></tr>";

//fila per a la foto i el text
echo "<tr><td valign=\"middle\"><div align=\"left\">";
//visualitzar el text amb salts de línea
for ($i=0;$i<strlen($texto);$i++) {
if ($texto[$i]!="\n") echo "$texto[$i]";
else echo "<br>";
}
echo "</div></td><td align=\"right\">";
echo "<div align=\"right\">";



if ($foto!=null) {

echo ("<IFRAME SRC=\"fotos.php?foto=$foto\" scrolling=no noresize NAME=\"$contador\" HEIGHT=\"300\" WIDTH=\"350\">
Su navegador no soporta iFrames.
</IFRAME>");
} //final if columna foto
echo "</div></td></tr>";
echo "</table>";
//fi tabla


//tabla per a les fotos xicotetes
echo "<table width=\"570\" border=\"0\" cellspacing=\"5\" cellpadding=\"0\"><tr>";

echo "<td>";
echo "<div align=\"center\">";
if ($foto!=null) {
echo "<a href=\"fotos.php?foto=$foto\" target=$contador>
<img border=0 src=\"fotos/$foto\" width=100></a>";
}
echo "</div>";
echo "</td>";

echo "<td>";
echo "<div align=\"center\">";
if ($foto2!=null) {
echo "<a href=\"fotos.php?foto=$foto2\" target=$contador>
<img border=0 src=\"fotos/$foto2\" width=100></a>";
}
echo "</div>";
echo "</td>";
echo "<td>";
echo "<div align=\"center\">";
if ($foto3!=null) {
echo "<a href=\"fotos.php?foto=$foto3\" target=$contador><img border=0 src=\"fotos/$foto3\" width=100></a>";
}
echo "</div>";
echo "</td>";
echo "<td>";
echo "<div align=\"center\">";
if ($foto4!=null) {
echo "<a href=\"fotos.php?foto=$foto4\" target=$contador><img border=0 src=\"fotos/$foto4\" width=100></a>";
}
echo "</div>";
echo "</td>";
echo "<td>";
echo "<div align=\"center\">";
if ($foto5!=null) {
echo "<a href=\"fotos.php?foto=$foto5\" target=$contador><img border=0 src=\"fotos/$foto5\" width=100></a>";
}
echo "</div>";
echo "</td>";
echo "</tr></table>";

$contador=$contador+1;

//tabla per al preu i la localitat
echo "<table width=\"570\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\"><tr><td>";
echo "<table width=\"570\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td>";
if ($precio!=null) {
echo "$precio";
}

echo "</td><td>";
echo "$localidad";

echo "</td>";
echo "</tr></table></td></tr></table>";
//echo "<p>$coment</p>";
//tabla per a la referencia i fer reserva
echo "<table width=\"570\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\"><tr>";
echo "<td class=\"lineas\">referencia: $referencia</td></tr></table>";
} //final del while

} //final tipo!=null

if ($tipo=="no") {
echo "<br><br><br>Indique un tipo de inmueble para realizar la búsqueda";
echo "<br><br><a href='javascript:history.go(-1)'>&nbsp;&nbsp;&nbsp;Volver al formulario</a><br>";
}

if ($existen==0) {
if ($tipo!="no") {echo "<br><br><br>En estos momentos no hay ofertas para la búsqueda realizada.";
echo "<br><br><a href='javascript:history.go(-1)'>&nbsp;&nbsp;&nbsp;Volver al formulario</a><br>";}
}
//barra de navegacion
echo "<p>".$_pagi_navegaciom."</p>";
//cantidad de enlaces que se mostrarán como máximo en la barra de navegación
$_pagi_nav_num_enlaces = 3;

//definimos qué irá en el enlace a la página anterior
$_pagi_nav_anterior = "&lt;";
//definimos qué irá en el enlace a la página siguiente
$_pagi_nav_siguiente = "&gt;";
mysql_close($con);
?>

Etiquetas: paginator
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:07.