Welcome Guest, Not a member yet? Register   Sign In
URL problem when click page number
#1

[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
#2

[eluser]emperius[/eluser]
try links with trailing slash like /app/0/
#3

[eluser]ekosuara[/eluser]
thanks for your reply,
my problem were fixed, i add the code in my controller:
function index()
{
$this->list();
}

base url change to :
$config[’base_url’] = base_url().’radio/lis/’;

and source of user change to :

$orders = $this->dealer->getUserList(0,0,$offset); because function getUserList has 3 parameters




Theme © iAndrew 2016 - Forum software by © MyBB