Index: pro-violet-viettel/sourcecode/application/modules/admin/controllers/collaborator.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/controllers/collaborator.php	(revision 689)
+++ pro-violet-viettel/sourcecode/application/modules/admin/controllers/collaborator.php	(revision 690)
@@ -53,5 +53,11 @@
             
         }
-        
+		$data['daterange_start'] = "";
+		$data['daterange_end'] = "";
+        if ($this->input->post('daterange')){
+			$daterange = explode(" - ", $this->input->post('daterange'));
+			$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->countCollaborator($data);  
Index: pro-violet-viettel/sourcecode/application/modules/admin/controllers/report.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/controllers/report.php	(revision 689)
+++ pro-violet-viettel/sourcecode/application/modules/admin/controllers/report.php	(revision 690)
@@ -59,5 +59,11 @@
             }
         }
-
+		$data['daterange_start'] = "";
+		$data['daterange_end'] = "";
+		if ($this->input->post('daterange')){
+			$daterange = explode(" - ", $this->input->post('daterange'));
+			$data['daterange_start'] = date('Y-m-d H:i:s', strtotime($daterange[0]));
+			$data['daterange_end'] = date('Y-m-d 23:59:59', strtotime($daterange[1]));
+		}
         $data['start'] = ($data['current_page'] - 1) * $data['perpage'];
         $data['total'] = $this->paidlog_model->countPaidlog($data);
Index: pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php	(revision 689)
+++ pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php	(revision 690)
@@ -55,4 +55,11 @@
             $data['keyword'] = $this->input->post('keyword');
         }
+		$data['daterange_start'] = "";
+		$data['daterange_end'] = "";
+		if ($this->input->post('daterange')){
+			$daterange = explode(" - ", $this->input->post('daterange'));
+			$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->user_model->get_total_users($data);
@@ -62,7 +69,11 @@
 		foreach($us as $u) {
 			$id = $u['us_id'];
-			$username = $this->get_username($id);
-			$u['username'] = $username;
-			array_push($users, $u);
+			//$username = $this->get_username($id);
+			$userinfo = $this->get_userinfo($id);
+			if($userinfo){
+				$u['username'] = $userinfo['username'];
+				$u['province'] = $userinfo['province'];
+				array_push($users, $u);
+			}
 		}
 		
@@ -151,5 +162,5 @@
 	}
 	
-	private function get_username($us_id)
+	private function get_userinfo($us_id)
 	{
 		$src = 'violet';
@@ -158,4 +169,8 @@
 		$data = $this->user_model->get_user_info($src, $us_id, $token);
 		//var_dump($data);
+		$result = array();
+		parse_str($data, $result);
+		return $result;
+		/*
 		if (strpos($data, '&')){
 			$arr_users = explode("&", $data);
@@ -166,5 +181,5 @@
 		{
 			return "";
-		}
+		}*/
 
 	}
Index: pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php	(revision 689)
+++ pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php	(revision 690)
@@ -16,9 +16,21 @@
         if ($data['keyword']) {
             if ($data['search_field'] == "cellphone") {
-                $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%')";
+				if(strlen($data['daterange_start'])>0){
+					$sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
+				}else{
+					$sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
+				}
             } else {
-                $sql.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%') ";
-            }
-        }
+				if(strlen($data['daterange_start'])>0){
+					$sql.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
+				}else{
+					$sql.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
+				}
+            }
+        }else{
+			if(strlen($data['daterange_start'])>0){
+				$sql.=" WHERE created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
+			}
+		}
 
         $order = "";
@@ -65,7 +77,7 @@
         if ($data['keyword']) {
             if ($data['search_field'] == "cellphone") {
-                $where.=" WHERE (tblcollaborator.cellphone LIKE '%" . $data['keyword'] . "%')";
+                $where.=" WHERE (tblcollaborator.cellphone LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
             } else {
-                $where.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%') ";
+                $where.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') ";
             }
         }
