EllisLab text mark
Advanced Search
     
Pagination Based on multiple loops in one controller function
Posted: 12 November 2012 05:00 AM
Joined: 2012-11-12
2 posts

Hi to all,

here i am facing a problem regarding paginatioan search with multiple functions
i attach controller buy.php

and here i written some if else conditions,
in that based on condition i am getting the results
with out paginations its working fine,but if i am included pagination functions its going validation false

help is appreciated,thank you

 Signature 

Anudeep Sharma,
Codeigniter Developer,
Hyderabad-India,
Gmail:anudeepsharma4u@gmail.com
Skype:anudeep.php621

 
Posted: 12 November 2012 05:10 AM   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2011-06-06
96 posts

It would be better if you paste the code inside your post and not as an attachement. Easy to look at and answer your question.

cheers,

 Signature 

website :: marcomonteiro.net | Twitter :: @marcogmonteiro Blog :: blog.marcomonteiro.net

 
Posted: 12 November 2012 07:53 AM   [ # 2 ]   [ Rating: 0 ]
Joined: 2012-11-12
2 posts
if($make != null && $model == null && $FromnewPrice == null && $TonewPrice == null && $states == null && $cities == null && $year == null)
  
{
      
if($make == 786)
   
{
   
//$data['newcar'] = $this->Buy_Model->search_newcarALL();
         
$this->load->library('pagination');
   
$config['base_url'base_url().'index.php?buy/newcar/maketype=';
   
$config['total_rows'count($this->Home_Model->getnewall());//get the number of records
   
$config['per_page';
   
$config['full_tag_open''<p>';
   
$config['full_tag_close''</p>';
   
$config['uri_segment']3;
   
$config['num_links'20;
   
$this->pagination->initialize($config);
      
$data['newcar'$this->Home_Model->getnewall_det($config['per_page'],$this->uri->segment($config['uri_segment']));
   
$data['pagination'$this->pagination->create_links();
   
}
   
else if($make != 786)
   
{
   $data[
'newcar'$this->Buy_Model->search_newcarbymake($make);
   
}
  }
//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 
 Signature 

Anudeep Sharma,
Codeigniter Developer,
Hyderabad-India,
Gmail:anudeepsharma4u@gmail.com
Skype:anudeep.php621