Index: /pro-violet-viettel/sourcecode/application/modules/admin/controllers/collaborator.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/admin/controllers/collaborator.php	(revision 370)
+++ /pro-violet-viettel/sourcecode/application/modules/admin/controllers/collaborator.php	(revision 371)
@@ -29,5 +29,14 @@
         $data['perpage'] = 10;
         $data['keyword'] = "";
-
+        $data['sorting_order']="sorting_desc";
+        $data['sorting_field']="created_time";
+        
+        if ($this->input->post('sorting_order')) {
+            if ($this->input->post('sorting_order') != "sorting")
+            {
+               $data['sorting_order']=$this->input->post('sorting_order');
+               $data['sorting_field']=$this->input->post('sorting_field'); 
+            }
+        }
         if ($this->input->post('items')) {
             $data['perpage'] = $this->input->post('items');
Index: /pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php	(revision 370)
+++ /pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php	(revision 371)
@@ -20,5 +20,16 @@
             $sql.=" WHERE (full_name LIKE '%".$data['keyword']."%' OR login_name LIKE '%".$data['keyword']."%') ";
             }
-            return $this->db->query($sql." ORDER BY id DESC LIMIT ".$data['start'].", ".$data['perpage']." ")->result_array();
+            $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();
 
         }
Index: /pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/index.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/index.php	(revision 370)
+++ /pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/index.php	(revision 371)
@@ -33,4 +33,35 @@
             return false;
         });
+        
+        
+$( '.sorting, .sorting_desc, .sorting_asc' ).click(function( index ) {
+            var current_class=$( this ).attr('class');
+            $(".sorting_desc").attr("class","sorting");
+            $(".sorting_asc").attr("class","sorting");
+     
+            if(current_class=='sorting')
+            {
+                $(this).attr("class","sorting_desc");
+            }
+            else
+            {
+                if(current_class=='sorting_desc')
+                {
+                    $(this).attr("class","sorting_asc");
+                }
+                else
+                    {
+                    if(current_class=='sorting_asc')
+                    {
+                        $(this).attr("class","sorting");
+                    }
+                }
+            }
+            $("#sorting_field").val($(this).attr("id"));
+            $("#sorting_order").val($(this).attr("class"));
+            filter();
+        });
+
+
     }
 
Index: /pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/listview.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/listview.php	(revision 370)
+++ /pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/listview.php	(revision 371)
@@ -71,4 +71,6 @@
                             </div>
                         </div>
+                        <input type="text" name="sorting_order" id="sorting_order" value="<?php echo $sorting_order;?>" />
+                        <input type="text" name="sorting_field" id="sorting_field" value="<?php echo $sorting_field;?>"/>
                     </form>
                     <table class="table table-striped table-bordered table-hover dataTable" id="sample-table-2" aria-describedby="sample-table-2_info">
@@ -81,12 +83,12 @@
                                     </label>
                                 </th>
-                                <th class="sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Sá» Äiá»n thoáº¡i: activate to sort column ascending">Sá» Äiá»n thoáº¡i</th>
-                                <th class="sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 183px;" aria-label="Há» tÃªn: activate to sort column ascending">Há» tÃªn</th>
-                                <th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 122px;" aria-label="Tiá»n: activate to sort column ascending">Tiá»n</th>
-                                <th class="sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 209px;" aria-label="NgÃ y ÄÄng kÃœ: activate to sort column ascending">
+                                <th class="<?php if ($sorting_field == 'cellphone') {echo $sorting_order;} else {echo "sorting";}?>" id="cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Sá» Äiá»n thoáº¡i: activate to sort column ascending">Sá» Äiá»n thoáº¡i</th>
+                                <th class="<?php if ($sorting_field == 'full_name') {echo $sorting_order;} else {echo "sorting";}?>" id="full_name" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 183px;" aria-label="Há» tÃªn: activate to sort column ascending">Há» tÃªn</th>
+                                <th class="sorting" id="money" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 122px;" aria-label="Tiá»n: activate to sort column ascending">Tiá»n</th>
+                                <th class="<?php if ($sorting_field == 'created_time') {echo $sorting_order;} else {echo "sorting";}?>" id="created_time" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 209px;" aria-label="NgÃ y ÄÄng kÃœ: activate to sort column ascending">
                                     <i class="icon-time bigger-110 hidden-480"></i>
                                     NgÃ y ÄÄng kÃœ
                                 </th>
-                                <th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 158px;" aria-label="Tráº¡ng thÃ¡i: activate to sort column ascending">Tráº¡ng thÃ¡i</th><th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 133px;" aria-label=""></th></tr>
+                                <th class="<?php if ($sorting_field=='activated') {echo $sorting_order;} else {echo "sorting";}?>" id="activated" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 158px;" aria-label="Tráº¡ng thÃ¡i: activate to sort column ascending">Tráº¡ng thÃ¡i</th><th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 133px;" aria-label=""></th></tr>
                         </thead>
 
Index: /pro-violet-viettel/sourcecode/assets/js/admin/collaborator.js
===================================================================
--- /pro-violet-viettel/sourcecode/assets/js/admin/collaborator.js	(revision 370)
+++ /pro-violet-viettel/sourcecode/assets/js/admin/collaborator.js	(revision 371)
@@ -34,3 +34,4 @@
             });
         
-        })
+        });
+        
