Index: pro-violet-viettel/sourcecode/application/modules/admin/controllers/home.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/controllers/home.php	(revision 769)
+++ pro-violet-viettel/sourcecode/application/modules/admin/controllers/home.php	(revision 770)
@@ -40,5 +40,10 @@
             redirect("/admin/home");
         } else {
-            $admindata = array('login_name' => $login_name, 'admin_id' => $data->admin_id, 'role_id' => $data->role_id, 'logined_in' => TRUE);
+            $roles=array();
+            for ($i=0; $i < ($data->roles->num_rows()); $i++)
+            {
+                $roles[$i]=$data->roles->row_array($i);
+            }
+            $admindata = array('login_name' => $login_name, 'admin_id' => $data->admin_id, 'role_id' => $data->role_id, 'logined_in' => TRUE, 'roles'=>$roles);
             $this->session->set_userdata('adminInfo', $admindata);
             redirect("/admin/home");
Index: pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php	(revision 769)
+++ pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php	(revision 770)
@@ -14,4 +14,5 @@
 	
 	public function index() {
+                
 		$admin_info = $this->session->userdata ( 'adminInfo' );
 		if ($admin_info) {
@@ -104,4 +105,5 @@
 	
 	public function edit_user() {
+
 		$admin_info = $this->session->userdata ( 'adminInfo' );
 		if ($admin_info) {
@@ -164,4 +166,5 @@
 	
 	private function get_userinfo($us_id) {
+            
 		$src = 'violet';
 		$token = md5 ( $us_id . self::TOKENPW );
Index: pro-violet-viettel/sourcecode/application/modules/admin/models/admin_model.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/models/admin_model.php	(revision 769)
+++ pro-violet-viettel/sourcecode/application/modules/admin/models/admin_model.php	(revision 770)
@@ -16,7 +16,13 @@
 		$hash_password = md5($password);
 		$query = "SELECT * FROM tbladmin WHERE  login_name = ? AND  passwd = ?";
-		$result = $this->db->query($query, array($login_name, $hash_password));
-		if($result->num_rows() == 1){
-			return $result->row(0);
+		$result = $this->db->query($query, array($login_name, $hash_password));		
+                
+                if($result->num_rows() == 1){
+                    $admin = $result->row(0);
+                    $query="SELECT * FROM tbladminrole LEFT JOIN tblrole ON tbladminrole.role_id=tblrole.role_id WHERE tbladminrole.admin_id= ".$admin->admin_id;
+                    $result2 = $this->db->query($query);
+                    $admin->roles=$result2;
+                    return $admin; 
+                     
 		}else
 		{
Index: pro-violet-viettel/sourcecode/application/modules/frontend/views/user_infor.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/frontend/views/user_infor.php	(revision 769)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/views/user_infor.php	(revision 770)
@@ -43,7 +43,15 @@
         </div>
     </div>
-    <input type="hidden" name="us_id" value="<?php echo $user['us_id']?>">
-    <!-- 
-    <input type="button" value="Cáº­p nháº­t" onclick="admin_update_user();"/>
---> 
+
+    <input type="hidden" name="us_id" value="<?php echo $user['us_id'] ?>">
+    <?php
+    if (in_array("editUserInfo", $roles)) {
+        ?><div class="col-xs-12" style="margin: 5px;">
+            <div class="form-group">
+                <input  class="btn btn-primary pull-right " type="button" value="Cáº­p nháº­t" onclick="admin_update_user();"/>
+            </div>
+        </div>
+        <?php
+    }
+    ?>
 </form>
Index: pro-violet-viettel/sourcecode/assets/js/admin/user.js
===================================================================
--- pro-violet-viettel/sourcecode/assets/js/admin/user.js	(revision 769)
+++ pro-violet-viettel/sourcecode/assets/js/admin/user.js	(revision 770)
@@ -92,5 +92,5 @@
                             $('#user-history').modal('hide');
                             alert("ÄÃ£ cáº­p nháº­t");
-                            
+                            location.reload();
                         }
 
