Welcome Guest, Not a member yet? Register   Sign In
Save query in pagination
#3

[eluser]nofearinc[/eluser]
It's 20 parameters from 6 joined tables, but the important part is that I generate query with $_POST parameters and logically they aren't persistent during paging.

Code:
function sell() {
    $per_page = 10;
    $base_url = site_url('results/sell');
    $config['uri_segment'] = 3;
    
    $query = $this->offers->get_all_sell($per_page,
        $this->uri->segment($config['uri_segment']),
        ...
        $this->input->post('min_area'),
        $this->input->post('max_area'),
        $this->input->post('min_price'),
        $this->input->post('max_price'),  
        $this->input->post('min_category'),
        $this->input->post('max_category'),
        ...);
                            
    $config['base_url'] = site_url('results/sell');
    $config['total_rows'] = $this->offers->get_sell_count(
                                        ...
                                        $this->input->post('min_area'),
                                        $this->input->post('max_area'),
                                        $this->input->post('min_price'),
                                        $this->input->post('max_price'),  
                                        $this->input->post('min_category'),
                                        $this->input->post('max_category'),
                                        ...);
    $config['per_page'] = $per_page;
    
    $this->pagination->initialize($config);

    $data['pagination'] = $this->pagination->create_links();
    $data['offers'] = $query->result();
    
    $data['contentFile'] = "results/sell_view.php";
    $this->load->view("/template", $data);
}


Messages In This Thread
Save query in pagination - by El Forum - 12-17-2009, 07:04 PM
Save query in pagination - by El Forum - 12-17-2009, 07:13 PM
Save query in pagination - by El Forum - 12-17-2009, 07:23 PM
Save query in pagination - by El Forum - 12-18-2009, 04:51 AM
Save query in pagination - by El Forum - 12-18-2009, 08:31 AM
Save query in pagination - by El Forum - 12-18-2009, 11:49 AM
Save query in pagination - by El Forum - 12-22-2009, 01:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB