Index: /pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php	(revision 407)
+++ /pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php	(revision 408)
@@ -3,4 +3,7 @@
 class User extends MX_Controller
 {
+	
+	const TOKENPW = 'violet';
+	
 	public function __construct()
 	{
@@ -29,4 +32,10 @@
 		$data['itemsoptions'] = array(10, 25, 50, 100);
 		$data['perpage'] = 10;
+		$data['statusoptions'] = array(0=>"Táº¥t cáº£", 1=>"KÃ­ch hoáº¡t", 2=>"Táº¡m ngÆ°ng");
+		$data['status'] = 0;
+		if ($this->input->post('status')) 
+		{
+			$data['status'] = (int)$this->input->post('status') ;
+		}
 		$data['keyword'] = "";
 		$data['sorting_order']="sorting_desc";
@@ -48,5 +57,14 @@
 		$data['start'] = ($data['current_page'] - 1) * $data['perpage'];
 		$data['total'] = $this->user_model->get_total_users($data);
-		$data['users'] = $this->user_model->get_list_users($data);
+		$us = $this->user_model->get_list_users($data);
+		$users = array();
+		foreach($us as $u):
+			$id = $u['us_id'];
+			$username = $this->get_username($id);
+			$u['username'] = $username;
+			array_push($users, $u);
+		endforeach;
+		
+		$data['users'] = $users;
 		$data['paging_url'] = base_url() . "admin/nguoi_dung/trang/";
 		$data['num_links'] = 2;
@@ -132,3 +150,21 @@
 	}
 	
+	private function get_username($us_id)
+	{
+		$src = 'violet';
+		$token = md5($us_id.self::TOKENPW);
+		$this->load->model('user_model');
+		$data = $this->user_model->get_user_info($src, $us_id, $token);
+		if (strlen($data) > 0){
+			$arr_users = explode("&", $data);
+			$str_username = $arr_users[1];
+			$arr_username = explode("=", $str_username);
+			return $arr_username[1];
+		}else
+		{
+			return "";
+		}
+
+	}
+	
 }
Index: /pro-violet-viettel/sourcecode/application/modules/admin/models/user_model.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/admin/models/user_model.php	(revision 407)
+++ /pro-violet-viettel/sourcecode/application/modules/admin/models/user_model.php	(revision 408)
@@ -10,4 +10,6 @@
 	{
 		parent::__construct();
+		$this->vservices->setApiUrl($this->config->item('api_url'));
+		$this->vservices->setConnection($this->curl);
 	}
 	
@@ -26,10 +28,18 @@
 			$sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%') ";
 		}
+		if ($data['status'] == 1){
+			$sql.=" WHERE expire_date > NOW()";
+		}
+		if ($data['status'] == 2){
+			$sql.=" WHERE expire_date < NOW()";
+		}
 		$order = "";
 		if ($data['sorting_order'] != "sorting") {
-			$sort = "DESC";
-			if ($data['sorting_order'] == "sorting_asc")
-				$sort = "ASC";
-			$order = "ORDER BY " . $data['sorting_field'] . " " . $sort;
+			if($data['sorting_field'] != "status"){
+				$sort = "DESC";
+				if ($data['sorting_order'] == "sorting_asc")
+					$sort = "ASC";
+				$order = "ORDER BY " . $data['sorting_field'] . " " . $sort;
+			}
 		}
 		return $this->db->query($sql." ".$order." LIMIT ".$data['start'].", ".$data['perpage']." ")->result_array();
@@ -39,9 +49,24 @@
 	{
 		$sql="SELECT COUNT(".$this->id_name.") AS total FROM ".$this->table_name;
+		
+		if ($data['status'] == 1){
+			$sql.=" WHERE expire_date > NOW()";
+		}
+		if ($data['status'] == 2){
+			$sql.=" WHERE expire_date < NOW()";
+		}
+		
 		if (isset($data['keyword']))
 		{
-			$sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%') ";
+			if (strlen($data['keyword'])>0)
+				$sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%') ";
 		}
 		return $this->db->query($sql)->row_array()['total'];
 	}
+	
+	function get_user_info($src, $us_id, $token)
+	{
+		$data = $this->vservices->actionExecute('getinfo', array('src' => $src, 'us_id' => $us_id, 'token'=>$token), 'user');
+		return $data;
+	}
 }
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 407)
+++ /pro-violet-viettel/sourcecode/application/modules/admin/views/admin_acc/listview.php	(revision 408)
@@ -90,5 +90,6 @@
                                     NgÃ y ÄÄng kÃœ
                                 </th>
-                                <th class="hidden-480 sorting" id="status" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 158px;" aria-label="Tráº¡ng thÃ¡i: activate to sort column ascending">Tráº¡ng thÃ¡i</th><th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 133px;" aria-label=""></th></tr>
+                                <th class="sorting_disabled" id="status" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 158px;" aria-label="Tráº¡ng thÃ¡i: activate to sort column ascending">Tráº¡ng thÃ¡i</th>
+								<th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 133px;" aria-label=""></th></tr>
                         </thead>
 
Index: /pro-violet-viettel/sourcecode/application/modules/admin/views/user/index.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/admin/views/user/index.php	(revision 407)
+++ /pro-violet-viettel/sourcecode/application/modules/admin/views/user/index.php	(revision 408)
@@ -51,5 +51,4 @@
                 }
             }
