Index: /pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php	(revision 519)
+++ /pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php	(revision 520)
@@ -453,5 +453,5 @@
 			</div>
 			<div class="modal-body">
-				<div id="success_package_register_content" class="alert alert-block alert-success"><center>QuÃ­ vá» ÄÃ£ náº¡p thÃ nh cÃŽng [SoTien] vÃ o tÃ i khoáº£n <?php echo $username; ?>, tÃ i khoáº£n áº£o cá»§a quÃ­ lÃ  [TaiKhoanAO]!</center></div>
+				<div id="success_charge_info" class="alert alert-block alert-success"><center>QuÃ­ vá» ÄÃ£ náº¡p thÃ nh cÃŽng [SoTien] vÃ o tÃ i khoáº£n <?php echo $username; ?>, tÃ i khoáº£n áº£o cá»§a quÃ­ vá» lÃ  [TaiKhoanAO]!</center></div>
 				<center><button id="package_register_finish_button" data-dismiss="modal" class="btn btn-primary" >ÄÃ³ng</button></center>
 			</div>
@@ -469,5 +469,5 @@
 			</div>
 			<div class="modal-body">
-				<div id="success_package_register_content" class="alert alert-block alert-success"><center>MÃ£ tháº» hoáº·c Serial khÃŽng dÃºng hoáº·c ÄÃ£ ÄÆ°á»£c sá»­ dá»¥ng. QuÃ­ vá» hÃ£y kiá»m tra láº¡i!</center></div>
+				<div id="no_success_charge_info" class="alert alert-block alert-success"><center>MÃ£ tháº» hoáº·c Serial khÃŽng dÃºng hoáº·c ÄÃ£ ÄÆ°á»£c sá»­ dá»¥ng. QuÃ­ vá» hÃ£y kiá»m tra láº¡i!</center></div>
 				<center><button id="package_register_finish_button" data-dismiss="modal" class="btn btn-primary" >ÄÃ³ng</button></center>
 			</div>
Index: /pro-violet-viettel/sourcecode/application/modules/services/controllers/recharge.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/services/controllers/recharge.php	(revision 520)
+++ /pro-violet-viettel/sourcecode/application/modules/services/controllers/recharge.php	(revision 520)
@@ -0,0 +1,50 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+class Recharge extends MX_Controller
+{
+	public function __construct() 
+	{
+		parent::__construct();
+	}
+	
+	public function recharge_card()
+	{
+		$userID = $this->uri->segment(4);
+		$input = $this->input->post();
+		$cardSerial = $input['card_serial'];
+		$pinCard = $input['pin_card'];
+		$aryParams = array(
+			'EWalletID' => 0,
+			'CardSerial' => $cardSerial,
+			'PinCard' => $pinCard,
+		);
+		
+		$this->load->model('services_model');
+		$aryResult = array();
+		$data = $this->services_model->cardPaidProcess($aryParams,  $aryResult);
+		
+		$this->load->model('frontend/user_model', 'objUserModel');
+		$paidType = 2;
+		$amount = $aryResult['TransactionAmount'];
+		$paidTime = date('Y-m-d H:i:s');
+		
+		$user = $this->objUserModel->get_user_by_id($userID);
+		$user['acc_balanced'] = $user['acc_balanced'] + $amount;
+		$user['updated_time'] = date('Y-m-d H:i:s');
+		if ($amount>0){
+			$this->objUserModel->updateUser($userID, $user);
+		}
+		$this->objUserModel->insertPaidlog($user['cellphone'], $user['cellphone'], $paidType, $amount, $paidTime);
+		$result = array();
+		if ($data == 1){
+			$result['success'] = 1;
+			$result['username'] = $user['cellphone'];
+			$result['acc_balanced'] = $user['acc_balanced'];
+			$result['amount'] = $amount;
+		}else
+		{
+			$result['success'] = 1;
+		}
+		echo json_encode($result);
+	}
+}
Index: /pro-violet-viettel/sourcecode/application/modules/services/controllers/sendmessage.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/services/controllers/sendmessage.php	(revision 519)
+++ /pro-violet-viettel/sourcecode/application/modules/services/controllers/sendmessage.php	(revision 520)
@@ -21,5 +21,11 @@
 		$this->load->model('Services_model');
 		//$this->Services_model->cardPaidProcess($aryParams);
