Index: pro-violet-viettel/sourcecode/application/config/database.php
===================================================================
--- pro-violet-viettel/sourcecode/application/config/database.php	(revision 460)
+++ pro-violet-viettel/sourcecode/application/config/database.php	(revision 461)
@@ -51,5 +51,5 @@
 $db['default']['hostname'] = 'mysql:host=127.0.0.1';
 $db['default']['username'] = 'root';//sbg
-$db['default']['password'] = '123456';//sbg~~!!@@123
+$db['default']['password'] = 'Quyenhue@123';//sbg~~!!@@123
 $db['default']['database'] = 'violet-viettel';
 $db['default']['dbdriver'] = 'pdo';
Index: pro-violet-viettel/sourcecode/application/config/routes.php
===================================================================
--- pro-violet-viettel/sourcecode/application/config/routes.php	(revision 460)
+++ pro-violet-viettel/sourcecode/application/config/routes.php	(revision 461)
@@ -79,4 +79,21 @@
 
 
+
+$route['admin/thong_ke_cong_tac_vien'] = 'admin/reportAsistant';
+$route['admin/thong_ke_cong_tac_vien/trang'] = 'admin/reportAsistant/getCollaborators/1';
+$route['admin/thong_ke_cong_tac_vien/trang/:any'] = 'admin/reportAsistant/getCollaborators/$1';
+$route['admin/thong_ke_cong_tac_vien/them'] = 'admin/reportAsistant/addSmstemplate';
+$route['admin/thong_ke_cong_tac_vien/:any'] = 'admin/reportAsistant/viewAsistant';
+
+$route['admin/thong_ke_cong_tac_vien/test'] = 'admin/reportAsistant/test';
+$route['admin/thong_ke_cong_tac_vien/xem/:any'] = 'admin/reportAsistant/viewSms';
+$route['admin/thong_ke_cong_tac_vien/sua/:any'] = 'admin/reportAsistant/editSms';
+$route['admin/thong_ke_cong_tac_vien/xoa/:any'] = 'admin/reportAsistant/deleteSms';
+$route['admin/thong_ke_cong_tac_vien/xoa_tin_nhan'] = 'admin/reportAsistant/dodeleteSms';
+$route['admin/thong_ke_cong_tac_vien/cap_nhat'] = 'admin/reportAsistant/updateSms';
+
+
+
+
 $route['admin/quan_tri_vien'] = 'admin/admin_acc';
 $route['admin/quan_tri_vien/trang'] = 'admin/admin_acc/get_admins/1';
Index: pro-violet-viettel/sourcecode/application/modules/admin/controllers/report.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/controllers/report.php	(revision 460)
+++ pro-violet-viettel/sourcecode/application/modules/admin/controllers/report.php	(revision 461)
@@ -184,5 +184,5 @@
         $data['paging'] = pagging($data);
         foreach ($data['paidlogs'] as $index => $paidlog) {
-            $data['paidlogs'][$index]['username'] = $this->get_username($paidlog['us_id']);
+            $data['paidlogs'][$index]['username'] = @$this->get_username($paidlog['us_id']);
         }
 
