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


	if (!function_exists('article_pagination')) {
		function article_pagination($rows, $perPage, $num_link = 4){
			$ci = &get_instance();
			$ci->load->library("pagination");
			$config['base_url'] = site_url("blog/");
			$config['total_rows']=$rows;
			$config['per_page'] = $perPage;
			$config['num_links'] = $num_link;
			
			$config['use_page_numbers'] = TRUE;
			$config['full_tag_open'] = "<ul class='pagination'>";
			$config['full_tag_close'] ="</ul>";
			$config['num_tag_open'] = '<li>';
			$config['num_tag_close'] = '</li>';
			$config['cur_tag_open'] = "<li class='disabled'><li class='active'><a href='#'>";
			$config['cur_tag_close'] = "<span class='sr-only'></span></a></li>";
			$config['next_tag_open'] = "<li>";
			$config['next_tagl_close'] = "</li>";
			$config['prev_tag_open'] = "<li>";
			$config['prev_tagl_close'] = "</li>";
			$config['first_tag_open'] = "<li>";
			$config['first_tagl_close'] = "</li>";
			$config['last_tag_open'] = "<li>";
			$config['last_tagl_close'] = "</li>";
			
			$ci->pagination->initialize($config);
			return $ci->pagination->create_links();
		}
	}
	
	if (!function_exists('tags_pagination')) {
		function tags_pagination($rows, $perPage,$title, $num_link = 4){
			$ci = &get_instance();
			$ci->load->library("pagination");
			$config['base_url']=site_url("blog/tags/".$title."");
			$config['total_rows']=$rows;
			$config['per_page'] = $perPage;
			$config['num_links'] = $num_link;
			$config['uri_segment'] = 3;
			$config['use_page_numbers'] = TRUE;
			$config['full_tag_open'] = "<ul class='pagination'>";
			$config['full_tag_close'] ="</ul>";
			$config['num_tag_open'] = '<li>';
			$config['num_tag_close'] = '</li>';
			$config['cur_tag_open'] = "<li class='disabled'><li class='active'><a href='#'>";
			$config['cur_tag_close'] = "<span class='sr-only'></span></a></li>";
			$config['next_tag_open'] = "<li>";
			$config['next_tagl_close'] = "</li>";
			$config['prev_tag_open'] = "<li>";
			$config['prev_tagl_close'] = "</li>";
			$config['first_tag_open'] = "<li>";
			$config['first_tagl_close'] = "</li>";
			$config['last_tag_open'] = "<li>";
			$config['last_tagl_close'] = "</li>";
			
			$ci->pagination->initialize($config);
			return $ci->pagination->create_links();
		}
	}
	
	if (!function_exists('search_pagination')) {
		function search_pagination($rows, $perPage, $num_link = 4){
			$ci = &get_instance();
			$ci->load->library("pagination");
			$config['base_url']=site_url("search/results");
			$config['total_rows']=$rows;
			$config['per_page'] = $perPage;
			$config['num_links'] = $num_link;
			
			$config['use_page_numbers'] = TRUE;
			$config['full_tag_open'] = "<ul class='pagination'>";
			$config['full_tag_close'] ="</ul>";
			$config['num_tag_open'] = '<li>';
			$config['num_tag_close'] = '</li>';
			$config['cur_tag_open'] = "<li class='disabled'><li class='active'><a href='#'>";
			$config['cur_tag_close'] = "<span class='sr-only'></span></a></li>";
			$config['next_tag_open'] = "<li>";
			$config['next_tagl_close'] = "</li>";
			$config['prev_tag_open'] = "<li>";
			$config['prev_tagl_close'] = "</li>";
			$config['first_tag_open'] = "<li>";
			$config['first_tagl_close'] = "</li>";
			$config['last_tag_open'] = "<li>";
			$config['last_tagl_close'] = "</li>";
			
			$ci->pagination->initialize($config);
			return $ci->pagination->create_links();
		}
	}
	
	if (!function_exists('category_pagination')) {
		function category_pagination($total, $perPage,$Slug, $num_link = 4){
			$ci = &get_instance();
			$ci->load->library("pagination");
			$config['base_url']=site_url("blog/category/".$Slug."/");
			$config['total_rows']=$total;
			$config['per_page'] = $perPage;
			$config['num_links'] = $num_link;
			$config['use_page_numbers'] = TRUE;
			$config['full_tag_open'] = "<ul class='pagination'>";
			$config['full_tag_close'] ="</ul>";
			$config['num_tag_open'] = '<li>';
			$config['num_tag_close'] = '</li>';
			$config['cur_tag_open'] = "<li class='disabled'><li class='active'><a href='#'>";
			$config['cur_tag_close'] = "<span class='sr-only'></span></a></li>";
			$config['next_tag_open'] = "<li>";
			$config['next_tagl_close'] = "</li>";
			$config['prev_tag_open'] = "<li>";
			$config['prev_tagl_close'] = "</li>";
			$config['first_tag_open'] = "<li>";
			$config['first_tagl_close'] = "</li>";
			$config['last_tag_open'] = "<li>";
			$config['last_tagl_close'] = "</li>";
			
			$ci->pagination->initialize($config);
			return $ci->pagination->create_links();
		}
	}
	
	if (!function_exists('archive_pagination')) {
		function archive_pagination($rows, $perPage, $num_link = 4){
			$ci = &get_instance();
			$ci->load->library("pagination");
			$config['base_url'] = site_url("blog/archive");
			$config['total_rows']=$rows;
			$config['per_page'] = $perPage;
			$config['num_links'] = $num_link;
			
			$config['use_page_numbers'] = TRUE;
			$config['full_tag_open'] = "<ul class='pagination'>";
			$config['full_tag_close'] ="</ul>";
			$config['num_tag_open'] = '<li>';
			$config['num_tag_close'] = '</li>';
			$config['cur_tag_open'] = "<li class='disabled'><li class='active'><a href='#'>";
			$config['cur_tag_close'] = "<span class='sr-only'></span></a></li>";
			$config['next_tag_open'] = "<li>";
			$config['next_tagl_close'] = "</li>";
			$config['prev_tag_open'] = "<li>";
			$config['prev_tagl_close'] = "</li>";
			$config['first_tag_open'] = "<li>";
			$config['first_tagl_close'] = "</li>";
			$config['last_tag_open'] = "<li>";
			$config['last_tagl_close'] = "</li>";
			
			$ci->pagination->initialize($config);
			return $ci->pagination->create_links();
		}
	}