Index: /pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php	(revision 768)
+++ /pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php	(revision 769)
@@ -39,6 +39,6 @@
 		$data ['statusoptions'] = array (
 				0 => "Táº¥t cáº£",
-				1 => "ÄÃ£ ÄÄng kÃœ",
-				2 => "DÃ¹ng thá»­",
+				1 => "ÄÃ£ ÄÄng kÃœ VIP",
+				2 => "DÃ¹ng thá»­ 7 ngÃ y",
 				3=> "DÃ¹ng thá»­ háº¡n cháº¿",
 				4=> "Háº¿t háº¡n"
@@ -47,4 +47,9 @@
 		if ($this->input->post ( 'status' )) {
 			$data ['status'] = ( int ) $this->input->post ( 'status' );
+		}
+		$data['provinces'] = $provinces;
+		$data['province_code'] = '';
+		if ($this->input->post ( 'province-code' )) {
+			$data ['province_code'] = $this->input->post ( 'province-code' );
 		}
 		$data ['keyword'] = "";
Index: /pro-violet-viettel/sourcecode/application/modules/admin/models/user_model.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/admin/models/user_model.php	(revision 768)
+++ /pro-violet-viettel/sourcecode/application/modules/admin/models/user_model.php	(revision 769)
@@ -40,16 +40,24 @@
 			if (strlen($data['keyword'])>0){
 				if ($data['status']==0){
-					if(strlen($data['daterange_start'])>0){
-						$sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced 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 province LIKE '%".$data['keyword']."%')";
+					if (strlen($data['province_code'])>0){
+						if(strlen($data['daterange_start'])>0){
+							$sql.=" WHERE province = '".$data['province_code']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
+						}
+					}else{
+						if(strlen($data['daterange_start'])>0){
+							$sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced 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 province LIKE '%".$data['keyword']."%')";
+						}
 					}
 				}else
 				{
-					if(strlen($data['daterange_start'])>0){
-						$sql.=" AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced 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 province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') ";
+					if (strlen($data['province_code'])>0){
+						if(strlen($data['daterange_start'])>0){
+							$sql.=" AND province = '".$data['province_code']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced 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 province = '".$data['province_code']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') ";
+						}
 					}
 				}
@@ -58,8 +66,27 @@
 				if(strlen($data['daterange_start'])>0){
 					if ($data['status']==0){
-						$sql.=" WHERE created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
+						if (strlen($data['province_code'])>0){
+							$sql.=" WHERE province = '".$data['province_code']."' AND created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
+						}else{
+							$sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
+						}
 					}else{
-						$sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
-					}
+						if (strlen($data['province_code'])>0){
+							$sql.=" AND province = '".$data['province_code']."' AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
+						}else{
+							$sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
+						}
+					}		
+				}
+				else{
+					if ($data['status']==0){
+						if (strlen($data['province_code'])>0){
+							$sql.=" WHERE province = '".$data['province_code']."'"; 
+						}
+					}else{
+						if (strlen($data['province_code'])>0){
+							$sql.=" AND province = '".$data['province_code']."'";
+						}
+					}		
 				}
 			}
@@ -98,16 +125,24 @@
 			if (strlen($data['keyword'])>0){
 				if ($data['status']==0){
-					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']."%')";
+					if (strlen($data['province_code'])>0){
+						if(strlen($data['daterange_start'])>0){
+							$sql.=" WHERE province = '".$data['province_code']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
+						}
+					}else{
+						if(strlen($data['daterange_start'])>0){
+							$sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced 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 province LIKE '%".$data['keyword']."%')";
+						}
 					}
 				}else
 				{
-					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']."%') ";
+					if (strlen($data['province_code'])>0){
+						if(strlen($data['daterange_start'])>0){
+							$sql.=" AND province = '".$data['province_code']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced 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 province = '".$data['province_code']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') ";
+						}
 					}
 				}
@@ -116,11 +151,29 @@
 				if(strlen($data['daterange_start'])>0){
 					if ($data['status']==0){
-						$sql.=" WHERE created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
+						if (strlen($data['province_code'])>0){
+							$sql.=" WHERE province = '".$data['province_code']."' AND created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
+						}else{
+							$sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
+						}
 					}else{
-						$sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
-					}
+						if (strlen($data['province_code'])>0){
+							$sql.=" AND province = '".$data['province_code']."' AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
+						}else{
+							$sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
+						}
+					}		
+				}
+				else{
+					if ($data['status']==0){
+						if (strlen($data['province_code'])>0){
+							$sql.=" WHERE province = '".$data['province_code']."'"; 
+						}
+					}else{
+						if (strlen($data['province_code'])>0){
+							$sql.=" AND province = '".$data['province_code']."'";
+						}
+					}		
 				}
 			}
-			
 		}
 		
Index: /pro-violet-viettel/sourcecode/application/modules/admin/views/smslog/index.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/admin/views/smslog/index.php	(revision 768)
+++ /pro-violet-viettel/sourcecode/application/modules/admin/views/smslog/index.php	(revision 769)
@@ -24,7 +24,14 @@
             return false;
         });
