Welcome Guest, Not a member yet? Register   Sign In
ajax pagination + protoype?
#4

[eluser]MMCCQQ[/eluser]
i did it , well... but dont work in Explorer 7

Code:
function Gethumb(){
        $this->RegistrosAMostrar=21;
if($this->uri->segment(3)){
  $this->RegistrosAEmpezar=($this->uri->segment(3) - 1)* $this->RegistrosAMostrar;
  $this->PagAct=$this->uri->segment(3);
  //caso contrario los iniciamos
}else{
  $this->RegistrosAEmpezar=0;
  $this->PagAct=1;
}

        $this->empezar = $this->uri->segment(3);
        $this->db->limit($this->RegistrosAMostrar,$this->RegistrosAEmpezar);
        $this->db->order_by('id','desc');
        $this->db->where('idalbum','21');
        $Resultado = $this->db->get('album_photo');
        echo ($this->uri->segment(3) - 1)* $this->RegistrosAMostrar;
     echo "<div id='album' style='width:300px;'>";
         foreach ($Resultado->result_array() as $row)
       {
        
          echo "<a href='#'><img width='98' src='http://beta.importzona.com/".$row['thumb']."'></a>";
          
          
       }
       echo "</div>";
       /* SIIII! */


$this->db->like('idalbum', '');
$this->db->from('album_photo');
$this->NroRegistros = $this->db->count_all_results();
$this->PagAnt=$this->PagAct-1;
$this->PagSig=$this->PagAct+1;
$this->PagUlt=$this->NroRegistros/$this->RegistrosAMostrar;

//verificamos residuo para ver si llevará decimales
$this->Res=$this->NroRegistros%$this->RegistrosAMostrar;
// si hay residuo usamos funcion floor para que me
// devuelva la parte entera, SIN REDONDEAR, y le sumamos
// una unidad para obtener la ultima pagina
if($this->Res>0) $this->PagUlt=floor($this->PagUlt)+1;

//desplazamiento
echo $this->NroRegistros.'este<br />';
echo "&lt;a onclick=\"get('1')\"&gt;Primero</a> ";
if($this->PagAct>1) echo "&lt;a onclick=\"get('$this-&gt;PagAnt')\">Anterior</a> ";
echo "<strong>Pagina ".$this->PagAct."/".$this->PagUlt."</strong>";
if($this->PagAct<$this->PagUlt)  echo " &lt;a onclick=\"get('$this-&gt;PagSig')\">Siguiente</a> ";
echo "&lt;a onclick=\"get('$this-&gt;PagUlt')\">Ultimo</a>";
/* SIIIII FIN */

        
        
        
        
        
    }


Messages In This Thread
ajax pagination + protoype? - by El Forum - 02-10-2008, 02:43 PM
ajax pagination + protoype? - by El Forum - 02-11-2008, 10:11 AM
ajax pagination + protoype? - by El Forum - 02-11-2008, 03:49 PM
ajax pagination + protoype? - by El Forum - 02-11-2008, 08:25 PM
ajax pagination + protoype? - by El Forum - 02-11-2008, 08:27 PM
ajax pagination + protoype? - by El Forum - 02-11-2008, 09:42 PM
ajax pagination + protoype? - by El Forum - 02-11-2008, 09:50 PM
ajax pagination + protoype? - by El Forum - 06-17-2008, 02:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB