<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
function pagging($data)
    {
        get_instance()->load->library('pagination');
        $config['base_url'] = $data['paging_url'];
        $config['total_rows'] = $data['total'];
        $config['use_page_numbers'] = TRUE;
        $config['per_page'] = $data['perpage'];
        $config['num_tag_open'] = "<li>";
        $config['num_tag_close'] = "</li>";
        $config['cur_tag_open'] = "<li class='active'><a>";
        $config['cur_tag_close'] = '</a></li>';
        $config['last_link'] = '»';
        $config['first_link'] = '«';
        $config['first_tag_open'] = "<li title='Trang đầu tiên'>";
        $config['first_tag_close'] = '</li>';
        $config['last_tag_open'] = "<li title='Trang cuối cùng'>";
        $config['last_tag_close'] = '</li>';
        $config['next_link'] = '>';
        $config['next_tag_open'] = "<li title='Trang kế tiếp'>";
        $config['next_tag_close'] = '</li>';
        $config['prev_link'] = '<';
        $config['prev_tag_open'] = "<li title='Trang trước'>";
        $config['prev_tag_close'] = '</li>';
        $config['num_links'] = $data['num_links'];
        $config['current_page'] = $data['current_page'];
        $config['ajax_class'] = 'ajax_paging';
        get_instance()->pagination->initialize($config);
        return get_instance()->pagination->create_links();
    } 