Place Code in controller
if(strpos($_SERVER['REQUEST_URI'],'?')) $sufix = '&'.http_build_query($_GET, '', "&");
else $sufix = '?'.http_build_query($_GET, '', "&");
$this->load->library("pagination");
$cfg = array(
'base_url'=> 'The current page url',
'total_rows' => $this->model_name->function_name_which_gives_cnt(),
'per_page'=> 2,
'use_page_numbers'=>TRUE,
'enable_query_strings' => TRUE,
'page_query_string' => TRUE,
'query_string_segment' => 'page',
'suffix' => $sufix
);
$cfg['full_tag_open'] = '<ul class="pagination">';
$cfg['full_tag_close'] = '</ul>';
$cfg['prev_link'] = '<';
$cfg['prev_tag_open'] = '<li>';
$cfg['prev_tag_close'] = '</li>';
$cfg['next_link'] = '>';
$cfg['next_tag_open'] = '<li>';
$cfg['next_tag_close'] = '</li>';
$cfg['cur_tag_open'] = '<li class="active"><a href="'.base_url().'Index/reports/transaction_history/#">';
$cfg['cur_tag_close'] = '</a></li>';
$cfg['num_tag_open'] = '<li>';
$cfg['num_tag_close'] = '</li>';
$cfg['first_tag_open'] = '<li>';
$cfg['first_tag_close'] = '</li>';
$cfg['last_tag_open'] = '<li>';
$cfg['last_tag_close'] = '</li>';
$cfg['first_link'] = '<<';
$cfg['last_link'] = '>>';
$this->pagination->initialize($cfg);
$page=0;
if(isset($_GET['page'])) {
$page = $_GET['page']>0?$_GET['page']:0;
}
$data['output']=$this->model_name->transactions($cfg["per_page"],$page);
$data["pagination"] = $this->pagination->create_links();
$data["pagination_helper"] = $this->pagination;
if(strpos($_SERVER['REQUEST_URI'],'?')) $sufix = '&'.http_build_query($_GET, '', "&");
else $sufix = '?'.http_build_query($_GET, '', "&");
$this->load->model('model_name');$this->load->library("pagination");
$cfg = array(
'base_url'=> 'The current page url',
'total_rows' => $this->model_name->function_name_which_gives_cnt(),
'per_page'=> 2,
'use_page_numbers'=>TRUE,
'enable_query_strings' => TRUE,
'page_query_string' => TRUE,
'query_string_segment' => 'page',
'suffix' => $sufix
);
$cfg['full_tag_open'] = '<ul class="pagination">';
$cfg['full_tag_close'] = '</ul>';
$cfg['prev_link'] = '<';
$cfg['prev_tag_open'] = '<li>';
$cfg['prev_tag_close'] = '</li>';
$cfg['next_link'] = '>';
$cfg['next_tag_open'] = '<li>';
$cfg['next_tag_close'] = '</li>';
$cfg['cur_tag_open'] = '<li class="active"><a href="'.base_url().'Index/reports/transaction_history/#">';
$cfg['cur_tag_close'] = '</a></li>';
$cfg['num_tag_open'] = '<li>';
$cfg['num_tag_close'] = '</li>';
$cfg['first_tag_open'] = '<li>';
$cfg['first_tag_close'] = '</li>';
$cfg['last_tag_open'] = '<li>';
$cfg['last_tag_close'] = '</li>';
$cfg['first_link'] = '<<';
$cfg['last_link'] = '>>';
$this->pagination->initialize($cfg);
$page=0;
if(isset($_GET['page'])) {
$page = $_GET['page']>0?$_GET['page']:0;
}
$data['output']=$this->model_name->transactions($cfg["per_page"],$page);
$data["pagination"] = $this->pagination->create_links();
$data["pagination_helper"] = $this->pagination;
0 comments:
Post a Comment