@@ -92,9 +104,11 @@
         if ($data['keyword']) {
             if ($data['search_field'] == "cellphone") {
-                $where.=" WHERE (tblcollaborator.cellphone LIKE '%" . $data['keyword'] . "%')";
+                $where.=" WHERE (tblcollaborator.cellphone LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
+				
             } else {
-                $where.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%') ";
-            }
-        }
+                $where.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province 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'] . " ";
@@ -123,5 +137,5 @@
         if ($data['keyword']) {
             if ($data['search_field'] == "cellphone") {
-                $where.=" WHERE (tbluser.cellphone LIKE '%" . $data['keyword'] . "%')";
+                $where.=" WHERE (tbluser.cellphone LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
             }
         }
@@ -151,5 +165,5 @@
         if ($data['keyword']) {
             if ($data['search_field'] == "cellphone") {
-                $where.=" WHERE (tbluser.cellphone LIKE '%" . $data['keyword'] . "%')";
+                $where.=" WHERE (tbluser.cellphone LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
             } 
         }
@@ -184,9 +198,21 @@
         if ($data['keyword']) {
             if ($data['search_field'] == "cellphone") {
-                $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%')";
+				if(strlen($data['daterange_start'])>0){
+					$sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
+				}else{
+					$sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
+				}
             } else {
-                $sql.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%') ";
-            }
-        }
+				if(strlen($data['daterange_start'])>0){
+					$sql.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
+				}else{
+					$sql.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') ";
+				}
+            }
+        }else{
+			if(strlen($data['daterange_start'])>0){
+				$sql.=" WHERE created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
+			}
+		}
         $result = $this->db->query($sql)->row_array();
         return $result['total']; 
Index: pro-violet-viettel/sourcecode/application/modules/admin/models/paidlog_model.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/models/paidlog_model.php	(revision 689)
+++ pro-violet-viettel/sourcecode/application/modules/admin/models/paidlog_model.php	(revision 690)
@@ -18,5 +18,11 @@
                 $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%')";
             } 
-        }
+        }else{
+			if(strlen($data['daterange_start'])>0){
+				
+				$sql.=" WHERE paid_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
+				write_file('./log/sql.log', date("m/d/Y H:i:s")." ".$sql."\n", FOPEN_WRITE_CREATE);
+			}
+		}
 
         $order = "";
@@ -42,5 +48,12 @@
                 $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%')";
             } 
-        }
+        }else{
+			if(strlen($data['daterange_start'])>0){
+				
+				$sql.=" WHERE paid_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
+				//write_file('./log/sql.log', date("m/d/Y H:i:s")." ".$sql."\n", FOPEN_WRITE_CREATE);
+			}
+		}
+		
         
         $result = $this->db->query($sql)->row_array();
Index: pro-violet-viettel/sourcecode/application/modules/admin/models/user_model.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/models/user_model.php	(revision 689)
+++ pro-violet-viettel/sourcecode/application/modules/admin/models/user_model.php	(revision 690)
@@ -34,8 +34,26 @@
 			if (strlen($data['keyword'])>0){
 				if ($data['status']==0){
-					$sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%') ";
+					if(strlen($data['daterange_start'])>0){
+						$sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
+					}else
+					{
+						$sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
+					}
 				}else
 				{
-					$sql.=" AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%') ";
+					if(strlen($data['daterange_start'])>0){
+						$sql.=" AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
+					}else{
+						$sql.=" AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') ";
+					}
+				}
+			}else
+			{
+				if(strlen($data['daterange_start'])>0){
+					if ($data['status']==0){
+						$sql.=" WHERE created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
+					}else{
+						$sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
+					}
 				}
 			}
@@ -68,10 +86,29 @@
 			if (strlen($data['keyword'])>0){
 				if ($data['status']==0){
-					$sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%') ";
+					if(strlen($data['daterange_start'])>0){
+						$sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
+					}else
+					{
+						$sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
+					}
 				}else
 				{
-					$sql.=" AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%') ";
+					if(strlen($data['daterange_start'])>0){
+						$sql.=" AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
+					}else{
+						$sql.=" AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') ";
+					}
+				}
+			}else
+			{
+				if(strlen($data['daterange_start'])>0){
+					if ($data['status']==0){
+						$sql.=" WHERE created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
+					}else{
+						$sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
+					}
 				}
 			}
