Ver Mensaje Individual
  #10 (permalink)  
Antiguo 17/10/2015, 08:31
gylle05
 
Fecha de Ingreso: marzo-2009
Mensajes: 291
Antigüedad: 15 años, 1 mes
Puntos: 1
Respuesta: recargar pagina dentro de otra

Me parecio un poco extenso para poner todo el codigo pero ahi va.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<?

include("conexion/conexion.php");

$arre= explode('-',$_POST['localidad']);
$i=1;
$valores='';
foreach ($arre as $valor) {
if($i==1)
{
$valores = "'". $valor."'" ;
$i++;
}
else
{
$valores = $valores .",'". $valor."'" ;
}

}//for

$arreR= explode('-',$_POST['rubro']);
$e=1;
foreach ($arreR as $valorR) {
if($e==1)
{
$valoresR = "'". $valorR."'" ;
$e++;
}
else
{
$valoresR = $valoresR .",'". $valorR."'" ;
}

}//for


$TAMANO_PAGINA = 12;
//examino la página a mostrar y el inicio del registro a mostrar
$inicio = 0;
$pagina = $_POST['paginas'];
if (!$pagina) {
$inicio = 0;
$pagina=1;
}
else {
$inicio = ($pagina - 1) * $TAMANO_PAGINA;
}


if(trim($valores)=="'Todas'")
{
$sqlRuta="Select * from comercios where codrubro in ($valoresR) order by nombrefantasia limit {$inicio},{$TAMANO_PAGINA}";
$rows= mysql_num_rows($consultaRuta);

$consultaRutaTo="Select * from comercios where codrubro in ($valoresR) order by nombrefantasia limit {$inicio},{$TAMANO_PAGINA}";
$consultaRutaTot=mysql_query($consultaRutaTo);
}
else
{
$consultaRutaTo="Select * from comercios where codrubro in ($valoresR) and localidad in ($valores) order by localidad,nombrefantasia";
$consultaRutaTot=mysql_query($consultaRutaTo);

$sqlRuta="Select * from comercios where codrubro in ($valoresR) and localidad in ($valores) order by localidad,nombrefantasia";
}
$consultaRuta= mysql_query($sqlRuta);

$loc=0;
$rub=0;

if(trim($_POST['localidad'])<>'' )
{
$loc=1;
}

if(trim($_POST['rubro'])<>'')
{
$rub=1;
}


if($loc and !$rub)
{
$mensaje="Seleccione el rubro deseado.";
}
else
{
if(!$loc and $rub)
{
$mensaje="Seleccione la Localidad deseada.";
}
else
{
if(!$loc and !$rub)
{
$mensaje="Seleccione la Localidad deseada.";
$consultaRutaTo="Select * from comercios order by nombrefantasia";
$consultaRutaTot=mysql_query($consultaRutaTo);
$sqlRuta="Select * from comercios order by nombrefantasia limit {$inicio},{$TAMANO_PAGINA}";
$consultaRuta= mysql_query($sqlRuta);
}
else
{
$rows= mysql_num_rows($consultaRuta);
if($rows==0)
{
$mensaje="Su consulta no genero resultado.";
}
else
{
$mensaje="";
}
}
}
}

if($_POST['btn']=="1")
{
$sqlRuta="Select * from comercios where nombrefantasia like '%{$_POST['busq']}%' order by localidad,nombrefantasia";
$consultaRuta= mysql_query($sqlRuta);
$consultaRutaTo="Select * from comercios where nombrefantasia like '%{$_POST['busq']}%' order by localidad,nombrefantasia";
$consultaRutaTot=mysql_query($consultaRutaTo);

$rows= mysql_num_rows($consultaRuta);
if($rows==0)
{
$mensaje="Su consulta no genero resultado.";
}
else
{
$mensaje="";
}
}//fin

?>
<style type="text/css">
<!--
.Estilo1 {
color: #000000;
font-weight: bold;
}

.Estilo2 {
color:#6666FD
font-weight: bold;
}

.Estilo3 {
color: #6C045C;
font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
font-weight: bold;
}

-->
</style>
<script type="text/javascript">
$(document).ready(function() {
$('#miboton').click(function() {
// Recargo la página
location.reload();
});
});
</script>

<table width="100%" border="0">
<tr>
<td></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><p class="Estilo3"><? echo $mensaje.$sqlRuta.$_POST['paginas'];?></p></td>
</tr>
</table>





<table width="100%" border="0" >

<?
while($row= mysql_fetch_array($consultaRuta))
{
?>
<tr>
<td><img src="http://developsys.com.ar/tarjetasanjuan/<? echo $row['PathCloud']?>" name="imagenslide1" width="100" height="100" /></td>
<?
$fantasia=$row['NombreFantasia'];
$direccion= $row['DomicilioComercial'].'-'.$row['Localidad'];
$fantasia1='';
$direccion1='';
if($row= mysql_fetch_array($consultaRuta))
{
?>
<td><img src="http://developsys.com.ar/tarjetasanjuan/<? echo $row['PathCloud']?>" name="imagenslide1" width="100" height="100" /></td>
<?
$fantasia1=$row['NombreFantasia'];
$direccion1= $row['DomicilioComercial'].'-'.$row['Localidad'];
}
$fantasia2='';
$direccion2='';
if($row= mysql_fetch_array($consultaRuta))
{
?>
<td><img src="http://developsys.com.ar/tarjetasanjuan/<? echo $row['PathCloud']?>" name="imagenslide1" width="100" height="100" /></td>
</tr>
<?
$fantasia2=$row['NombreFantasia'];
$direccion2= $row['DomicilioComercial'].'-'.$row['Localidad'];
}
?>
<tr>
<td class="Estilo1"><span class="Estilo1"><? echo $fantasia.'</span></br>';?> <span class="Estilo2"><? echo $direccion.'</span>'; ?></td>
<td class="Estilo1"><span class="Estilo1"><? echo $fantasia1.'</span></br>';?> <span class="Estilo2"><? echo $direccion1.'</span>'; ?></td>
<td class="Estilo1"><span class="Estilo1"><? echo $fantasia2.'</span></br>';?> <span class="Estilo2"><? echo $direccion2.'</span>'; ?></td>

</tr>
<?
}//while

?>





</table>
<form method="post" action="Busqueda.php" name="pro">
<?
$rowTot= mysql_num_rows($consultaRutaTot);
$cant=$rowTot/$TAMANO_PAGINA;
$tot=$cant-intval($cant);
if ($tot>0)
{
$tot=intval($cant)+1;
}
else
{
$tot=intval($cant);
}

echo "<table width='300' border='0'>";
echo "<tr>";
for($i = 1; $i <=$tot; $i += 1)
{
echo "<td><a href='javascript:void(0);' onClick='Presioando($i)'>".$i."</a> </td>";
}

echo "</tr>
</table>";
?>
<input name="paginas" id="paginas" type="text" />

</form>
<script>
function Presioando(nro)
{
pro.paginas.value=nro;
pro.submit();
}

</script>

Acordate que esta pagina esta contenida dentro de otra.