【问题标题】:pagination error in codeignitercodeigniter中的分页错误
【发布时间】:2014-05-21 13:46:37
【问题描述】:

当我想在分页页面 2 中搜索月份“四月”和年份“2014”返回“梅”月份时,我在 codeigniter 中出现错误

这是控制器

function index($nama='', $bln = 0, $thn = 0)
    {
        if (!$nama AND $this->input->post('nama')) 
        {
            $nama = $this->input->post('nama');
        }   
        else if(!$nama)
        {
            $nama = 0;
        }

        if (!$bln AND $this->input->post('bulan')) 
        {
            $bln = $this->input->post('bulan');
        }   
        else if(!$bln)
        {
            $bln = 0;
        }

        if (!$thn AND $this->input->post('tahun')) 
        {
            $thn = $this->input->post('tahun');
        }   
        else if(!$thn)
        {
            $thn = 0;
        }

        $count = $this->miuran->get_count_iuran($nama, $bln, $thn);

        // Set up pagination
        $offset = 0;
        $perpage = 5;
        $uri_segment = 7;
        if ($count > $perpage) {
            $this->load->library('pagination');
            $this->load->config('pagination');

            $config = $this->config->item('pag');

            $config['base_url'] = site_url('pelatih/iuran/'.$nama.'/'.$bln.'/'.$thn);
            $config['total_rows'] = $count;
            $config['per_page'] = $perpage;
            $config['uri_segment'] = $uri_segment;
            $this->pagination->initialize($config);
            $this->data['pagination'] = $this->pagination->create_links();
            if($this->uri->segment($uri_segment)){
                $offset = $this->uri->segment($uri_segment);
            }
        }
        else 
        {
            $this->data['pagination'] = '';
            $offset = 0;
        }

        $this->data['anggota'] = $this->miuran->get_daftar_iuran($bln, $thn,$nama,$perpage,$offset);

        $this->data['title'] ='UKM Taekwondo | iuran';
        $this->data['orang'] = $this->mlogin->dataPengguna($this->session->userdata('username'));
        $this->data['contents'] = $this->load->view('pelatih/iuran/view_iuran', $this->data, true);
        $this->load->view('template/wrapper/pelatih/wrapper_anggota',$this->data);
    }

当我将第 2 页数据切换回“mei”月份时。

请帮我做什么。

谢谢。

【问题讨论】:

  • 您遇到的错误是什么?

标签: php codeigniter pagination


【解决方案1】:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-05-23
    • 2012-12-14
    • 2013-04-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多