@@ -210,5 +210,5 @@
     public function test() {
 
-
+/*
         for ($i = 1; $i <= 5000; $i++) {
             $input['us_id'] = rand(1, 100);
@@ -222,6 +222,6 @@
 
         die();
-
-        for ($i = 1; $i <= 100; $i++) {
+*/
+        for ($i = 1; $i <= 200; $i++) {
             $input['us_id'] = $i;
             $input['cellphone'] = "01234567" . (100 + $i);
@@ -229,6 +229,7 @@
             $input['acc_balanced'] = rand(100000, 1000000);
             $input['expire_date'] = date("Y-m-d H:i:s", time());
-            $input['created_time'] = date("Y-m-d H:i:s", time());
-            $input['updated_time'] = date("Y-m-d H:i:s", time());
+            $time = (rand((time() - (12 * 30 * 24 * 60 * 60)), time()));
+            $input['created_time'] = date("Y-m-d H:i:s", $time);
+            $input['updated_time'] = date("Y-m-d H:i:s", $time);
             $this->load->model('user_model');
             $this->user_model->insert($input);
Index: pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php	(revision 460)
+++ pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php	(revision 461)
@@ -34,5 +34,46 @@
         return $this->db->query($sql . " " . $order . " LIMIT " . $data['start'] . ", " . $data['perpage'] . " ")->result_array();
     }
+    function getAllCollaboratorUser($from)
+    {
+        $from = date("Y-m-d 00:00:00",$from); 
+        $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time, tbluser.created_time as user_created_time  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.id WHERE tbluser.created_time > '".$from."'";
 
+        $result = $this->db->query($sql)->result_array();
+        foreach ($result as $index=>$paidlog)
+        {
+            $result[$index]['time']=  strtotime($paidlog['user_created_time']);
+        }
+        return $result;
+    }
+    function getCountCollaboratorUser($data)
+    {
+        $order = "";
+        if ($data['sorting_order'] != "sorting") {
+            
+                $sort = "DESC";
+                if ($data['sorting_order'] == "sorting_asc")
+                    $sort = "ASC";
+                $order = "ORDER BY " . $data['sorting_field'] . " " . $sort;
+            
+        }
+        $where="";
+        if ($data['keyword']) {
+            if ($data['search_field'] == "cellphone") {
+                $where.=" WHERE (tblcollaborator.cellphone LIKE '%" . $data['keyword'] . "%')";
+            } else {
+                $where.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%') ";
+            }
+        }
+       // $from = date("Y-m-d 00:00:00",$from); 
+        $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time, COUNT(tbluser.collaborator) as total_user  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.id ".$where." GROUP BY tblcollaborator.id ".$order." LIMIT " . $data['start'] . ", " . $data['perpage'] . " ";
+        echo $sql;
+        $result = $this->db->query($sql)->result_array();
+        foreach ($result as $index=>$paidlog)
+        {
+            $result[$index]['time']=  strtotime($paidlog['user_created_time']);
+        }
+
+        return $result;
+    }
     function isExist($data) {
         $sql = "SELECT COUNT(id) as total FROM " . $this->table_name . " WHERE " . $data['field'] . " = '" . $data['value'] . "'";
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/admin_acc/index.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/admin_acc/index.php	(revision 460)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/admin_acc/index.php	(revision 461)
@@ -75,5 +75,5 @@
 	{
 		$.ajax({
-			url: 'http://viettel.violet.vn/admin/quan_tri_vien/trang/1',
+			url: '<?php echo base_url();?>admin/quan_tri_vien/trang/1',
 			type: "POST",
 			data: $("#admin").serialize(),
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/admin_acc/listview.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/admin_acc/listview.php	(revision 460)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/admin_acc/listview.php	(revision 461)
@@ -109,5 +109,5 @@
 
                                 <td class=" ">
-                                    <a data-toggle="ajaxModal" href='http://viettel.violet.vn/admin/quan_tri_vien/xem/<?php echo $admin['admin_id'];?>' data-toggle="modal" href="#view_admin"><?php echo $admin['login_name']; ?></a>
+                                    <a data-toggle="ajaxModal" href='<?php echo base_url();?>admin/quan_tri_vien/xem/<?php echo $admin['admin_id'];?>' data-toggle="modal" href="#view_admin"><?php echo $admin['login_name']; ?></a>
                                 </td>
                                 <td class="hidden-480 "><?php echo $admin['full_name']; ?></td>
@@ -123,10 +123,10 @@
                                     <div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
                                         <a href="#" class="blue">
-                                            <i data-toggle="ajaxModal" href='http://viettel.violet.vn/admin/quan_tri_vien/xem/<?php echo $admin['admin_id'];?>' data-toggle="modal" href="#view_admin" class="icon-zoom-in bigger-130"></i>
+                                            <i data-toggle="ajaxModal" href='<?php echo base_url();?>admin/quan_tri_vien/xem/<?php echo $admin['admin_id'];?>' data-toggle="modal" href="#view_admin" class="icon-zoom-in bigger-130"></i>
                                         </a>
 
                                         <!--a href="#editAdmin" data-toggle="modal" data-admin-id=<?php echo $admin['admin_id']; ?> class="green"-->
 										<a href="#" class="green">
-                                             <i data-toggle="ajaxModal" href='http://viettel.violet.vn/admin/quan_tri_vien/sua/<?php echo $admin['admin_id'];?>' data-toggle="modal" href='#edit_admin' class="icon-pencil bigger-130"></i>
+                                             <i data-toggle="ajaxModal" href='<?php echo base_url();?>admin/quan_tri_vien/sua/<?php echo $admin['admin_id'];?>' data-toggle="modal" href='#edit_admin' class="icon-pencil bigger-130"></i>
                                         </a>
 
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/cardlog/index.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/cardlog/index.php	(revision 460)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/cardlog/index.php	(revision 461)
@@ -60,5 +60,5 @@
 	{
 		$.ajax({
-			url: 'http://viettel.violet.vn/admin/card_log/trang/1',
+			url: '<?php echo base_url();?>admin/card_log/trang/1',
 			type: "POST",
 			data: $("#cardlog").serialize(),
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/index.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/index.php	(revision 460)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/index.php	(revision 461)
@@ -82,5 +82,5 @@
     {
         $.ajax({
-            url: 'http://viettel.violet.vn/admin/cong_tac_vien/trang/1',
+            url: '<?php echo base_url();?>admin/cong_tac_vien/trang/1',
             type: "POST",
             data: $("#collaborator").serialize(),
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/listview.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/listview.php	(revision 460)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/listview.php	(revision 461)
@@ -110,10 +110,8 @@
 
                                 
-                                <td class=" "><?php echo $collaborator['full_name']?></td>
-                                <td class=" ">
-                                    <a href="#"><?php echo $collaborator['cellphone']?></a>
-                                </td>
+                                <td class=" "><a href="<?php echo base_url();?>admin/thong_ke_cong_tac_vien/<?php echo $collaborator['id'];?>"><?php echo $collaborator['full_name']?></a></td>
+                                <td class=" "><?php echo $collaborator['cellphone'];?></td>
                 
-                                <td class=" "><?php echo $collaborator['created_time']?></td>
+                                <td class=" "><?php echo $collaborator['created_time'];?></td>
 
                                 <td class="hidden-480 ">
@@ -134,13 +132,13 @@
                                     <div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
                                         <a href="#" class="blue">
-                                            <i data-toggle="ajaxModal" href='http://viettel.violet.vn/admin/cong_tac_vien/xem/<?php echo $collaborator['id'];?>'  class="icon-zoom-in bigger-130"></i>
+                                            <i data-toggle="ajaxModal" href='<?php echo base_url();?>admin/cong_tac_vien/xem/<?php echo $collaborator['id'];?>'  class="icon-zoom-in bigger-130"></i>
                                         </a>
 
                                         <a href="#" class="green">
-                                            <i data-toggle="ajaxModal" href='http://viettel.violet.vn/admin/cong_tac_vien/sua/<?php echo $collaborator['id'];?>' data-toggle="modal" href='#editUser' class="icon-pencil bigger-130"></i>
+                                            <i data-toggle="ajaxModal" href='<?php echo base_url();?>admin/cong_tac_vien/sua/<?php echo $collaborator['id'];?>' data-toggle="modal" href='#editUser' class="icon-pencil bigger-130"></i>
                                         </a>
 
                                         <a href="#" class="red">
-                                            <i data-toggle="ajaxModal" href='http://viettel.violet.vn/admin/cong_tac_vien/xoa/<?php echo $collaborator['id'];?>' data-toggle="modal" href='#deleteUser' class="icon-trash bigger-130"></i>
+                                            <i data-toggle="ajaxModal" href='<?php echo base_url();?>admin/cong_tac_vien/xoa/<?php echo $collaborator['id'];?>' data-toggle="modal" href='#deleteUser' class="icon-trash bigger-130"></i>
                                         </a>
                                     </div>
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/report/index.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/report/index.php	(revision 460)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/report/index.php	(revision 461)
@@ -106,5 +106,5 @@
     {
         $.ajax({
-            url: 'http://viettel.violet.vn/admin/doanh_thu_tong_hop/trang/1',
+            url: '<?php echo base_url();?>admin/doanh_thu_tong_hop/trang/1',
             type: "POST",
             data: $("#collaborator").serialize(),
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/smslog/index.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/smslog/index.php	(revision 460)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/smslog/index.php	(revision 461)
@@ -61,5 +61,5 @@
 	{
 		$.ajax({
-			url: 'http://viettel.violet.vn/admin/sms_log/trang/1',
+			url: '<?php echo base_url();?>admin/sms_log/trang/1',
 			type: "POST",
 			data: $("#smslog").serialize(),
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/smstemplate/index.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/smstemplate/index.php	(revision 460)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/smstemplate/index.php	(revision 461)
@@ -82,5 +82,5 @@
     {
         $.ajax({
-            url: 'http://viettel.violet.vn/admin/mau_tin_nhan/trang/1',
+            url: '<?php echo base_url();?>admin/mau_tin_nhan/trang/1',
             type: "POST",
             data: $("#collaborator").serialize(),
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/smstemplate/listview.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/smstemplate/listview.php	(revision 460)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/smstemplate/listview.php	(revision 461)
@@ -118,13 +118,13 @@
                                     <div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
                                         <a href="#" class="blue">
-                                            <i data-toggle="ajaxModal" href='http://viettel.violet.vn/admin/mau_tin_nhan/xem/<?php echo $smstemplate['sms_id'];?>'  class="icon-zoom-in bigger-130"></i>
+                                            <i data-toggle="ajaxModal" href='<?php echo base_url();?>admin/mau_tin_nhan/xem/<?php echo $smstemplate['sms_id'];?>'  class="icon-zoom-in bigger-130"></i>
                                         </a>
 
                                         <a href="#" class="green">
-                                            <i data-toggle="ajaxModal" href='http://viettel.violet.vn/admin/mau_tin_nhan/sua/<?php echo $smstemplate['sms_id'];?>' data-toggle="modal" href='#editUser' class="icon-pencil bigger-130"></i>
+                                            <i data-toggle="ajaxModal" href='<?php echo base_url();?>admin/mau_tin_nhan/sua/<?php echo $smstemplate['sms_id'];?>' data-toggle="modal" href='#editUser' class="icon-pencil bigger-130"></i>
                                         </a>
 
                                         <a href="#" class="red">
-                                            <i data-toggle="ajaxModal" href='http://viettel.violet.vn/admin/mau_tin_nhan/xoa/<?php echo $smstemplate['sms_id'];?>' data-toggle="modal" href='#deleteUser' class="icon-trash bigger-130"></i>
+                                            <i data-toggle="ajaxModal" href='<?php echo base_url();?>admin/mau_tin_nhan/xoa/<?php echo $smstemplate['sms_id'];?>' data-toggle="modal" href='#deleteUser' class="icon-trash bigger-130"></i>
                                         </a>
                                     </div>
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/user/index.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/user/index.php	(revision 460)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/user/index.php	(revision 461)
@@ -60,5 +60,5 @@
 	{
 		$.ajax({
-			url: 'http://viettel.violet.vn/admin/nguoi_dung/trang/1',
+			url: '<?php echo base_url();?>admin/nguoi_dung/trang/1',
 			type: "POST",
 			data: $("#user").serialize(),
Index: pro-violet-viettel/sourcecode/application/views/layout/admin/sidebar.php
===================================================================
--- pro-violet-viettel/sourcecode/application/views/layout/admin/sidebar.php	(revision 460)
+++ pro-violet-viettel/sourcecode/application/views/layout/admin/sidebar.php	(revision 461)
@@ -79,5 +79,5 @@
 						</li>
 
-						<li class="<?php if(in_array($class,array("report", "smslog", "cardlog"))) {echo "active open";}?>">
+						<li class="<?php if(in_array($class,array("report", "smslog", "cardlog","reportAsistant"))) {echo "active open";}?>">
 							<a href="#" class="dropdown-toggle">
 								<i class="icon-bar-chart"></i>
@@ -95,6 +95,6 @@
 								</li>
 
-								<li>
-									<a href="report_assistant.html">
+								<li  class="<?php if(in_array($class,array("reportAsistant"))) {echo "active";}?>">
+									<a href="<?php echo $base_url;?>admin/thong_ke_cong_tac_vien">
 										<i class="icon-double-angle-right"></i>
 										Doanh thu cá»§a cá»ng tÃ¡c viÃªn