+			
 		}
 		
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/index.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/index.php	(revision 689)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/index.php	(revision 690)
@@ -18,5 +18,5 @@
                     $("#content").html(data);
                     init_page();
-
+					$('.daterangepicker').daterangepicker();
                 },
                 error: function (jqXHR, textStatus, errorThrown)
@@ -34,4 +34,9 @@
         });
         
+		$(document).on('click', '.applyBtn', function(){
+			//$('#loading').css('display', 'block');
+			//$('#table_content').hide();
+			filter();
+		});
         
         $( '.sorting, .sorting_desc, .sorting_asc' ).click(function( index ) {
@@ -92,4 +97,5 @@
                 $("#keyword").focus();
                 $("#keyword").setCursorToTextEnd();
+				$('.daterangepicker').daterangepicker();
 
             },
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/listview.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/listview.php	(revision 689)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/listview.php	(revision 690)
@@ -72,6 +72,12 @@
                                 <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 id="daterangepicker" class="selectbox pull-right">
+									<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>
                         </div>
@@ -86,5 +92,6 @@
                                 <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="<?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>Quáº­n/Huyá»n</th>
+								<th>Tá»nh/TP</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>
@@ -107,5 +114,6 @@
                                 <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['district'];?></td>
+								<td class=" "><?php echo $collaborator['province'];?></td>
                                 <td class=" "><?php echo $collaborator['created_time'];?></td>
 
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/home/editSms.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/home/editSms.php	(revision 689)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/home/editSms.php	(revision 690)
@@ -1,3 +1,3 @@
- 
+
     <div class="modal-dialog">
         <div class="modal-content">
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/report/index.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/report/index.php	(revision 689)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/report/index.php	(revision 690)
@@ -18,5 +18,5 @@
                     $("#content").html(data);
                     init_page();
-
+					$('.daterangepicker').daterangepicker();
                 },
                 error: function (jqXHR, textStatus, errorThrown)
@@ -33,5 +33,9 @@
             return false;
         });
