CodeIgniter Forums
HELP ME OUT,Paginations Based on Conditions,i tried but uri not working!!! - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: HELP ME OUT,Paginations Based on Conditions,i tried but uri not working!!! (/showthread.php?tid=54245)



HELP ME OUT,Paginations Based on Conditions,i tried but uri not working!!! - El Forum - 08-29-2012

[eluser]Unknown[/eluser]
Like this i am having 6 values are coming from view to controller function,after that based on values i am doing search like this
//code starts//if($A != null && $b == null && $c == null && $d == null && $e == null && $f == null )
{
if($A == 'Any'){
$this->load->My_Model->seach_itemswithany();}
else{$this->load->My_Model->seach_itemsall($any)}
}
Like this i am getting the values from db,total 240 if and elseif loops i written for the differrent pages,so how can i put pagination for this based on conditions?
HELP ME OUT!
here the sample code
Code:
//only year selection
  elseif($make == null && $model == null && $FromnewPrice == null && $TonewPrice == null && $states == null && $cities == null && $year != null)
  {
       if($year == 200014)
    {
    $data['newcar'] = $this->Buy_Model->search_newcarALL();
    }
    else
    {
    $data['newcar'] = $this->Buy_Model->search_newcarbyyear($year);
    }
  
  }//only price selection
  elseif($make == null && $model == null && $FromnewPrice != null && $TonewPrice != null && $states == null && $cities == null && $year == null)
  {
       $data['newcar'] = $this->Buy_Model->search_newcarbyprice($FromnewPrice,$TonewPrice);
  }//only state selection
  else
  if($make == null && $model == null && $FromnewPrice == null && $TonewPrice == null && $states != null && $cities == null && $year == null)
  {
    if($states == 'ANY')
    {
     $data['newcar'] = $this->Buy_Model->search_newcarALL();
    }
    else
    {
    $data['newcar'] = $this->Buy_Model->search_newcarbystate($states);
    }
  }//make and year
  else
  if($make != null && $model == null && $FromnewPrice == null && $TonewPrice == null && $states == null && $cities == null && $year != null)
  {
    if($make == 786 && $year == 200014)
    {
     $data['newcar'] = $this->Buy_Model->search_newcarALL();
    }
    else if($make == 786 && $year != 200014)
    {
     $data['newcar'] = $this->Buy_Model->search_newcarbyyear($year);
    }
    else if($make != 786 && $year == 200014)
    {
     $data['newcar'] = $this->Buy_Model->search_newcarbymake($make);
    }
    else
    {
     $data['newcar'] = $this->Buy_Model->search_newcarbymakeyear($make,$year);
    }
  }//make and price
your help is appreciated