CodeIgniter Forums

Full Version: error next pagination
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]zacksyah[/eluser]
i've error for page two pagination. This below link of pagination http://localhost/ci/index.php/controller...iewnosql/5
Code:
<?php

class Controller_nosql extends CI_Controller {

    function __construct() {
        parent::__construct();
        $this->load->library('session');
        $this->load->model('model_nosql','bps');
        $this->load->library('pagination');
        $this->load->library('Mongo');
    }

    function index($offset='') {
        $per_page = 5;
        $config['base_url'] = site_url(). '/controller_nosql/viewnosql';
        $total = $this->bps->count();
        //$query = "{"."'province_id':'94'"."},{"."province_id:1"."}";
        $data['bps'] = $this->bps->all_pagination($per_page, $offset);

        $config['per_page'] = $per_page;
        $config['total_rows'] = $total;
        $config['uri_segment'] = 3;
        //$config['base_url'] = $base_url;

        $this->pagination->initialize($config);

        $data['create_links'] = $this->pagination->create_links();

        $this->load->view('viewnosql', $data);
    }
    
    function cari($offset=''){
        $this->load->library('pagination');
        $total = 0;
        $per_page = 5;
        $config['base_url'] = site_url() . '/controller_nosql/cari';
        
        $data['bps'] = $this->bps->search();
        $config['per_page'] = $per_page;
        $config['total_rows'] = $total;
        $config['uri_segment'] = 3;
        $this->pagination->initialize($config);

        $data['create_links'] = $this->pagination->create_links();

        $this->load->view('viewnosql', $data);
        
        
    }
}

?>