Index: pro-violet-viettel/sourcecode/application/modules/admin/controllers/reportAsistant.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/controllers/reportAsistant.php	(revision 741)
+++ pro-violet-viettel/sourcecode/application/modules/admin/controllers/reportAsistant.php	(revision 742)
@@ -179,4 +179,14 @@
         }
 
+		$data['daterange_start'] = "";
+		$data['daterange_end'] = "";
+		if ($this->input->post('daterange')){
+			$daterange = explode(" - ", $this->input->post('daterange'));
+			$daterange[0] = str_replace('/', '-', $daterange[0]);
+			$daterange[1] = str_replace('/', '-', $daterange[1]);
+			$data['daterange_start'] = date('Y-m-d H:i:s', strtotime($daterange[0]));
+			$data['daterange_end'] = date('Y-m-d H:is:s', strtotime($daterange[1].' + 1 day'));
+		}
+		
         $data['start'] = ($data['current_page'] - 1) * $data['perpage'];
         $data['total'] = $this->collabolator_model->countCountCollaboratorUsers($data);
Index: pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php	(revision 741)
+++ pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php	(revision 742)
@@ -59,4 +59,6 @@
 		if ($this->input->post('daterange')){
 			$daterange = explode(" - ", $this->input->post('daterange'));
+			$daterange[0] = str_replace('/', '-', $daterange[0]);
+			$daterange[1] = str_replace('/', '-', $daterange[1]);
 			$data['daterange_start'] = date('Y-m-d H:i:s', strtotime($daterange[0]));
 			$data['daterange_end'] = date('Y-m-d H:is:s', strtotime($daterange[1].' + 1 day'));
Index: pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php	(revision 741)
+++ pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php	(revision 742)
@@ -149,7 +149,9 @@
        // $from = date("Y-m-d 00:00:00",$from); 
         //$sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.id ".$where." AND tbluser.collaborator = ".$data['id']." ".$order."";
-   
-        $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND tblcollaborator.id = ".$data['id']." ".$order."";
-
+		if(strlen($data['daterange_start'])>0){
+			$sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND (tbluser.created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."') AND tblcollaborator.id = ".$data['id']." ".$order."";
+		}else{
+			$sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND tblcollaborator.id = ".$data['id']." ".$order."";
+		}	
 		$result = $this->db->query($sql)->result_array();
         foreach ($result as $index=>$paidlog)
@@ -174,12 +176,14 @@
         if ($data['keyword']) {
             if ($data['search_field'] == "cellphone") {
-                $where.=" WHERE (tbluser.cellphone LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
+                $where.=" WHERE (tbluser.cellphone LIKE '%" . $data['keyword'] . "%' OR tblcollaborator.district LIKE '%".$data['keyword']."%' OR tblcollaborator.province LIKE '%".$data['keyword']."%')";
             } 
         }
        // $from = date("Y-m-d 00:00:00",$from); 
        // $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.id ".$where." AND tbluser.collaborator = ".$data['id']." ".$order." LIMIT " . $data['start'] . ", " . $data['perpage'] . " ";
-		
-        $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND tblcollaborator.id = ".$data['id']." ".$order." LIMIT " . $data['start'] . ", " . $data['perpage'] . " ";
-
+		if(strlen($data['daterange_start'])>0){
+			$sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND (tbluser.created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."') AND tblcollaborator.id = ".$data['id']." ".$order." LIMIT " . $data['start'] . ", " . $data['perpage'] . " ";
+		}else{
+			$sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND tblcollaborator.id = ".$data['id']." ".$order." LIMIT " . $data['start'] . ", " . $data['perpage'] . " ";
+		}
 		$result = $this->db->query($sql)->result_array();
         foreach ($result as $index=>$paidlog)
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/reportAsistant/index.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/reportAsistant/index.php	(revision 741)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/reportAsistant/index.php	(revision 742)
@@ -34,4 +34,11 @@
         });
         
+		$('#daterange').keyup(function (event) {
+            if (event.keyCode == '13') {
+                filter();
+				console.log("OK");
+            }
+            return false;
+        });
         
         $( '.sorting, .sorting_desc, .sorting_asc' ).click(function( index ) {
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/reportAsistant/indexCollaborator.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/reportAsistant/indexCollaborator.php	(revision 741)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/reportAsistant/indexCollaborator.php	(revision 742)
@@ -7,4 +7,11 @@
     function init_page()
     {
+		/*
+		if($('input[name="daterange"]').val() !== ""){
+			$('#remove').click(function(){
+				$('input[name="daterange"]').val("");
+				filter();
+			});
+		}*/
 
         $(".ajax_paging").click(function () {
@@ -18,5 +25,8 @@
                     $("#content").html(data);
                     init_page();
-
+					$('.daterangepicker').daterangepicker({
+						format: 'DD/MM/YYYY'
+					});
+					
                 },
                 error: function (jqXHR, textStatus, errorThrown)
@@ -34,4 +44,16 @@
         });
         
+		$(document).on('click', '.applyBtn', function(){
+			$('#loading').css('display', 'block');
+			$('#table_content').hide();
+			filter();
+		});
+		
+		$('#daterange').keyup(function (event) {
+            if (event.keyCode == '13') {
+                filter();
+            }
+            return false;
+        });
         
         $( '.sorting, .sorting_desc, .sorting_asc' ).click(function( index ) {
@@ -105,4 +127,5 @@
     function filter()
     {
+		daterange = $('input[name="daterange"]').val();
         $.ajax({
             url: '<?php echo base_url();?>admin/thong_ke_cong_tac_vien/trang_ctv/<?php echo $id;?>/1',
@@ -113,8 +136,12 @@
                 // $result = jQuery.parseJSON(data);
                 $("#content").html(data);
-                init_page();
+               
                 $("#keyword").focus();
                 $("#keyword").setCursorToTextEnd();
-
+				$('.daterangepicker').daterangepicker({
+					format: 'DD/MM/YYYY'
+				});
+				$('input[name="daterange"]').val(daterange);
+				init_page();
             },
             error: function (jqXHR, textStatus, errorThrown)
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/reportAsistant/listview_user.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/reportAsistant/listview_user.php	(revision 741)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/reportAsistant/listview_user.php	(revision 742)
@@ -26,5 +26,11 @@
                                 <div class="dataTables_filter" id="sample-table-2_filter">
                                     <label>TÃ¬m kiáº¿m: 
-                                        <input type="text" name="keyword" id="keyword" value='<?php echo $keyword;?>' aria-controls="sample-table-2"></label>
+                                        <input type="text" name="keyword" id="keyword" value='<?php echo $keyword;?>' style="width: 162px; height: 18px;" aria-controls="sample-table-2"></label>
+                                </div>
+								<div style="clear: both;"></div>
+                                <div id="daterangepicker" class="selectbox pull-right">
+                                    <i class="icon-calendar"></i>
+									<!--<i id="remove" class="btn-sm btn-danger icon-remove"></i>-->
+                                    <input id="daterange" type="text" name="daterange" class="daterangepicker" style="background: #ffffff; width: 176px; height: 28px; position: inherit;">
                                 </div>
                             </div>
@@ -36,6 +42,6 @@
                         <thead>
                             <tr role="row">                               
-                                <!--<th class="<?php if ($sorting_field == 'full_name') {echo $sorting_order;} else {echo "";}?>" id="full_name" 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">TÃªn ngÆ°á»i dÃ¹ng</th>-->
-                                <th class="<?php if ($sorting_field == 'collaborator_cellphone') {echo $sorting_order;} else {echo "sorting";}?>" id="collaborator_cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 283px;" aria-label="Há» tÃªn: activate to sort column ascending">Sá» Äiá»n thoáº¡i ngÆ°á»i dÃ¹ng</th>
+                                <th class="<?php if ($sorting_field == 'full_name') {echo $sorting_order;} else {echo "";}?>" id="full_name" 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">TÃªn ngÆ°á»i dÃ¹ng</th>
+                                <th class="<?php if ($sorting_field == 'collaborator_cellphone') {echo $sorting_order;} else {echo "sorting";}?>" id="collaborator_cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 283px;" aria-label="Há» tÃªn: activate to sort column ascending">Sá» Äiá»n thuÃª bao</th>
                                 <th class="<?php if ($sorting_field == 'total_user') {echo $sorting_order;} else {echo "sorting";}?>" id="total_user" 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">NgÃ y giá»i thiá»u</th>  
                                 <!--<th class="<?php if ($sorting_field == 'collaborator_created_time') {echo $sorting_order;} else {echo "sorting";}?>" id="collaborator_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">NgÃ y ÄÄng kÃœ</th>-->
@@ -51,8 +57,8 @@
                             <tr class="odd">
                                 
-
-                                <!--<td class=" ">
+								
+                                <td class=" ">
 									<?php echo $paidlog['username']; ?>                                    
-                                </td>-->
+                                </td>
                                 <td class=" "><?php echo $paidlog['user_cellphone']?></td>                                
                                 <td class="hidden-480 "><?php echo $paidlog['user_created_time'];?></td>
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/user/index.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/user/index.php	(revision 741)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/user/index.php	(revision 742)
@@ -16,5 +16,7 @@
                     $("#content").html(data);
                     init_page();
-					$('.daterangepicker').daterangepicker();
+					$('.daterangepicker').daterangepicker({
+						format: 'DD/MM/YYYY'
+					});
                 },
                 error: function (jqXHR, textStatus, errorThrown)
@@ -88,9 +90,11 @@
 				$('#table_content').show();
 				$("#content").html(data);
-				init_page();
 				$("#keyword").focus();
 				$("#keyword").setCursorToTextEnd();
-				$('.daterangepicker').daterangepicker();
+				$('.daterangepicker').daterangepicker({
+					format: 'DD/MM/YYYY'
+				});
 				$('input[name="daterange"]').val(daterange);
+				init_page();
 			},
 			error: function (jqXHR, textStatus, errorThrown)
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php	(revision 741)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php	(revision 742)
@@ -79,6 +79,4 @@
                                     <i class="icon-calendar"></i>
                                     <input id="daterange" type="text" name="daterange" class="daterangepicker" style="background: #ffffff; width: 176px; height: 28px; position: inherit;">
-
-                                    </span>
                                 </div>
                             </div>