-		echo $this->Services_model->processMORequest('01662860000', strtoupper('sbg DDT 0979947802 123456'));
+		//echo $this->Services_model->processMORequest('01662860000', strtoupper('sbg DDT 0979947802 123456'));
+		$aryParams = array(
+			'EWalletID' => 0,
+			'CardSerial' => '122346',
+			'PinCard' => '123456789',
+		);
+		echo $this->Services_model->cardPaidProcess($aryParams);
 	}
 	
@@ -118,5 +124,4 @@
 	public function topup () 
 	{
-		$usID = $this->uri->segment(4);
 		$url = $this->config->item('topup_service_url');
 		
@@ -129,18 +134,9 @@
 		$password = 'sbg56ab77cdsgb';
 		
-		$input = $this->input->post();
-		$cardSerial = $input['card_serial'];
-		$pinCard = $input['pin_card'];
-		
 		$aryParams = array(
 			'EWalletID' => 0,
-			'CardSerial' => $cardSerial,
-			'PinCard' => $pinCard,
-			'UserID' => $usID
-		);
-		
-		$this->load->model('services_model');
-		echo json_encode($this->services_model->cardPaidProcess($aryParams));
-
+			'CardSerial' => '1111',
+			'PinCard' => '222',
+		);
 		$xml = $this->load->view('topup', $aryParams, true);
 		$client = new nusoap_client($url);
Index: /pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php	(revision 519)
+++ /pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php	(revision 520)
@@ -174,18 +174,4 @@
 		
 		$aryTopupResult = $result['TopUpResult'];
-		$this->load->model('frontend/user_model', 'objUserModel');
-		
-		$userID = $aryCardInfo['UserID'];
-		$paidType = 2;
-		$amount = $aryTopupResult['TransactionAmount'];
-		$paidTime = date('Y-m-d H:i:s');
-		
-		$user = $this->objUserModel->get_user_by_id($userID);
-		$user['acc_balanced'] = $user['acc_balanced'] + $amount;
-		$user['updated_time'] = date('Y-m-d H:i:s');
-		if ($amount>0){
-			$this->objUserModel->updateUser($userID, $user);
-		}
-		$this->objUserModel->insertPaidlog($user['cellphone'], $user['cellphone'], $paidType, $amount, $paidTime);
 		
 		if ($aryTopupResult['Success'] == 'false') {
Index: /pro-violet-viettel/sourcecode/assets/js/frontend/user.js
===================================================================
--- /pro-violet-viettel/sourcecode/assets/js/frontend/user.js	(revision 519)
+++ /pro-violet-viettel/sourcecode/assets/js/frontend/user.js	(revision 520)
@@ -132,5 +132,5 @@
 {
 	$.ajax({
-		url: 'http://viettel.violet.vn/services/sendmessage/topup/'+id,
+		url: 'http://viettel.violet.vn/services/recharge/recharge_card/'+id,
 		type: 'POST',
 		data: $("#frm3").serialize(),
@@ -138,6 +138,7 @@
 		{	
 			result = jQuery.parseJSON(data);
-			if(result == "1")
+			if(result.success == "1")
 			{
+				$("#success_charge").find('#success_charge_info').text("QuÃ­ vá» ÄÃ£ náº¡p thÃ nh cÃŽng " + result.amount + " vÃ o tÃ i khoáº£n " + result.username + ", tÃ i khoáº£n áº£o cá»§a quÃ­ vá» lÃ  " + result.acc_balanced + " VND!");
 				$("#success_charge").modal('show');
 			}else
