Ignore:
Timestamp:
Oct 31, 2014 11:14:19 AM (11 years ago)
Author:
quyenla
Message:

collaborator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php

    r328 r360  
    1111                parent::__construct();
    1212        }
    13        
     13        function getCollaborator($data)
     14        {
     15            $sql="SELECT * FROM tblcollaborator";
     16            $data['keyword']='';
     17
     18            if ($data['keyword'])
     19            {
     20            $sql.=" WHERE (full_name LIKE '%".$data['keyword']."%' OR login_name LIKE '%".$data['keyword']."%')";
     21            }
     22            return $this->db->query($sql." LIMIT ".$data['start'].", ".$data['perpage']."")->result_array();
     23
     24        }
     25        function countCollaborator($data)
     26        {
     27            $sql="SELECT COUNT(id) as total FROM tblcollaborator";
     28            if (isset($data['keyword']))
     29            {
     30            $sql.=" WHERE (full_name LIKE '%".$data['keyword']."%' OR login_name LIKE '%".$data['keyword']."%')";
     31            }
     32
     33            return $this->db->query($sql)->row_array()['total'];
     34           
     35        }
    1436}
Note: See TracChangeset for help on using the changeset viewer.