Welcome Guest, Not a member yet? Register   Sign In
Pagination & Searches
#2

[eluser]alvaroeesti[/eluser]
Using sessions. I have a web search form with all kinds of whistles and blowers, select lists, text fields, checkboxes, etc

I am not using GET, I am using POST

at the controller I go for every of these controllers, say for a controller named Object, a model called resultados_search_M1 and also as you see, sending as parameters whatever has been selected by the user in the search form

Code:
$object = $this->resultados_search_M1->object_handler($this->input->get_post('object', TRUE));

Then at the Model I have a function that handles me that controller

Code:
public function object_handler($object)
{
  if($object)
  {
   $this->session->set_userdata('object', $object);
   return $object;
  }
  elseif($this->session->userdata('object'))
  {
   $object = $this->session->userdata('object');
   return $object;
  }
  else
  {
   $object ="";
   return $object;
  }
  
  
  
}

Then I go and start with the 2 usual queries:

One to get the number of rows that correspond to the search parameters the user has entered, and the other one to get the actual data.

"geographically" these two queries are located above, before the function handlers


Messages In This Thread
Pagination & Searches - by El Forum - 12-03-2012, 06:16 AM
Pagination & Searches - by El Forum - 12-04-2012, 12:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB