Index: pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php	(revision 633)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php	(revision 636)
@@ -14,4 +14,6 @@
 		$this->vservices->setApiUrl ( $this->config->item ( 'api_url' ) );
 		$this->vservices->setConnection ( $this->curl );
+		$this->load->helper('language');
+		$this->lang->load('messages', 'message');
 	}
 	
@@ -54,5 +56,6 @@
 		if (! is_null ( $collaborator ) || $collaborator != '') {
 			if (! $this->isExistcollaborator ( $collaborator )) {
-				$sms = "Khong tim thay cong tac vien nao co so dien thoai [" . $collaborator . "] tren SBG Online.";
+				$aryPatterns = array('/:collaborator:/');
+				$sms = preg_replace($aryPatterns, array($collaborator), lang('_SBG_MO_COLLABORATOR_NOT_FOUND_MSG'));
 				$collaboratorMsg = $status . '|'.$sms;
 				return $status . '|' . $sms;
@@ -71,5 +74,5 @@
 		if(!($data) || is_null($data))
 		{
-			$sms = "Tam thoi ban khong the dang ky duoc. Xin thu lai sau. Cam on!";
+			$sms = lang('_SBG_MO_REGISTER_DISCONTINUE_MSG');
 			$collaboratorMsg = $status . '|'.$sms;
 			return $status . '|' . $sms;
@@ -89,13 +92,16 @@
 				$this->db->query ( 'UNLOCK TABLES' );
 				$this->db->insert ( 'tbluser', $user );
-				$sms = "Chuc mung ban da dang ky thanh cong tai khoan SBG Online. Hay dang nhap vao soanbaigiang.smas.vn voi ten truy nhap " . $username . ", mat khau " . $password . " de su dung. Tran trong.";
+				$aryPatterns = array ('/:username:/', '/:password:/');
+				$sms = preg_replace($aryPatterns, array($collaborator), lang('_SBG_MO_USER_REGISTER_SUCCESS_MSG'));
 				$status = 1;
-				$collaboratorMsg = $status . '|'. 'Ban da dang ky thanh cong dich vu SBG Online cho so dien thoai '.$username;
+				$aryPatterns = array('/:username:/');
+				$collaboratorMsg = $status . '|'. preg_replace($aryPatterns, array($username), lang('_SBG_MO_COLLABOLATOR_REGISTER_SUCCESS_MSG'));
 				break;
 			case 2 :
 			case 4 :
-				$sms = "So dien thoai cua ban da duoc dang ky tai khoan tren SBG Online, vui long kiem tra lai. Tran trong.";
+				$sms = lang('_SBG_MO_USER_REGISTER_DUPLICATE_MSG');
 				$status = 0;
-				$collaboratorMsg = $status . '|'. 'So dien thoai '.$username.' da duoc dang ky tai khoan tren SBG Online.';
+				$aryPatterns = array('/:username:/');
+				$collaboratorMsg = $status . '|'. preg_replace($aryPatterns, array($username), lang('_SBG_MO_COLLABOLATOR_REGISTER_DUPLICATE_MSG'));
 				break;
 			default :
@@ -162,5 +168,6 @@
 		
 		if ($checkSentNumber) {
-			$sms = "So dien thoai " . $sentNumber . " da dang ky tai khoan tren he thong SBG Online. Tran trong.";
+			$aryPatterns = array('/:sentNumber:/');
+			$sms =  preg_replace($aryPatterns, array($sentNumber), lang('_SBG_MO_USER_PHONENUM_CHANGE_DUPLICATE_MSG'));
 			$status = 0;
 			return $status . '|' . $sms;
@@ -174,5 +181,5 @@
 			$token = md5 ( $us_id . self::TOKENPW );
 			$isCorrectPassword = $this->checkPassword($src, $us_id, $token, $password);
-			if(!$isCorrectPassword) return '0|Mat khau cua ban khong dung. Vui long kiem tra lai.';
+			if(!$isCorrectPassword) return '0|'.lang('_SBG_MO_USER_PHONENUM_CHANGE_INCORRECT_PASSWORD_MSG');
 
 			$data = $this->vservices->actionExecute ( 'update', array (
@@ -188,5 +195,5 @@
 			if(!($data) || is_null($data))
 			{
-				$sms = "Tam thoi ban khong the thay doi duoc so dien thoai. Xin thu lai sau. Cam on!";
+				$sms = lang('_SBG_MO_PHONENUM_CHANGE_DISCONTINUE_MSG');
 				$status = 0;
 				return $status . '|' . $sms;
@@ -200,13 +207,16 @@
 					$user ['cellphone'] = $sentNumber;
 					$this->updateUser ( $us_id, $user );
-					$sms = "Ban da doi thanh cong tai khoan " .$username. " tren SBG Online sang so dien thoai " . $sentNumber. ". Tran trong.";
+					$aryPatterns = array('/:username:/', '/:sentNumber:/');
+					$sms =  preg_replace($aryPatterns, array($username, $sentNumber), lang('_SBG_MO_USER_NEW_PHONENUM_CHANGE_SUCCESS_MSG'));
 					$status = 1;
 					break;
 				case 2:
-					$sms = "So dien thoai " . $sentNumber . " da dang ky tai khoan tren he thong SBG Online. Tran trong";
+					$aryPatterns = array('/:sentNumber:/');
+					$sms = preg_replace($aryPatterns, array($sentNumber), lang('_SBG_MO_USER_PHONENUM_CHANGE_DUPLICATE_MSG'));
 					$status = 0;
 					break;
 				case 5 :
-					$sms = "So dien thoai ".$username." chua dang ky tai khoan tren he thong SBG Online. Tran trong.";
+					$aryPatterns = array('/:username:/');
+					$sms = preg_replace($aryPatterns, array($username), lang('_SBG_MO_USER_PHONENUM_NOT_REGISTER_MSG'));
 					$status = 0;
 					break;
@@ -217,5 +227,6 @@
 			}
 		} else {
-			$sms = "So dien thoai ".$username." chua dang ky tai khoan tren he thong SBG Online. Tran trong.";
+			$aryPatterns = array('/:username:/');
+			$sms = preg_replace($aryPatterns, array($username), lang('_SBG_MO_USER_PHONENUM_NOT_REGISTER_MSG'));
 			$status = 0;
 		}
@@ -250,5 +261,5 @@
 			if(!($data) || is_null($data))
 			{
-				$sms = "Tam thoi ban khong the lay lai hoac thay doi mat khau. Xin thu lai sau. Cam on!";
+				$sms = lang('_SBG_MO_PASSWORD_CHANGE_DISCONTINUE_MSG');
 				$status = 0;
 				return $status . '|' . $sms;
@@ -261,12 +272,15 @@
 					$this->updateUser ( $us_id, $user );
 					if ($isForgotPassword) {
-						$sms = "Mat khau moi cua ban tren SBG online la " . $pass. ". Tran trong.";
+						$aryPatterns = array('/:pass:/');
+						$sms = preg_replace($aryPatterns, array($pass), lang('_SBG_MO_USER_PASSWORD_RECOVERY_MSG'));
 					} else {
-						$sms = "Ban da doi thanh cong mat khau tren SBG Online. Mat khau moi cua ban la " .$password. ". Tran trong.";
+						$aryPatterns = array('/:password:/');
+						$sms = preg_replace($aryPatterns, array($pass), lang('_SBG_MO_USER_PASSWORD_CHANGE_SUCCESS_MSG'));
 					}
 					$status = 1;
 					break;
 				case 5 :
-					$sms = "So dien thoai ".$username." chua dang ky tai khoan tren he thong SBG Online";
+					$aryPatterns = array('/:username:/');
+					$sms = preg_replace($aryPatterns, array($username), lang('_SBG_MO_USER_PHONENUM_NOT_REGISTER_MSG'));
 					$status = 0;
 					break;
@@ -277,5 +291,6 @@
 			}
 		} else {
-			$sms = "So dien thoai ".$username." chua dang ky tai khoan tren he thong SBG Online";
+			$aryPatterns = array('/:username:/');
+			$sms = preg_replace($aryPatterns, array($username), lang('_SBG_MO_USER_PHONENUM_NOT_REGISTER_MSG'));
 			$status = 0;
 		}
@@ -307,5 +322,5 @@
 		if (!$package)
 		{
-			$sms = "Khong co goi dich vu ban da dang ki tren SBG Online";
+			$sms = lang('_SBG_MO_USER_REGISTER_VIP_NOT_FOUND_MSG');
 			$status = 0;
 			return $status . '|' . $sms;
@@ -326,12 +341,14 @@
 				
 				$this->updateUser ( $us_id, $user );
-				$sms = "Chuc mung ban da dang ky thanh cong dich vu SBG Online. Thoi han su dung dich vu cua ban la ".date ( 'd/m/Y', strtotime ( $user ['expire_date'] ) ).". Tran trong." ;
+				$aryPatterns = array('/:period:/');
+				$sms = preg_replace($aryPatterns, array(date ( 'd/m/Y', strtotime ( $user ['expire_date'] ) )), lang('_SBG_MO_USER_REGISTER_VIP_SUCCESS_MSG'));
 				$status = 1;
 			} else {
-				$sms = "Tai khoan cua ban khong du de dang ky dich vu SBG Online. Vui long nap tien va dang ky lai. Tran trong.";
+				$sms = lang('_SBG_MO_USER_REGISTER_VIP_FAIL_NOT_ENOUGH_MSG');
 				$status = 0;
 			}
 		} else {
-			$sms = "So dien thoai " .$username. " chua dang ky tai khoan tren he thong SBG Online. De dang ky, soan tin SBG DK gui 8062 (500d).";
+			$aryPatterns = array('/:username:/');
+			$sms = preg_replace($aryPatterns, array($username), lang('_SBG_MO_ACCOUNT_NOT_FOUND_MSG'));
 			$status = 0;
 		}
@@ -348,8 +365,10 @@
 			$user ['updated_time'] = date ( 'Y-m-d H:i:s' );
 			$this->updateUser ( $us_id, $user );
-			$sms = "Ban da nap thanh cong " . $amount . "VND vao tai khoan " . $username . " tren SBG Online. Tran trong.";
+			$aryPatterns = array('/:amount:/', '/:username:/');
+			$sms = preg_replace($aryPatterns, array($amount, $username), lang('_SBG_MO_PAY_TO_ACCOUNT_SUCCESS_MSG'));
 			$status = 1;
 		} else {
-			$sms = "So dien thoai " .$username. " chua dang ky tai khoan tren he thong SBG Online. De dang ky, soan tin SBG DK gui 8062 (500d).";
+			$aryPatterns = array('/:username:/');
+			$sms = preg_replace($aryPatterns, array($username), lang('_SBG_MO_ACCOUNT_NOT_FOUND_MSG'));
 			$status = 0;
 		}
