Ver Mensaje Individual
  #3 (permalink)  
Antiguo 18/03/2013, 15:55
unexes
 
Fecha de Ingreso: enero-2011
Ubicación: España
Mensajes: 222
Antigüedad: 14 años
Puntos: 7
Respuesta: Sesion o paginador

Este es el codigo de MENULATERA.PHP
Código PHP:
Ver original
  1. <?php
  2. if(!isset($_SESSION))
  3. {
  4. }
  5. ?>
  6. <head>
  7. <?php
  8. if(isset($_GET["selciudad"])){
  9.         $_SESSION["Ciudad"]=$_GET["selciudad"];
  10.         }
  11.         $selciudad = $_SESSION["Ciudad"];
  12. ?>
  13. </head>
  14. <body>
  15. <form name="filtrar" id="filtrar" method="GET"  action="">
  16. <div id="accordion">
  17.     <table width="185" height="30" border="0" cellspacing="5">
  18. <tr>
  19. <td align="left">
  20.     <select name="selciudad" id="selciudad" class="Guias3" onChange="cargarContenido('Contenido.php')">
  21.     <option value="Todas las ciudades" selected>&nbsp;Todas las ciudades</option>
  22.     <option value="<?php echo $_SESSION["Ciudad"]; ?>" selected>&nbsp;&nbsp;<?php echo $_SESSION["Ciudad"]; ?></option>
  23. <?php
  24.     $tablaciudad = mysql_query("SELECT * FROM provincias  ORDER BY Provincia ASC");
  25.     while ($registrociudad  = mysql_fetch_array($tablaciudad ))
  26.         if (empty($_GET["selciudad"])<> '-1')  
  27.         {
  28.            echo "<option value='".$registrociudad['Provincia']."' selected>&nbsp;&nbsp;".$registrociudad['Provincia']."</option>";
  29.        }else{
  30.           echo "<option value='".$registrociudad['Provincia']."' >&nbsp;&nbsp;".$registrociudad['Provincia']."</option>";      }
  31.     mysql_free_result($tablaciudad);
  32. ?>
  33. </select>
  34. </td>
  35. </tr>
  36. </table>
  37. </form>
  38. </div>
  39. </body>
este el ultimo el de CONTENIDO.PHP
Código PHP:
Ver original
  1. <?php
  2. if(!isset($_SESSION))
  3. {
  4. }
  5. ?>
  6. <?php require_once('Connections/ConexionCoches.php');?>
  7. <?php
  8. if(isset($_GET["selregistrospagina"])){
  9.         $_SESSION["numpag"]=$_GET["selregistrospagina"];
  10.         }
  11.         $selregistrospagina=$_SESSION["numpag"];
  12.        
  13.         if(isset($_GET["selciudad"])){
  14.         $_SESSION["Ciudad"]=$_GET["selciudad"];
  15.         }
  16.         $selciudad=$_SESSION["Ciudad"];
  17.         echo $_SESSION["Ciudad"];
  18. ?>
  19.   <head>
  20.   <meta http-equiv="content-type" content="text/html;charset=UTF-8">
  21.         <link rel="stylesheet" href="Css/zebra_pagination.css" type="text/css">        
  22.         <link rel="stylesheet" href="Css/Coches.css" type="text/css">
  23.         <link rel="stylesheet" href="Css/ClassCoches.css" type="text/css">
  24.   </head>
  25. <?php
  26.         $records_per_page = $selregistrospagina;
  27.         require 'Zebra_Pagination/Zebra_Pagination.php';
  28.         $pagination = new Zebra_Pagination();
  29.        $pagination->records_per_page($records_per_page);
  30. ?>
  31. <body>
  32. <div id="Consulta">
  33.   <?php
  34. $sql = "SELECT SQL_CALC_FOUND_ROWS * FROM coches WHERE Activacion = '1'";
  35.        if ($_SESSION["Ciudad"] <>'Todas las ciudades') {
  36.         $sql .= "AND coches.Ciudad = '$selciudad' ";
  37.        }else {$sql .= "AND coches.Ciudad <> 'Todas las ciudades' ";
  38. }
  39. $sql .= 'ORDER BY Ciudad ASC ';
  40. $sql .= 'LIMIT ' . (($pagination->get_page()- 1) * $records_per_page) . ', ' . $records_per_page . '';
  41.         if (!($result = @mysql_query($sql))) {
  42.             die(mysql_error()); }
  43.         $rows = mysql_fetch_assoc(mysql_query('SELECT FOUND_ROWS() AS rows'));
  44.          $pagination->records($rows['rows']);
  45.          $pagination->records_per_page($records_per_page);
  46. $tabla = mysql_query($sql);
  47. while ($registro = mysql_fetch_array($tabla)) {
  48.         ?>
  49.  <div class="Prueba">
  50.  <table class="MarcoFotoPrincipal" width="183" border="0">
  51.   <tr>      
  52.           <td><a href="Ficha.php?Id=<?php echo $registro['Id']; ?>"><img border="0" src="<?php echo $registro['FotoPrincipal']; ?>" width="165px" height="240px"></a></td>        
  53.   </tr>
  54.   </table>
  55.  </div>
  56. <?php
  57. }
  58. ?>
  59. </div>
  60. <?php
  61.     $pagination->render();
  62. ?>
  63. <?php      
  64. echo "Página:  ";
  65. echo "<a class=\"Paginacion\">".$pagination->get_page()."</a>";
  66. echo "   de   ";
  67. echo "<a class=\"Paginacion\">".$pagination->_total_pages ."</a>";
  68. ?>
  69. <?php
  70. echo "Coches:&nbsp;&nbsp;";
  71. echo "<a class=\"Paginacion\">".$rows['rows'] ."</a>";
  72. ?>
  73. </body>
Ahora si podeis ayudarme, Gracias a todos.
__________________
¿Hay algo mas hermoso que ayudar.?