[eluser]ivains[/eluser]
Hi Everyone.
Problem: When pagination links are clicked on, I get a '404 Page Not Found' versus the next set of rows.
The first page displays fine with the links underneath.
I have been searching for a solution for 4-days now to no avail. Tried several tutorials only to have the same results.
Can anyone please take a gander at my code and maybe point out what I missed.
Controller:
Code:
// offset
$offset = $this->uri->segment(3,0);
// limit
$limit = 10;
$data['heading']='Staff Activity Log';
$data['action']='Staff Activity Log';
$this->db->select('*');
$this->db->from('activity_log');
$this->db->where('user_level !=', '50');
$this->db->order_by('datetime','desc');
$this->db->limit($limit, $offset);
$query = $this->db->get()->result();
$config['base_url'] = site_url('/admin/activitylog_staff/');
$config['total_rows'] = $this->db->count_all('activity_log');
$config['per_page'] = $limit;
$config['full_tag_open'] = '<p>';
$config['full_tag_close'] = '</p>';
$config['cur_tag_open'] = '<b>';
$config['cur_tag_close'] = '</b>';
$this->pagination->initialize($config);
$paginator=$this->pagination->create_links();
// generate table data
$this->load->library('table');
$this->table->set_empty(" ");
$this->table->set_heading('Date/Time', 'Activity', 'User', 'IP');
$i = 0 + $offset;
foreach ($query as $row)
{
$this->table->add_row($row->datetime, $row->activity, $row->user, $row->ip);
}
$data['table'] = $this->table->generate();
$data['paginator']=$paginator;
$data['spacer']='<br /><br />';
$this->load->view('admin/logs/activity',$data);
View:
Code:
<h2><?=$action?></h2>
<div>
<?=$table?>
</div>
<div>
<?=$paginator?>
</div>
<div>
<?=$spacer?>
</div>
BTW: The pagination library is set to autoload.
Any help, suggestions and comments would be gratefully appreciated.
Thanks