Index: pro-violet-viettel/sourcecode/application/config/database.php
===================================================================
--- pro-violet-viettel/sourcecode/application/config/database.php	(revision 504)
+++ pro-violet-viettel/sourcecode/application/config/database.php	(revision 505)
@@ -46,10 +46,10 @@
 */
 
-$active_group = 'default';
-$active_record = TRUE;
+$active_group = 'default'; 
+$active_record = TRUE; 
 
 $db['default']['hostname'] = 'mysql:host=127.0.0.1';
 $db['default']['username'] = 'root';//sbg
-$db['default']['password'] = '123456';//sbg~~!!@@123
+$db['default']['password'] = 'Quyenhue@123';//sbg~~!!@@123
 $db['default']['database'] = 'violet-viettel';
 $db['default']['dbdriver'] = 'pdo';
Index: pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php	(revision 504)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php	(revision 505)
@@ -15,4 +15,5 @@
     public function profile() {
         $user_info = $this->session->userdata('userInfo');
+    
         if ($user_info) {
             $this->load->model('servicepackage_model');
@@ -25,5 +26,5 @@
             $data['packages'] = $this->servicepackage_model->getAllPackages();
             $this->load->view('frontend/user_profile', $data);
-        } else {
+        } else { 
             redirect('frontend/home');
         }
Index: pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php	(revision 504)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php	(revision 505)
@@ -436,5 +436,8 @@
 	</div>
 </div>
-
+<script type="text/javascript">
+var url=<?php echo base_url();?>
+var current_tab=<?php echo $current_tab;?>
+</script>
 <?php
 $this->load->view('layout/frontend/footer', array('base_url' => $base_url, 'usjs' => array('assets/js/frontend/user.js')));
Index: pro-violet-viettel/sourcecode/assets/js/frontend/user.js
===================================================================
--- pro-violet-viettel/sourcecode/assets/js/frontend/user.js	(revision 504)
+++ pro-violet-viettel/sourcecode/assets/js/frontend/user.js	(revision 505)
@@ -1,50 +1,93 @@
-function updateInfo(us_id){
-	$("#updating").css("display", "block");
-	$.ajax({
-		url: 'update_user/' + us_id,
-		type: 'POST',
-		data: $("#frm1").serialize(),
-		success: function (data, textStatus, jqXHR)
-		{
-			$("#updating").css("display", "none");
-			result = jQuery.parseJSON(data);
-			if (result.success == "1")
-			{   
-				$("#updateInfoSuccess").modal('show');
-				//$("#close").click(function(){window.location.reload(true)});
-				$('#updateInfoSuccess').on('hidden.bs.modal', function () {
-					window.location.reload(true);
-				});
-			}
-			else
-			{
-				for (var key in result.errors)
-				{
-					$('#'+key).html(result.errors[key]);
-				}
-			}
-		}
-	});
+function updateInfo(us_id) {
+    $.ajax({
+        url: 'update_user/' + us_id,
+        type: 'POST',
+        data: $("#frm1").serialize(),
+        success: function (data, textStatus, jqXHR)
+        {
+            result = jQuery.parseJSON(data);
+            if (result.success == "1")
+            {
+                window.location.reload(true);
+            }
+            else
+            {
+                for (var key in result.errors)
+                {
+                    $('#' + key).html(result.errors[key]);
+                }
+            }
+        }
+    });
 }
-$( "#package_register" ).submit(function( event ) 
+$("#package_register").submit(function (event)
 {
-                $.ajax({
-                url: $(this).attr("action"),
-                type: "POST",
-                data: $("#package_register").serialize(),
-                success: function (data, textStatus, jqXHR)
+    $.ajax({
+        url: $(this).attr("action"),
+        type: "POST",
+        data: $("#package_register").serialize(),
+        success: function (data, textStatus, jqXHR)
+        {
+
+            var results = jQuery.parseJSON(data);
+            $('#package_register_modal').replaceWith(results.modal);
+            $('#package_register_modal').modal('show');
+            $("#package_register_back").click(function () {
+                $("#account-info-tab").click();
+            });
+            $("#finish_package_register").click(function () {
+                finish_package_register();
+            });
+
+        },
+        error: function (jqXHR, textStatus, errorThrown)
+        {
+            $(".ajaxloading").hide();
+        }
+    });
+    event.preventDefault();
+});
+function finish_package_register()
+{
+    $("#package_register_errors").html("");
+    $.ajax({
+        url: url + "frontend/user/finishRegisterPackage",
+        type: "POST",
+        data: $("#do_package_register").serialize(),
+        success: function (data, textStatus, jqXHR)
+        {
+            var results = jQuery.parseJSON(data);
+            if (results.success == "1")
+            {
+                $("#package_register_modal").modal("hide");
+                $("#success_package_register_content").html("QuÃœ vá» ÄÃ£ ÄÄng kÃ­ sá»­ dá»¥ng CÃŽng cá»¥ Soáº¡n BÃ i giáº£ng trá»©c tuyáº¿n. QuÃ­ vá» ÄÆ°á»£c sá»­ dá»¥ng dá»ch vá»¥ Äáº¿n háº¿t 24h ngÃ y "+results.expire_date);
+                $("#success_package_register_modal").modal("show");
+                
+                $("#package_register_finish_button").click(function () {
+                window.location.href = url+"frontend/user/profile/account-info";
+                location.reload(); 
+            });
+            }
+            else
+            {
+                var er = "<div class=\"alert alert-block alert-success\">";
+                for (var i = 0; i < results.errors.length; i++)
                 {
-                    
-                    var results= jQuery.parseJSON(data);
-                    $('#package_register_modal').replaceWith(results.modal);
-                    $('#package_register_modal').modal('show');
-                },
-                error: function (jqXHR, textStatus, errorThrown)
-                {
-                    $(".ajaxloading").hide();
+                    var item = results.errors[i];
+                    er=er+""+item+"<br />";
                 }
-            });
-event.preventDefault();
+                $("#package_register_errors").prepend(er+"</div>");
+            }
+        },
+        error: function (jqXHR, textStatus, errorThrown)
+        {
+            $(".ajaxloading").hide();
+        }
+    });
+}
+$("#add_money").click(function () {
+    $("#account-info-tab").click();
 });
+$("#"+current_tab+"-tab").click();
 
 function changePassword(us_id)
