Search & Pagination

#2
[eluser]Twisted1919[/eluser]
Salut Smile
You could try like this :
Code:
function some_function($criteriul_1='all',$criteriul_2='all',$criteriul3='all')
{
    $count_results = $this->model->count_something($criteriul_1,$criteriul_2,$criteriul_3);
    [...]
}
I mean, give your function the params that you expect to have for search(if you have too many params go with func_get_args() ), and give them a default value,that will help you when you will make the pagination:
Code:
$config['base_url']        = site_url().'/controller/method/'.$criteriul_1.'/'.$criteriul_2.'/'.$criteriul_3.'/;
$config['uri_segment']     = 6;

The model function needs to look something like :
Code:
if($criteriul_1 != 'all'){
  //add here a query part that includes $criteriul_1
}
if($criteriul_2 != 'all'){
// same
}
if( $criteriul_3 != 'all' ){
//same
}

This example is only as an idea, just open your eyes, you will get it .
Let me know if you have question .


Messages In This Thread
Search & Pagination - by El Forum - 06-17-2010, 08:59 AM
Search & Pagination - by El Forum - 06-17-2010, 09:13 AM
Search & Pagination - by El Forum - 06-17-2010, 10:04 AM
Search & Pagination - by El Forum - 06-17-2010, 11:01 AM
Search & Pagination - by El Forum - 06-17-2010, 02:48 PM
Search & Pagination - by El Forum - 06-18-2010, 01:34 AM
Search & Pagination - by El Forum - 06-18-2010, 02:35 AM
Search & Pagination - by El Forum - 06-18-2010, 03:08 AM
Search & Pagination - by El Forum - 06-18-2010, 06:52 AM
Search & Pagination - by El Forum - 06-19-2010, 04:14 PM
Search & Pagination - by El Forum - 06-20-2010, 07:35 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.