<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Common_module extends CI_Model{

	private $GF_DBM;

	function __construct()
	{
		parent::__construct();
		$this->load->database();
	}

	function page_all($configs) {
		$config['uri_segment'] = $configs['uri_segment'];
		$config['base_url'] = $configs['base_url'];

		$config['total_rows'] =$configs['total_rows'];
		$config['per_page'] = $configs['per_page'];

		$config['num_links'] = 5;
		
		$config['full_tag_open'] = '<ul class="pagination search">';
		$config['full_tag_close'] = '</ul>';

		$config['first_link'] = 'First';
		$config['prev_link'] = '<li class="page-item page-prev"><a class="page-link" href="#">Prev</a></li>';
		$config['next_link'] = '<li class="page-item"><a class="page-link" href="#">Next</a></li>';
		$config['last_link'] = 'Last';

		$config['first_tag_open'] = '<li class="page-item" style="padding: 10px;">';
		$config['first_tag_close'] = '</li>';
		$config['prev_tag_open'] = '<li class="page-item" style="padding: 10px;">';
		$config['prev_tag_close'] = '</li>';
		$config['num_tag_open'] = '<li class="page-item" style="padding: 10px;">';
		$config['num_tag_close'] = '</li>';
		$config['next_tag_open'] = '<li class="page-item" style="padding: 10px;">';
		$config['next_tag_close'] = '</li>';
		$config['last_tag_open'] = '<li class="page-item" style="padding: 10px;">';
		$config['last_tag_close'] = '</li>';
		$config['cur_tag_open'] = '<li class="page-item active"><a class="page-link" href="#">';
		$config['cur_tag_close'] = '</a></li>';

		$config['display_pages'] = true; 

		$config['use_page_numbers']   = TRUE;

		$config['anchor_class'] = "";
		$this->pagination->initialize($config);
		$pagination = $this->pagination->create_links();
		return $pagination;
	}
}
?>