Index: pro-violet-viettel/sourcecode/application/modules/frontend/controllers/lecture.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/frontend/controllers/lecture.php	(revision 574)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/controllers/lecture.php	(revision 580)
@@ -29,4 +29,14 @@
             $username = $user_info['username'];    
             $first_visit=0;
+            $update_user_info=0;
+            parse_str($user_info['user'], $info);
+            $this->load->model('user_model');
+            $user = $user_info['user'];
+            $us_id = $user_info['us_id'];
+            $u = $this->user_model->get_user_by_id($us_id);
+            if (($info['fullname']=="")&&($u['p_id']!=""))
+            {
+                $update_user_info=1;
+            }
             if (!$this->session->userdata('first_visit'))
             {
@@ -34,5 +44,5 @@
                $first_visit=1;
             }
-          $this->load->view('lecture_editor', array('username' => $username, 'licenseAvailable' => $licenseAvailable, 'first_visit' => $first_visit, 'licflashVars' => $aryParams));
+          $this->load->view('lecture_editor', array('username' => $username, 'licenseAvailable' => $licenseAvailable, 'first_visit' => $first_visit, 'licflashVars' => $aryParams,'update_user_info'=>$update_user_info,'us_id'=>$us_id));
         } else {
             redirect('/frontend/home/');
Index: pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php	(revision 574)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php	(revision 580)
@@ -27,8 +27,5 @@
             $data['packages'] = $this->servicepackage_model->getAllPackages();
             $data['is_viettel'] = $user_info['is_viettel'];
-			//$paidlogs = $this->user_model->getPaidlog($us_id);
-			
-			//$data['paidlogs'] = $paidlogs;
-            parse_str($user, $info);
+            
             $data = array_merge($data, $u);
             $data = array_merge($data, $user_info);
@@ -58,5 +55,10 @@
                 $result['can_buy'] = 0;
             }
+            
             if ($user['p_id'] < 1) {
+                $result['can_edit'] = 1;
+            }
+            if ($info['fullname']=="")
+            {
                 $result['can_edit'] = 1;
             }
@@ -198,5 +200,43 @@
         }
     }
-
+public function update_info() {
+        $result['success']=0;
+        $user_info = $this->session->userdata('userInfo');
+        if ($user_info) {
+            $us_id = $user_info['us_id'];
+            $result = array();
+            $result['success'] = 0;
+            $src = "SBG";
+            $token = md5($us_id . self::TOKENPW);
+            $user = $this->get_data($src, $token, $us_id);
+            $input = $this->input->post();
+            parse_str($user_info['user'], $info);
+            if ($input) {
+                if (strlen($input['fullname']) == 0) {
+                    $result['errors'][] = array("content"=>"Há» tÃªn khÃŽng ÄÆ°á»£c Äá» trá»ng!","field"=>"fullname");
+                }
+                if (strlen($input['school']) == 0) {
+                    $result['errors'][] = array("content"=>"TÃªn ÄÆ¡n vá» khÃŽng ÄÆ°á»£c Äá» trá»ng!","field"=>"school");
+                }
+
+                $input['password'] = '';
+                $input['oldpass'] = '';
+                $input['province'] = '';
+                $this->load->model('user_model');
+                if (!isset($result['errors'])) {
+                    $result['data'] = $this->user_model->update_user($src, $token, $input, $us_id);
+                    $result['success'] = 1;
+                    $info['fullname']=$input['fullname'];
+                    $info['school']=$input['school'];
+                    $info = urldecode(http_build_query($info));
+                    $userdata = array('username' => $user_info['username'], 'user' => $info, 'us_id' => $user_info['us_id'], 'logined_in' => TRUE, 'is_viettel' => $user_info['is_viettel']);
+                    $this->session->set_userdata('userInfo', $userdata);
+                }
+                echo json_encode($result);
+            }
+        } else {
+            redirect('frontend/home');
+        }
+    }
     public function update_user() {
         $us_id = $this->uri->segment(4);
