Created
August 31, 2013 23:40
-
-
Save pabloprogramador/6401367 to your computer and use it in GitHub Desktop.
paginacao de conteudo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| public function categoria_global($id){ | |
| $contar = $this->global_sistemas_m->contar($id); | |
| $config['base_url'] = base_url().'loja/categoria_global/'.$id.'/'; | |
| $config['total_rows'] = $contar; | |
| $config['per_page'] = $this->por_pagina; | |
| $config["uri_segment"] = 4; | |
| $this->pagination->initialize($config); | |
| $page = ($this->uri->segment(4)) ? $this->uri->segment(4) : 0; | |
| $lista = $this->global_sistemas_m->listar($id, $this->por_pagina, $page); | |
| $paginacao = $this->pagination->create_links(); | |
| } | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| public function contar($id) | |
| { | |
| $this->db->set_dbprefix(''); | |
| $categorias = $this->db | |
| ->where('cod_grupo',$id) | |
| ->from('cadastro_produtos') | |
| ->count_all_results(); | |
| $this->db->set_dbprefix('default_'); | |
| return $categorias; | |
| } | |
| public function listar($id,$limit, $start) | |
| { | |
| $this->db->set_dbprefix(''); | |
| $categorias = $this->db | |
| ->select('cod_grupo, descricao, cod_produto, fabricante, vl_venda1, vl_venda2, vl_venda3, qnt_estoque') | |
| ->limit($limit, $start) | |
| ->where('cod_grupo',$id) | |
| ->get('cadastro_produtos') | |
| ->result(); | |
| $this->db->set_dbprefix('default_'); | |
| return $categorias; | |
| } | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| <?php foreach ($lista as $item) { ?> | |
| <!-- ITENS AQUI --> | |
| <?php } ?> | |
| <div id="paginacao"> | |
| <?php echo $paginacao; ?> | |
| </div> | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment