Index: pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php	(revision 371)
+++ pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php	(revision 373)
@@ -1,60 +1,55 @@
-﻿<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+﻿<?php
+if (!defined('BASEPATH'))
+    exit('No direct script access allowed');
 
-class Collabolator_model extends MY_Model
-{
-	
-	protected $table_name = 'tblcollaborator';
-	protected $id_name = 'id';
+class Collabolator_model extends MY_Model {
 
-	function __construct()
-	{
-		parent::__construct();
-	}
-	function getCollaborator($data)
-        {
-            $sql="SELECT * FROM ".$this->table_name;
-            $data['keyword']='';
+    protected $table_name = 'tblcollaborator';
+    protected $id_name = 'id';
 
-            if ($data['keyword'])
-            {
-            $sql.=" WHERE (full_name LIKE '%".$data['keyword']."%' OR login_name LIKE '%".$data['keyword']."%') ";
+    function __construct() {
+        parent::__construct();
+    }
+
+    function getCollaborator($data) {
+        $sql = "SELECT * FROM " . $this->table_name;
+        if ($data['keyword']) {
+            if ($data['search_field'] == "cellphone") {
+                $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%')";
+            } else {
+                $sql.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%') ";
             }
-            $order="";
-            if ($data['sorting_order'] != "sorting")
-            {
-                if ($data['sorting_field'] != "money")
-                {
-                $sort="DESC";
-                if ($data['sorting_order']=="sorting_asc") $sort = "ASC";
-                $order="ORDER BY ".$data['sorting_field']." ".$sort;
-                }
+        }
+
+        $order = "";
+        if ($data['sorting_order'] != "sorting") {
+            if ($data['sorting_field'] != "money") {
+                $sort = "DESC";
+                if ($data['sorting_order'] == "sorting_asc")
+                    $sort = "ASC";
+                $order = "ORDER BY " . $data['sorting_field'] . " " . $sort;
             }
-           
-            return $this->db->query($sql." ".$order." LIMIT ".$data['start'].", ".$data['perpage']." ")->result_array();
+        }
+       
+        return $this->db->query($sql . " " . $order . " LIMIT " . $data['start'] . ", " . $data['perpage'] . " ")->result_array();
+    }
 
+    function isExist($data) {
+        $sql = "SELECT COUNT(id) as total FROM " . $this->table_name . " WHERE " . $data['field'] . " = '" . $data['value'] . "' LIMIT 1";
+        if ($this->db->query($sql)->row_array()['total'] == 1) {
+            return true;
+        } else {
+            return false;
         }
-        function isExist($data)
-        {
-            $sql="SELECT COUNT(id) as total FROM ".$this->table_name." WHERE ".$data['field']." = '".$data['value']."' LIMIT 1";
-            if ($this->db->query($sql)->row_array()['total']==1)
-            {
-                return true;
-            }
-            else
-            {
-                return false;
-            }
-            
+    }
+
+    function countCollaborator($data) {
+        $sql = "SELECT COUNT(id) as total FROM " . $this->table_name;
+        if (isset($data['keyword'])) {
+            $sql.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%') ";
         }
-        function countCollaborator($data)
-        {
-            $sql="SELECT COUNT(id) as total FROM ".$this->table_name;
-            if (isset($data['keyword']))
-            {
-            $sql.=" WHERE (full_name LIKE '%".$data['keyword']."%' OR login_name LIKE '%".$data['keyword']."%') ";
-            }
 
-            return $this->db->query($sql)->row_array()['total'];
-            
-        }
+        return $this->db->query($sql)->row_array()['total'];
+    }
+
 }