+		/*
 		$('#keyword').bind('input', function(){
 			filter();
-		});
+		});*/
+		$('#keyword').keyup(function (event) {
+            if (event.keyCode == '13') {
+                filter();
+            }
+            return false;
+        });
 		
 		$( '.sorting, .sorting_desc, .sorting_asc' ).click(function( index ) {
Index: /pro-violet-viettel/sourcecode/application/modules/admin/views/smslog/listview.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/admin/views/smslog/listview.php	(revision 768)
+++ /pro-violet-viettel/sourcecode/application/modules/admin/views/smslog/listview.php	(revision 769)
@@ -63,10 +63,16 @@
 								</th>
 							<th class="<?php if ($sorting_field == 'sender') {echo $sorting_order;} else {echo "sorting";} ?>" id="sender" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="NgÆ°á»i gá»­i: activate to sort column ascending">NgÆ°á»i gá»­i</th>
-							<th class="<?php if ($sorting_field == 'service_id') {echo $sorting_order;} else {echo "sorting";} ?>" id="service_id" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Dá»ch vá»¥: activate to sort column ascending">Dá»ch vá»¥</th>
+							<!--<th class="<?php if ($sorting_field == 'service_id') {echo $sorting_order;} else {echo "sorting";} ?>" id="service_id" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Dá»ch vá»¥: activate to sort column ascending">Dá»ch vá»¥</th>
 							<th class="<?php if ($sorting_field == 'commandcode') {echo $sorting_order;} else {echo "sorting";} ?>" id="commandcode" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="MÃ£ lá»nh: activate to sort column ascending">MÃ£ lá»nh</th>
-							<th class="<?php if ($sorting_field == 'info') {echo $sorting_order;} else {echo "sorting";} ?>" id="info" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="ThÃŽng tin: activate to sort column ascending">ThÃŽng tin</th>
+							-->
+							<th class="<?php if ($sorting_field == 'info') {echo $sorting_order;} else {echo "sorting";} ?>" id="info" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="ThÃŽng tin: activate to sort column ascending">CÃº phÃ¡p</th>
 							<th class="<?php if ($sorting_field == 'created_time') {echo $sorting_order;} else {echo "sorting";} ?>" id="created_time" class="hidden-480" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Thá»i gian: activate to sort column ascending">
 								<i class="icon-time bigger-110 hidden-480"></i>
 								Thá»i gian gá»­i
+							</th>
+							<th class="<?php if ($sorting_field == 'reply') {echo $sorting_order;} else {echo "sorting";} ?>" id="reply" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Tráº£ lá»i: activate to sort column ascending">Tráº£ lá»i</th>
+							<th class="<?php if ($sorting_field == 'response_time') {echo $sorting_order;} else {echo "sorting";} ?>" id="response_time" class="hidden-480" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Thá»i gian: activate to sort column ascending">
+								<i class="icon-time bigger-110 hidden-480"></i>
+								Thá»i gian tráº£ lá»i
 							</th>
 						</tr>
@@ -86,8 +92,11 @@
 								<?php echo $smslog['sender']; ?>
 							</td>
-							<td><?php echo $smslog['servicename']; ?></td>
+							<!--<td><?php echo $smslog['servicename']; ?></td>
 							<td><?php echo $smslog['commandcode']; ?></td>
+							-->
 							<td><?php echo $smslog['info']; ?></td>
 							<td><?php echo $smslog['created_time']; ?></td>
+							<td><?php echo trim(preg_replace('/\s+/', ' ', $smslog['mtbody'])); ?></td>
+							<td><?php echo $smslog['response_time']; ?></td>
 						</tr>
 						<?php endforeach; ?>
Index: /pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php	(revision 768)
+++ /pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php	(revision 769)
@@ -68,11 +68,21 @@
                                         <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: 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 class="dataTables_status" style="float: right;" id="sample-table-2_status"><label>Lá»c theo tÃ¬nh tráº¡ng:
+									<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 class="dataTables_status" style="float: right;" id="sample-table-2_status"><label>Lá»c theo Tá»nh/TP:
+									<select onchange="filter();" name="province-code" size="1" style="width: 176px; height: 28px;">
+										<option value=''></option>
+										<?php foreach ($provinces as $key => $pro): ?>
+											<option <?php if ($key == $province_code) echo "selected"; ?> value="<?php echo $key; ?>"><?php echo $pro; ?></option>
+										<?php endforeach; ?>
+									</select>
+                                </div>
+								
                                 <div style="clear: both;"></div>
                                 <div id="daterangepicker" class="selectbox pull-right">
@@ -114,5 +124,5 @@
                                 }
                                 ?>" 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">Há» tÃªn</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>
+								
                                 <th class="<?php
                                 if ($sorting_field == 'acc_balanced') {
@@ -143,5 +153,5 @@
                                 </th>
                                 <th style="width: 140px;">Tá»nh/TP</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>
@@ -166,9 +176,13 @@
                                         <?php echo $user['fullname']; ?>
                                     </td>
+                                    <td class="hidden-480 "><?php echo number_format($user['acc_balanced'], 0); ?></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><?php echo $user['province']; ?></td>
 									<td class=" ">
 									<?php if (strtotime($user['expire_date']) > time() && $user['p_id'] != 5 ): ?>
-										<span class="label label-sm label-success">ÄÃ£ ÄÄng kÃœ</span>
+										<span class="label label-sm label-success">ÄÃ£ ÄÄng kÃœ VIP</span>
 									<?php elseif(strtotime($user['expire_date']) > time() && $user['p_id'] == 5): ?>
-										<span class="label label-sm label-info">DÃ¹ng thá»­</span>
+										<span class="label label-sm label-info">DÃ¹ng thá»­ 7 ngÃ y</span>
 									<?php elseif(strtotime($user['expire_date']) < time() && $user['p_id'] == 5): ?>
 										<span class="label label-sm label-warning">DÃ¹ng thá»­ háº¡n cháº¿</span>
@@ -177,9 +191,4 @@
 									<?php endif; ?>
                                     </td>
-                                    <td class="hidden-480 "><?php echo number_format($user['acc_balanced'], 0); ?></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><?php echo $user['province']; ?></td>
-
                                 </tr>
 							<?php endforeach; ?>
