CodeIgniter Forums

Full Version: Search & paginate
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I am stuck on a search I have a form in the view in which there is a
search form with more than 10 fields currently I am using the session variable to store
the search terms and retrieve them on every page clicks !

Please advice am I doing the right thing ?

//advance search
public function searchbox($start_row='')
  $per_page = 5;
  $getdata = $this->input->get(NULL, TRUE);
  if($getdata == ''){
   $getdata = $_SESSION['gdata'];
  $num_rows= $this->vehicle_model->getvehicleSearchBox_numrows($getdata);
  $config['base_url'] = base_url().'index.php/site/searchbox/';
  $config['total_rows'] = $num_rows;
  $config['per_page'] = $per_page;
  $config['uri_segment'] = 3;
  $data['pagination_links'] = $this->pagination->create_links();
  $data['search'] = $this->get_adavancesearch($getdata, $start_row, $per_page);  
  $data['header'] = $this->load->view('header','',true);
  $data['menu'] = $this->makemenu();
  $data['searchform'] = $this->searchforms();