Welcome Guest, Not a member yet? Register   Sign In
Pagination Links not showing....
#1

[eluser]Brokenegg.wb[/eluser]
Hey All,
I'm having some trouble with my pagination code, everything is working fine, pretty much, however my links have disappeared and i can't figure out how to get them back, here is my Controller Code:
Code:
function index()
    {
        $this->load->library('pagination');
        $this->load->library('table');
        
        $config['base_url'] = 'http://www.rareintaglio.com/index.php/store';
        $config['total_rows'] = $this->db->get('items')->num_rows();
        $config['per_page'] = 12;
        $config['num_links'] = 7;
        $config['full_tag_open'] = '<div id="pagination">';
        $config['full_tag_close'] = '</div>';
        
        $this->pagination->initialize($config);
        
        if($query = $this->site_db_upload->get_records_store())
        {
            $data['records'] = $query;
        }
        
        
        $this->load->view('store', $data);
    }

View Code:
Code:
<div id="shopnav">
     &lt;?php echo $this->pagination->create_links();?&gt;
     </div>
</div>

     <div id="cbody">
     <div id="itemrow">
&lt;?php if(isset($records)) :foreach($records as $row): ?&gt;
<div id="item1">
<div id="itmpic"></div>
<p>Item Name:&lt;?php echo $row->item_name;?&gt;<br />
Attribution:&lt;?php echo $row->attribution;?&gt;<br />
Material:&lt;?php echo $row->material;?&gt;<br />
Date Acquired:&lt;?php echo $row->date_acquired;?&gt;<br />
Price:&lt;?php echo $row->price;?&gt;<br />
</p>
</div>
&lt;?php endforeach; ?&gt;
&lt;?php else: ?&gt;
<h2> Your search returned no results, please refine your search term and try again.</h2>
&lt;?php endif;?&gt;

and Model Code:
Code:
function get_records_store()
    {
        $config['base_url'] = 'http://www.rareintaglio.com/index.php/store';
        $config['total_rows'] = $this->db->get('items')->num_rows();
        $config['per_page'] = 12;
        $config['num_links'] = 7;
        $config['full_tag_open'] = '<div id="pagination">';
        $config['full_tag_close'] = '</div>';
        
        $this->db->select('item_name, attribution, material, age, date_acquired, price');
        
        $query = $this->db->get('items', $config['per_page'], $this->uri->segment(3));
        return $query->result();
    }

anyone have any ideas?
Thanks,
Watson
#2

[eluser]Brokenegg.wb[/eluser]
well, still no idea why the page control disappeared, but it's back now.... i guess that means problem solved....
#3

[eluser]Ramania[/eluser]
sorry if the reply is late, but this's not a problem it's just there is no "need" for pagination to be shown incase all rows are viewed in one page and the limit is not reached, once the limit is reached the pagination will show and put the results in the second page.




Theme © iAndrew 2016 - Forum software by © MyBB