Welcome Guest, Not a member yet? Register   Sign In
Pagination Based on multiple loops in one controller function
#1

[eluser]Unknown[/eluser]
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
#2

[eluser]marcogmonteiro[/eluser]
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,
#3

[eluser]Unknown[/eluser]
Code:
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'] = 5 ;
   $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




Theme © iAndrew 2016 - Forum software by © MyBB