-        
+        $(document).on('click', '.applyBtn', function(){
+			//$('#loading').css('display', 'block');
+			//$('#table_content').hide();
+			filter();
+		});
         
         $( '.sorting, .sorting_desc, .sorting_asc' ).click(function( index ) {
@@ -105,4 +109,5 @@
     function filter()
     {
+		daterange = $('input[name="daterange"]').val();
         $.ajax({
             url: '<?php echo base_url();?>admin/doanh_thu_tong_hop/trang/1',
@@ -116,5 +121,6 @@
                 $("#keyword").focus();
                 $("#keyword").setCursorToTextEnd();
-
+				$('.daterangepicker').daterangepicker();
+				$('input[name="daterange"]').val(daterange);
             },
             error: function (jqXHR, textStatus, errorThrown)
@@ -204,4 +210,4 @@
 </div><!-- /.modal-dialog -->
 <?php
-$this->load->view('layout/admin/footer', array('base_url' => $base_url));
+$this->load->view('layout/admin/footer', array('base_url' => $base_url, 'adminjs' => array('assets/js/admin/report.js')));
 ?>
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/report/listview.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/report/listview.php	(revision 689)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/report/listview.php	(revision 690)
@@ -1,3 +1,3 @@
-
+﻿
 
    
@@ -13,10 +13,10 @@
                         <div class="row">
                             <div class="col-sm-6">
-                                <div id="sample-table-2_length" class="dataTables_length"><label>Hiá»n thá» 
+                                <div id="sample-table-2_length" class="dataTables_length"><label>Hiện thị 
                                         <select onchange="filter();" name="items" size="1" aria-controls="sample-table-2">                                      
                                             <?php foreach ($itemsoptions as $option) { ?>
                                             <option <?php if($option == $perpage) echo "selected"; ?> value="<?php echo $option;?>"><?php echo $option;?></option>
                                             <?php } ?>
-                                        </select> báº£n ghi</label>
+                                        </select> bản ghi</label>
 
                                 </div>
@@ -25,7 +25,14 @@
                             <div class="col-sm-6">
                                 <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>
+                                    <label>Tìm kiếm: 
+                                        <input type="text" name="keyword" id="keyword" value='<?php echo $keyword;?>' style="width: 162px; height: 18px;" aria-controls="sample-table-2"></label>
                                 </div>
+								<div id="daterangepicker" class="selectbox pull-right">
+									<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>
                             </div>
                         </div>
@@ -37,9 +44,9 @@
                             <tr role="row">
                                 
-                                <th class="<?php if ($sorting_field == 'fullname') {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">Há» tÃªn</th>
-                                <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: 283px;" aria-label="Há» tÃªn: activate to sort column ascending">Sá» Äiá»n thoáº¡i</th>
-                                <th class="<?php if ($sorting_field == 'amount') {echo $sorting_order;} else {echo "sorting";}?>" id="amount" 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á» tiá»n</th> 
-                                <th class="<?php if ($sorting_field == 'paid_type') {echo $sorting_order;} else {echo "sorting";}?>" id="paid_type" 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">SMS/Card</th> 
-                                <th class="<?php if ($sorting_field == 'paid_time') {echo $sorting_order;} else {echo "sorting";}?>" id="paid_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</th>
+                                <th class="<?php if ($sorting_field == 'fullname') {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">Họ tên</th>
+                                <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: 283px;" aria-label="Họ tên: activate to sort column ascending">Số điện thoại</th>
+                                <th class="<?php if ($sorting_field == 'amount') {echo $sorting_order;} else {echo "sorting";}?>" id="amount" 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ố tiền</th> 
+                                <th class="<?php if ($sorting_field == 'paid_type') {echo $sorting_order;} else {echo "sorting";}?>" id="paid_type" 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">SMS/Card</th> 
+                                <th class="<?php if ($sorting_field == 'paid_time') {echo $sorting_order;} else {echo "sorting";}?>" id="paid_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</th>
                                   
                         </thead>
@@ -76,5 +83,5 @@
 
                         </tbody></table><div class="row"><div class="col-sm-6">
-                                <div class="dataTables_info" id="sample-table-2_info">Hiá»n thá» <?php echo ($start+1)?> Äáº¿n <?php echo ($start+$perpage)?> cá»§a <?php echo $total?> báº£n ghi</div>
+                                <div class="dataTables_info" id="sample-table-2_info">Hiển thị <?php echo ($start+1)?> đến <?php echo ($start+$perpage)?> của <?php echo $total?> bản ghi</div>
                                     
                             </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 689)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/user/index.php	(revision 690)
@@ -16,4 +16,5 @@
                     $("#content").html(data);
                     init_page();
+					$('.daterangepicker').daterangepicker();
                 },
                 error: function (jqXHR, textStatus, errorThrown)
@@ -24,5 +25,23 @@
             return false;
         });
