[eluser]ekosuara[/eluser]
Hello,
I'm having trouble paginating, when I click page number ( 1 2 3 > Last ›), I get 404 error. so i tried to type link "../app/0" in address bar,i get same error. If i remove number 0, the application work normally,and the page show number item what i want (per page).
here my controllers:
function index($offset=0)
{
// echo "$offset";
$this->load->library('pagination');
$config['base_url'] = base_url().'radio/';
$config['total_rows'] = $this->dealer->getUserCount($offset);
$config['per_page'] = PAGE_RECORD;
$this->pagination->initialize($config);
$this->view->set('total_rows', $config['total_rows']);
$orders = $this->dealer->getUserList($offset);
$this->view->part('content', 'radio/list.php');
$this->view->set('radioList', $orders);
$this->view->set('contentTitle', "Radio > Daftar Radio ");
$this->view->load('template');
}
function getUserList
function getUserList($user_id='', $role_id='', $offset=0)
{
$this->db->select('u.*, r.kode AS kode_radio')->from('smsp.users u');
$this->db->join('smsp.smsp_referer r', 'u.id=r.user_id', 'left');
$this->db->orderby('u.nama');
$this->db->limit(PAGE_RECORD,$offset);
$rs = $this->db->get();
$rv = $rs->result_array();
return $rv;
}
anyone help me..? please