CodeIgniter Forums

Full Version: Pagination error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Thiago Leao[/eluser]
my pager is giving the following error.
Not getting the bold lyrics that I'm just one page.
And the first page, is not as link.

1 2 3 >


controller

Code:
function listar($id_user, $offset=''){

        if($id_user != $this->session->userdata('loggedin')){
            redirect(base_url().'administracao/home/logout', 'refresh');            
        }else{
            
            $param['titulo'] = 'Catalogo Collection - AdministraĆ§Ć£o!';
            
            $this->load->model('categoria_model');
            $this->load->model('administracao/cad_produto_model');            
            
            $maximo = 2;
            $inicio = $this->uri->segment(4,0);
    
            $config['base_url']         = base_url() .'administracao/cad_produto/listar/'.$id_user.'/';
            $config['total_rows']         = $this->cad_produto_model->contaRegistros($id_user);
            $config['per_page']         = $maximo;
            
            $this->pagination->initialize($config);    
            
            $param['paginacao']         = $this->pagination->create_links();
            $param['total_registro']     = $this->cad_produto_model->contaRegistros($id_user);
            $param['produtos']             = $this->cad_produto_model->listar($maximo, $offset, $id_user);
            $param['listar_category']     = $this->cad_produto_model->filtrarBusca($id_user, $maximo, $inicio);
        
            $this->load->view('administracao/list_produto', $param);    
            
        }
    }

model

Code:
function filtrarBusca($id_user, $maximo, $inicio){        
        
        $this->db->select('*');
        $this->db->from('products');
        $this->db->join('category', 'products.id_category = category.id_category', 'inner');
        $this->db->where('products.id_user', $id_user);
        $this->db->limit($maximo, $inicio);
        
        $query = $this->db->get();
        return $query->result();    
        
    }

anywhere help?
thanks

El Forum

[eluser]InsiteFX[/eluser]
General CodeIgniter Discussion (no CODE!).

InsiteFX

El Forum

[eluser]Thiago Leao[/eluser]
i'm sorry!
=/