-		$('#keyword').bind('input', function(){
+		$('#keyword').keyup(function (event) {
+            if (event.keyCode == '13') {
+                filter();
+            }
+            return false;
+        });
+		/*$('#keyword').bind('input', function(){
+			filter();
+		});*/
+		$('#daterange').keyup(function (event) {
+            if (event.keyCode == '13') {
+                filter();
+            }
+            return false;
+        });
+		
+		$(document).on('click', '.applyBtn', function(){
+			$('#loading').css('display', 'block');
+			$('#table_content').hide();
 			filter();
 		});
@@ -59,4 +78,5 @@
 	function filter()
 	{
+		daterange = $('input[name="daterange"]').val();
 		$.ajax({
 			url: '<?php echo base_url();?>admin/nguoi_dung/trang/1',
@@ -65,9 +85,12 @@
 			success: function (data, textStatus, jqXHR)
 			{
+				$('#loading').css('display', 'none');
+				$('#table_content').show();
 				$("#content").html(data);
 				init_page();
 				$("#keyword").focus();
 				$("#keyword").setCursorToTextEnd();
-
+				$('.daterangepicker').daterangepicker();
+				$('input[name="daterange"]').val(daterange);
 			},
 			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 689)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php	(revision 690)
@@ -66,12 +66,20 @@
                                 <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 class="dataTables_status" style="float: right;" id="sample-table-2_status"><label>Lá»c:
-									<select onchange="filter();" name="status" size="1" style="width: 139px; height: 28px;" aria-controls="sample-table-2" class="">                                      
+									<select onchange="filter();" name="status" size="1" style="width: 176px; height: 28px;">                                      
 										<?php foreach ($statusoptions as $key=>$option):?>
 										<option <?php if ($key == $status) echo "selected"; ?> value="<?php echo $key; ?>"><?php echo $option; ?></option>
 										<?php endforeach; ?>
 									</select>
+								</div>
+								<div style="clear: both;"></div>
+								<div id="daterangepicker" class="selectbox pull-right">
+									<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>
                             </div>
@@ -82,4 +90,7 @@
 						<input type="hidden" name="sorting_field" id="sorting_field" value="<?php echo $sorting_field;?>"/>
                     </form>
+					<!-- Table Content -->
+					<center><div id="loading" style="display:none;"><img src="<?php echo base_url();?>/assets/img/loading.gif"/></div></center>
+					<div id="table_content">
                     <table class="table table-striped table-bordered table-hover dataTable" id="sample-table-2" aria-describedby="sample-table-2_info">
                         <thead>
@@ -91,16 +102,18 @@
                                     </label>
                                 </th>
-								<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="TÃ i khoáº£n: activate to sort column ascending">Username</th>
-                                <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 == 'acc_balanced') {echo $sorting_order;} else {echo "sorting";}?>" id="acc_balanced" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Tiá»n: activate to sort column ascending">TÃ i khoáº£n (VNÄ)</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: 150px;" 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: 156px;" aria-label="TÃ i khoáº£n: activate to sort column ascending">Username</th>
+                                <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: 156px;" aria-label="Sá» Äiá»n thoáº¡i: activate to sort column ascending">Sá» Äiá»n thoáº¡i</th>
+                                <th class="<?php if ($sorting_field == 'acc_balanced') {echo $sorting_order;} else {echo "sorting";}?>" id="acc_balanced" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;" aria-label="Tiá»n: activate to sort column ascending">TÃ i khoáº£n (VNÄ)</th>
+								<th style="width: 140px;">Quáº­n/Huyá»n</th>
+								<th style="width: 140px;">Tá»nh/TP</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: 156px;" 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="<?php if ($sorting_field == 'expire_date') {echo $sorting_order;} else {echo "sorting";}?>" id="expire_date" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 150px;" aria-label="NgÃ y háº¿t háº¡n: activate to sort column ascending">
+								<th class="<?php if ($sorting_field == 'expire_date') {echo $sorting_order;} else {echo "sorting";}?>" id="expire_date" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 140px;" aria-label="NgÃ y háº¿t háº¡n: activate to sort column ascending">
                                     <i class="icon-time bigger-110 hidden-480"></i>
                                     NgÃ y háº¿t háº¡n
                                 </th>
-								<th class="sorting_disabled" id="status" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;">TÃ¬nh tráº¡ng</th>
+								<th class="sorting_disabled" id="status" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;">TÃ¬nh tráº¡ng</th>
                             </tr>
                         </thead>
@@ -119,5 +132,5 @@
                                 </td>
 								<td class=" ">
-                                    <a onclick="getUserHistory(<?php echo $user['us_id']; ?>, 1);" data-toggle="modal"><?php echo @$user['username']; ?></a>
+                                    <a onclick="getUserHistory(<?php echo $user['us_id']; ?>, 1);" data-toggle="modal"><?php echo $user['username']; ?></a>
 									 <!--<a href="#user-history" data-toggle="modal"><?php echo @$user['username']; ?></a>-->
                                 </td>
@@ -126,6 +139,9 @@
                                 </td>
                                 <td class="hidden-480 "><?php echo number_format($user['acc_balanced'], 0); ?></td>
+								<td><?php echo $user['district']; ?></td>
+								<td><?php echo $user['province']; ?></td>
                                 <td class=" "><?php echo $user['created_time']; ?></td>
 								<td class=" "><?php echo isset($user['expire_date']) && strtotime($user['expire_date'])>0 ? date('d/m/Y', strtotime($user['expire_date'])) : '';?></td>
+
 								<td class=" ">
 								<?php  if(strtotime($user['expire_date'])>time()){ ?>
@@ -151,4 +167,5 @@
 								</div>
 							</div>
+						</div>
 						</div>
 
@@ -249,4 +266,3 @@
     }
 
-
 </script>
Index: pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php	(revision 689)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php	(revision 690)
@@ -29,6 +29,5 @@
             $data['packages'] = $this->servicepackage_model->getAllPackages();
             $data['is_viettel'] = $user_info['is_viettel'];
-            
-            $data = array_merge($data, $u);
+			$data = array_merge($data, $u);
             $data = array_merge($data, $user_info);
 			
@@ -358,5 +357,5 @@
 			foreach ($result as $paidlog):
 				$paidlog['amount'] = number_format($paidlog['amount'], 0);
-				$paidlog['paid_time'] = date('d-m-Y H:i:s', strtotime($paidlog['paid_time']));
+				$paidlog['paid_time'] = date('d/m/Y H:i:s', strtotime($paidlog['paid_time']));
 				array_push($paidlogs, $paidlog);
 			endforeach;
Index: pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php	(revision 689)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php	(revision 690)
@@ -86,10 +86,11 @@
                 $this->load->model('frontend/Servicepackage_model');
 				$trialpackage=$this->Servicepackage_model->getTrialPackage();
-                                $us_id = $id;
+				$us_id = $id;
 				$user ['created_time'] = date ( 'Y-m-d H:i:s' );
 				$user ['us_id'] = $us_id;
-                                $user ['p_id'] = $trialpackage['p_id']; 
-                                $user ['expire_date'] = date('Y-m-d', strtotime("+" . $this->config->item("trial_period") . " days", time()));
+				$user ['p_id'] = $trialpackage['p_id']; 
+				$user ['expire_date'] = date('Y-m-d', strtotime("+" . $this->config->item("trial_period") . " days", time()));
 				$user ['cellphone'] = $username;
+				$user['province'] = $province;
 				if (! is_null ( $collaborator ) || $collaborator != '') {
 					$user ['collaborator'] = $collaborator;
@@ -163,4 +164,10 @@
 				'oldpass' => $user ['oldpass'] 
 		), 'user' );
+		$u = array('province'=>$user['province'],
+				'district'=>$user['district'],
+				'updated_time'=>date('Y-m-d H:i:s')
+				);
+		$this->db->where('us_id', $us_id);
+		$this->db->update('tbluser', $u);
 		return $data;
 	}
Index: pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php	(revision 689)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php	(revision 690)
@@ -101,5 +101,12 @@
 
                                                     <div class="col-sm-8">
-                                                        <input type="text" name="province" value="<?php echo @$province; ?>" placeholder="Tá»nh / ThÃ nh phá»" id="form-field-username" class="col-xs-12 col-sm-10">
+                                                        <input type="text" name="province" value="<?php echo @$province; ?>" placeholder="Tá»nh / ThÃ nh phá»" id="form-field-province" class="col-xs-12 col-sm-10">
+                                                    </div>
+                                                </div>
+												<div class="form-group">
+                                                    <label for="form-field-username" class="col-sm-4 control-label no-padding-right">Quáº­n / Huyá»n</label>
+
+                                                    <div class="col-sm-8">
+                                                        <input type="text" name="district" value="<?php echo @$district; ?>" placeholder="Quáº­n / Huyá»n" id="form-field-district" class="col-xs-12 col-sm-10">
                                                     </div>
                                                 </div>
