Ver Mensaje Individual
  #4 (permalink)  
Antiguo 06/07/2009, 10:51
clusterbit
 
Fecha de Ingreso: octubre-2008
Mensajes: 67
Antigüedad: 15 años, 6 meses
Puntos: 0
Respuesta: Ayuda!! con paginacion :(

Funciona perfecto!! gracias.

solo agregue pedasos de codigo y listo!!

ahora me surgio otro dilema no quiero que se me vean todos los registros

necesito algo así

<Anterior 1 2 3 ... 22 23 24 Siguiente>

o algo parecido por favor amigos algun dato ya que nop quiero llegar al famoso paginator.php

Saludos

ha!! y para quienes esten en el mismo problema que yó acá les dejo lo que le puse a mi codigo espero les sirva.

Código php:
Ver original
  1. <?php
  2. //session_start();
  3. //echo $perfil;
  4. //echo $_SESSION['strBuscar'];
  5.  
  6. require('midb.php');
  7. $conexion=Conectar();
  8.  
  9. if(isset($_POST['sltPerfil'])){
  10.     $sltPerfil = $_POST['sltPerfil'];
  11.     $_SESSION['sltPerfil'] = $sltPerfil;
  12. }
  13.  
  14. if(isset($_POST['sltEspecialidad'])){
  15.     $sltEspecialidad = $_POST['sltEspecialidad'];
  16. }
  17.  
  18. if(isset($_POST['sltRegion'])){
  19.     $sltRegion = $_POST['sltRegion'];
  20. }
  21.  
  22. if(isset($_SESSION['strBuscar'])){
  23.     $strBuscar = $_SESSION['strBuscar'];
  24. } else {
  25.     require('strBusca.php');
  26. }
  27.  
  28. if(isset($_GET['limMayor'])){
  29.   $limMayor = $_GET['limMayor'];
  30.   $limMayor = $limMayor * 10;
  31. } else {
  32.     $limMayor = 10;
  33. }
  34. $limMenor = $limMayor - 10;
  35.  
  36.  
  37. $rs_Usuario=mysql_query($strBuscar, $conexion);
  38. $size = mysql_num_rows($rs_Usuario);
  39.  
  40. if ($size > 0){
  41.     $nfilas = ceil($size/10);
  42.     //echo "$size, $nfilas";
  43. } else {
  44.     $nfilas = 0;
  45. }
  46.  
  47. $strBuscar .= " LIMIT $limMenor , 10";
  48.  
  49. ?>
  50.  
  51. <script>
  52. function cambio(cual)
  53. {
  54.     if (document.getElementById(cual).style.display == 'none')
  55.         document.getElementById(cual).style.display = 'block'
  56.     else
  57.         document.getElementById(cual).style.display = 'none'
  58. }
  59. </script>
  60.  
  61. <table width="95%" border="0" cellpadding="0" cellspacing="1" bordercolor="#ECE9D8" class="forumline" id="serps">
  62.  
  63.   <?php
  64.  
  65.     $contador = 1;
  66.     $rs_Usuario=mysql_query($strBuscar, $conexion);
  67.     if (mysql_num_rows($rs_Usuario) == 0){
  68.         printf("<tr  class='hlRow'>
  69.                     <th class='row3'><div align='left' class='Estilo21'>No Existen datos asociados a su busqueda</div></td>
  70.                     <th class='row3'><div align='center' class='Estilo2'></div></td>
  71.                     <th class='row3'><div align='center'></div></td>
  72.                 </tr>");
  73.     }else{
  74.         echo "<tr  class='hlRow'><th width='70%'><div align='left' class='Estilo21'>Nombre</div></th><th width='20%'>";
  75.         echo "<div align='center' class='Estilo21'>Perfil</div> </th>";
  76.         echo "<th width='10%'>Detalle</th></tr>";
  77.     }
  78.    
  79.     while ($row=mysql_fetch_array($rs_Usuario))  {
  80.      if (count($row) > 0){
  81.      
  82.         $nombre=$row[1];
  83.         $id=$row[0];
  84.         $perfil=$row[2];
  85.         $color = "";
  86.        
  87.         if($contador % 2 == 0){
  88.             $color = "#FF9700";
  89.         } else {
  90.             $color = "#FFE0CC";
  91.         }
  92. printf("<tr bgcolor = '$color'><td class='row3'><div align='left' class='Estilo2'>$nombre</div></td>
  93.                
  94.                 <td class='row3'><div align='center' class='Estilo2'>$perfil</div></td>");
  95.         echo "<td class='row3'><div align='center'><input type='submit' name='Submit' value='ver' onclick=". "" ."cambio('Tester$id');".""." /></div></td>";
  96.         printf("</tr><tr><td colspan='5' bgcolor='#ffffff'>");
  97.         echo "<table border='0' cellpadding='0' cellspacing='0' width='100%' id='Tester$id' style='display: none'><tr>";
  98.         echo "<td style='border: 2px solid rgb(235, 89, 1);' align='center' width='500'>";
  99.         echo "<iframe src='detalle.php' style='height: 55px;' id='ihif1' frameborder='0' width='100%'>";
  100.         printf("</iframe></td></tr></table></td></tr>");$contador ++;}}
  101.      printf("<tr  class='hlRow'> <td colspan='3'><table><tr>");
  102.      if(($limMayor/10 - 1) > 0) {
  103. echo "<a href='sinRegistro.php?tipoReg=buscadorSin&limMenor=".($limMayor/10-1)."'>< Anterior</a> ";
  104. }
  105. for ($i=1; $i<=$nfilas; $i++){
  106. if ($limMayor/10 == $i) {
  107. echo "<b>".($limMayor/10)."</b> ";
  108. } else {
  109. echo "<a href='sinRegistro.php?tipoReg=buscadorSin&limMayor=$i'>$i</a> ";
  110. } }
  111. if(($limMayor/10 + 1)<=$nfilas) {
  112. echo " <a href='sinRegistro.php?tipoReg=buscadorSin&limMayor=".($limMayor/10+1)."'>Siguiente ></a>";
  113. }
  114. printf("</tr></table> </td> </tr>");
  115.  
  116. ?>
  117. </table>
  118. <?php
  119.    mysql_free_result($rs_Usuario);
  120.    mysql_close($conexion);
  121. ?>

Saludos.