-			console.log($( this ).attr('class'));
             $("#sorting_field").val($(this).attr("id"));
             $("#sorting_order").val($(this).attr("class"));
@@ -104,5 +103,5 @@
 
             <div class="modal-body">
-                <form id="add_user" onsubmit="return false;" class="form-horizontal" role="form">
+                <form id="add_frm" onsubmit="return false;" class="form-horizontal" role="form">
                     <div class="form-group">
                         <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> Sá» Äiá»n thoáº¡i </label>
Index: /pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php	(revision 407)
+++ /pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php	(revision 408)
@@ -41,5 +41,4 @@
             <div style="padding-bottom:4px" class="table-header">
                 Danh sÃ¡ch
-
                 <button href="#addUser" data-toggle="modal" class="btn btn-success pull-right">
                     <i class="icon-plus"></i>
@@ -55,5 +54,5 @@
                             <div class="col-sm-6">
                                 <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">                                      
+                                        <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="<?=$option?>"><?=$option?></option>
@@ -63,5 +62,5 @@
                                 </div>
                             </div>
-
+								
                             <div class="col-sm-6">
                                 <div class="dataTables_filter" id="sample-table-2_filter">
@@ -70,5 +69,15 @@
                                 </div>
                             </div>
+							<div class="col-sm-6">
+                                <div class="dataTables_status" id="sample-table-2_status"><label>Lá»c
+									<select onchange="filter();" name="status" size="1" aria-controls="sample-table-2" class="">                                      
+										<?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>
                         </div>
+							
 						<input type="hidden" name="sorting_order" id="sorting_order" value="<?php echo $sorting_order;?>" />
 						<input type="hidden" name="sorting_field" id="sorting_field" value="<?php echo $sorting_field;?>"/>
@@ -83,4 +92,5 @@
                                     </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">TÃ i khoáº£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 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: 122px;" aria-label="Tiá»n: activate to sort column ascending">Tiá»n</th>
@@ -93,5 +103,6 @@
                                     NgÃ y háº¿t háº¡n
                                 </th>
-                                <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 133px;" aria-label=""></th></tr>
+								<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>
+                            </tr>
                         </thead>
 
@@ -108,69 +119,23 @@
                                     </label>
                                 </td>
-
+								<td class=" ">
+                                    <a href="#"><?php echo $user['username']; ?></a>
+                                </td>
                                 <td class=" ">
-                                    <a href="#"><?php echo $user['cellphone']; ?></a>
+                                    <?php echo $user['cellphone']; ?>
                                 </td>
-                                <td class="hidden-480 "><?php echo $user['acc_balanced']; ?></td>
+                                <td class="hidden-480 "><?php echo $user['acc_balanced']. " VNÄ"; ?></td>
                                 <td class=" "><?php echo $user['created_time']; ?></td>
 								<td class=" "><?php echo $user['expire_date']; ?></td>
+								<td class=" ">
+								<?php  if(strtotime($user['expire_date'])>time()){ ?>
+									<span class="label label-sm label-success">ÄÃ£ kÃ­ch hoáº¡t</span>
+								<?php }else{ ?>
+									<span class="label label-sm label-warning">Táº¡m ngÆ°ng</span>
+								<?php } ?>
+								</td>
 
-                                <td class=" ">
-                                    <div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
-                                        <a href="#" class="blue">
-                                            <i class="icon-zoom-in bigger-130"></i>
-                                        </a>
-
-                                        <a href="#editUser" data-toggle="modal" data-us-id=<?php echo $user['us_id']; ?> class="green">
-                                            <i class="icon-pencil bigger-130"></i>
-                                        </a>
-
-                                        <a href="#deleteUser" data-toggle="modal" data-us-id=<?php echo $user['us_id']; ?> class="red">
-                                            <i class="icon-trash bigger-130"></i>
-                                        </a>
-                                    </div>
-
-                                    <div class="visible-xs visible-sm hidden-md hidden-lg">
-                                        <div class="inline position-relative">
-                                            <button data-toggle="dropdown" class="btn btn-minier btn-yellow dropdown-toggle">
-                                                <i class="icon-caret-down icon-only bigger-120"></i>
-                                            </button>
-
-                                            <ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
-                                                <li>
-                                                    <a title="" data-rel="tooltip" class="tooltip-info" href="#" data-original-title="View">
-                                                        <span class="blue">
-                                                            <i class="icon-zoom-in bigger-120"></i>
-                                                        </span>
-                                                    </a>
-                                                </li>
-
-                                                <li>
-                                                    <a title="" data-rel="tooltip" class="tooltip-success" href="#" data-original-title="Edit">
-                                                        <span class="green">
-                                                            <i class="icon-edit bigger-120"></i>
-                                                        </span>
-                                                    </a>
-                                                </li>
-
-                                                <li>
-                                                    <a title="" data-rel="tooltip" class="tooltip-error" href="#" data-original-title="Delete">
-                                                        <span class="red">
-                                                            <i class="icon-trash bigger-120"></i>
-                                                        </span>
-                                                    </a>
-                                                </li>
-                                            </ul>
-                                        </div>
-                                    </div>
-                                </td>
                             </tr>
                             <?php } ?>
-
-
-
-
-
-
 
                         </tbody></table><div class="row"><div class="col-sm-6">
