Ignore:
Timestamp:
Nov 11, 2014 5:22:15 PM (11 years ago)
Author:
quyenla
Message:

Thong ke cong tac vien

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/application/modules/admin/controllers/reportAsistant.php

    r462 r464  
    2727    {
    2828        $data = array();
     29        $id=$this->uri->segment(3);
    2930        $admin_info = $this->session->userdata('adminInfo');
    3031        if ($admin_info) {
    31             $data['statistics'] = $this->getStatistics();
    32             $data['content'] = $this->getPaidlogs();
     32            $data['statistics'] = $this->getStatistics($id);
     33            $data['content'] = $this->getCollaboratorsUsers(array(),$id);
    3334            $this->load->view('reportAsistant/index', $data);
    3435        } else {
     
    3738    }
    3839
    39     public function getStatistics() {
     40    public function getStatistics($id=false) {
    4041        $data = array();
    4142
     
    4344
    4445        $this->load->model('collabolator_model');
    45         $collaborators = $this->collabolator_model->getAllCollaboratorUser($this_year['start']);
     46        $collaborators = $this->collabolator_model->getAllCollaboratorUser($this_year['start'],$id);
    4647        for ($i=1;$i<=12;$i++)
    4748            {
     
    134135
    135136        $data['start'] = ($data['current_page'] - 1) * $data['perpage'];
    136         $data['total'] = 100; //$this->collabolator_model->countPaidlog($data);
     137        $data['total'] = $this->collabolator_model->countCountCollaboratorUser($data);
    137138        $data['paidlogs'] = $this->collabolator_model->getCountCollaboratorUser($data);
    138139
     
    145146        }
    146147        return $this->load->view('reportAsistant/listview', $data, true);
     148    }
     149   
     150    public function getCollaboratorsUsers($filters = array(),$id=false) {
     151
     152        $this->load->helper('pagging');
     153        $this->load->model('collabolator_model');
     154        $data['current_page'] = $this->uri->segment(4, 1);
     155        $data['itemsoptions'] = array(10, 25, 50, 100);
     156        $data['perpage'] = 10;
     157        $data['id']=$id;
     158        $data['keyword'] = "";
     159        $data['sorting_order'] = "sorting_desc";
     160        $data['sorting_field'] = "id";
     161
     162        if ($this->input->post('sorting_order')) {
     163            if ($this->input->post('sorting_order') != "sorting") {
     164                $data['sorting_order'] = $this->input->post('sorting_order');
     165                $data['sorting_field'] = $this->input->post('sorting_field');
     166            }
     167        }
     168        if ($this->input->post('items')) {
     169            $data['perpage'] = $this->input->post('items');
     170        }
     171        if ($this->input->post('keyword')) {
     172            $data['search_field'] = "";
     173            $data['keyword'] = $this->input->post('keyword');
     174
     175            if (preg_match("/[0-9]/", $data['keyword'])) {
     176                $data['search_field'] = "cellphone";
     177            }
     178        }
     179
     180        $data['start'] = ($data['current_page'] - 1) * $data['perpage'];
     181        $data['total'] = $this->collabolator_model->countCountCollaboratorUsers($data);
     182        $data['paidlogs'] = $this->collabolator_model->getCountCollaboratorUsers($data);
     183
     184        $data['paging_url'] = base_url() . "/admin/thong_ke_cong_tac_vien/trang/";
     185        $data['num_links'] = 2;
     186        $data['paging'] = pagging($data);
     187
     188        if ($this->input->is_ajax_request()) {
     189            return $this->load->view('reportAsistant/listview_user', $data);
     190        }
     191        return $this->load->view('reportAsistant/listview_user', $data, true);
    147192    }
    148193
Note: See TracChangeset for help on using the changeset viewer.