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

class Mt_pagination
{
    #---------------------------------------------------------------------------
    # PURPOSE : mt_pagination
    # CREATE  :	2019-03-20
    #---------------------------------------------------------------------------
    public function create_pagenation($req_data){
            # request
            $total_count= $req_data['total_count'];
            $limit      = $req_data['limit'];
            $base_url   = $req_data['base_url'];
    
            $ci=& get_instance();
            $ci->load->library('pagination');

            $config['base_url']         = $base_url ;
            $config['total_rows']       = $total_count;
            $config['per_page']         = $limit;
            $config['num_links']        = 4;

            $config['enable_query_strings'] = TRUE;
            $config['page_query_string'] = TRUE;
            $config['use_page_numbers'] = TRUE;
            $config['reuse_query_string'] = TRUE;
            $config['query_string_segment'] = 'page';

            $config['full_tag_open']    = '<div class="pagination">';
            $config['full_tag_close']   = '</div>';
            
            $config['first_link']       = false;
            $config['last_link']        = false;
            $config['prev_link']        = '이전<i class="prev prev-angle"></i>';
            $config['next_link']        = '다음<i class="next next-angle"></i>';
            $config['cur_tag_open']     = '<span class="current">';
            $config['cur_tag_close']    = ' </span>';

            $ci->pagination->initialize($config);
            $pagination = $ci->pagination->create_links();
    
    
            return $pagination;
    }
}


