Welcome Guest, Not a member yet? Register   Sign In
Pagination Problem..
#1

[eluser]Roy MJ[/eluser]
Hi guys,
I am using the default pagination of codeigniter
Controller
Code:
public function getAllUsers2()
{
if($this->input->post('s_companyname')=="" && $this->input->post('s_phonenumber')=="" && $this->input->post('s_emailaddress')==""&& $this->input->post('s_status')=="")
{
$query = $this->db->get_where(DB_SUFFIX.'user',array('isAdmin'=>'N','is_registered'=>'Y'));
}
else if($this->input->post('s_companyname')!="")
{
$query = $this->db->get_where(DB_SUFFIX.'user',array('isAdmin'=>'N','is_registered'=>'Y','company_name'=>$this->input->post('s_companyname')));
}
else if($this->input->post('s_phonenumber')!="")
{
$query = $this->db->get_where(DB_SUFFIX.'user',array('isAdmin'=>'N','is_registered'=>'Y','primary_phone'=>$this->input->post('s_phonenumber')));
}
else if($this->input->post('s_emailaddress')!="")
{
$query = $this->db->get_where(DB_SUFFIX.'user',array('isAdmin'=>'N','is_registered'=>'Y','email'=>$this->input->post('s_emailaddress')));
}
else if($this->input->post('s_status')!="")
{
$query = $this->db->get_where(DB_SUFFIX.'user',array('isAdmin'=>'N','is_registered'=>'Y','status'=>$this->input->post('s_status')));
}  return $query->num_rows();
}
public function getAllUsers1($val1,$val2)
{
if($this->input->post('s_companyname')=="" && $this->input->post('s_phonenumber')=="" && $this->input->post('s_emailaddress')==""&& $this->input->post('s_status')=="")
{
$query = $this->db->get_where(DB_SUFFIX.'user',array('isAdmin'=>'N','is_registered'=>'Y'),$val2,$val1);
}
   else  if($this->input->post('s_companyname')!="")
{
$query = $this->db->get_where(DB_SUFFIX.'user',array('isAdmin'=>'N','is_registered'=>'Y','company_name'=>$this->input->post('s_companyname')),$val2,$val1);
}
else if($this->input->post('s_phonenumber')!="")
{
$query = $this->db->get_where(DB_SUFFIX.'user',array('isAdmin'=>'N','is_registered'=>'Y','primary_phone'=>$this->input->post('s_phonenumber')),$val2,$val1);
}
else if($this->input->post('s_emailaddress')!="")
{
$query = $this->db->get_where(DB_SUFFIX.'user',array('isAdmin'=>'N','is_registered'=>'Y','email'=>$this->input->post('s_emailaddress')),$val2,$val1);
}
else if($this->input->post('s_status')!="")
{
$query = $this->db->get_where(DB_SUFFIX.'user',array('isAdmin'=>'N','is_registered'=>'Y','status'=>$this->input->post('s_status')),$val2,$val1);
}
return $query->result();
}




Theme © iAndrew 2016 - Forum software by © MyBB