CmsUser.php 1.82 KB
Newer Older
Phạm Văn Đoan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 25/12/2015
 * Time: 2:22 CH
 */
if (!defined('BASEPATH')) exit('No direct script access allowed');

class CmsUser extends CI_Controller
{
    public function __construct()
    {
        parent::__construct();
        date_default_timezone_set("Asia/Ho_Chi_Minh");
        //
17
        $this->load->model('muser_model');
Phạm Văn Đoan committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
    }

    public function listUser()
    {
        $this->_data['functionName'] = 'QL Người chơi';
        $this->_data['action'] = 'listUser';
        $this->_data['titlePage'] = 'QL Người chơi';
        $this->_data['loadPage'] = 'backend/cms_user/list_user_view';
        $this->load->view('backend/admin_template_view', $this->_data);
    }

    public function listUserAjax()
    {
        $data = array();
        $fByName = $this->input->post('fByName');
        $pageId = $this->input->post('pageId');
        //
        $pageId = ($pageId == 0) ? 1 : $pageId;
        //
        $limit = 10;
        $offset = ($pageId - 1) * $limit;
        $data['offset'] = ($pageId - 1) * $limit;
        $totalRecord = $this->muser->cmsCountAll($fByName);
        $data['pagination'] = MyHelper::genPaginationLink($totalRecord, $limit, $pageId);
        $data['listData'] = $this->muser->cmsGetPagination($limit, $offset, $fByName);
        //
        $this->load->view('backend/ajax/cms_user/list_user_view', $data);
    }

    public function showUser($user_id)
    {
        $this->_data['user']= $this->muser->getById($user_id);
        //
        $this->_data['functionName'] = 'Thông tin Người chơi';
        $this->_data['action'] = 'showUser';
        $this->_data['titlePage'] = 'Thông tin Người chơi';
        $this->_data['loadPage'] = 'backend/cms_user/show_user_view';
        $this->load->view('backend/admin_template_view', $this->_data);
    }

}