Index: pro-violet-viettel/sourcecode/application/language/message/messages_lang.php
===================================================================
--- pro-violet-viettel/sourcecode/application/language/message/messages_lang.php	(revision 646)
+++ pro-violet-viettel/sourcecode/application/language/message/messages_lang.php	(revision 647)
@@ -48,20 +48,23 @@
 
 // mo
+$lang['_SBG_MO_SYNTAX_ERR_MSG'] = 'Khong tim thay dich vu nay. Vui long soan HD SBG gui 8062 (500d/tin) hoac LH 01662860000 de biet them chi tiet';
+$lang['_SBG_MO_REGISTER_DISCONTINUE_MSG'] = 'DV Soan bai giang Online tam thoi khong hoat dong. Vui long thu lai sau it phut hoac LH 01662860000 de biet them chi tiet';
+$lang['_SBG_MO_PHONENUM_CHANGE_DISCONTINUE_MSG'] = $lang['_SBG_MO_REGISTER_DISCONTINUE_MSG'];
+$lang['_SBG_MO_PASSWORD_CHANGE_DISCONTINUE_MSG'] = $lang['_SBG_MO_REGISTER_DISCONTINUE_MSG'];
 
-$lang['_SBG_MO_SYNTAX_ERR_MSG'] = 'SBG Online khong co dich vu nay, ban vui long kiem tra lai. Tran trong';
-$lang['_SBG_MO_REGISTER_DISCONTINUE_MSG'] = 'Tam thoi ban khong the dang ky duoc. Xin thu lai sau. Cam on!';
-$lang['_SBG_MO_PHONENUM_CHANGE_DISCONTINUE_MSG'] = 'Tam thoi ban khong the thay doi duoc so dien thoai. Xin thu lai sau. Cam on!';
-$lang['_SBG_MO_PASSWORD_CHANGE_DISCONTINUE_MSG'] = 'Tam thoi ban khong the lay lai hoac thay doi mat khau. Xin thu lai sau. Cam on!';
-
-$lang['_SBG_MO_COLLABORATOR_NOT_FOUND_MSG'] = 'Khong tim thay cong tac vien nao co so dien thoai :collaborator: tren SBG Online.';
-$lang['_SBG_MO_COLLABOLATOR_REGISTER_DUPLICATE_MSG'] = 'So dien thoai :username: da duoc dang ky tai khoan tren SBG Online.';
+$lang['_SBG_MO_COLLABORATOR_NOT_FOUND_MSG'] = 'He thong khong tim thay cong tac vien co so dien thoai :collaborator:. Vui long kiem tra lai hoac LH 01662860000 de biet them chi tiet';
+$lang['_SBG_MO_COLLABOLATOR_REGISTER_DUPLICATE_MSG'] = 'So dien thoai :username: da dang ky tai khoan DV Soan bai giang Online truoc do. Vui long kiem tra lai hoac LH 01662860000 de biet them chi tiet';
 $lang['_SBG_MO_COLLABOLATOR_REGISTER_SUCCESS_MSG'] = 'Ban da dang ky thanh cong dich vu SBG Online cho so dien thoai :username:';
 
-$lang['_SBG_MO_USER_REGISTER_SUCCESS_MSG'] = '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.';
-$lang['_SBG_MO_USER_REGISTER_DUPLICATE_MSG'] = 'So dien thoai cua ban da duoc dang ky tai khoan tren SBG Online, vui long kiem tra lai. Tran trong.';
-$lang['_SBG_MO_USER_PHONENUM_CHANGE_DUPLICATE_MSG'] = 'So dien thoai :sentNumber: da dang ky tai khoan tren he thong SBG Online. Tran trong.';
-$lang['_SBG_MO_USER_PHONENUM_CHANGE_INCORRECT_PASSWORD_MSG'] = 'Mat khau cua ban khong dung. Vui long kiem tra lai.';
-$lang['_SBG_MO_USER_NEW_PHONENUM_CHANGE_SUCCESS_MSG'] = 'Ban da doi thanh cong tai khoan :username: tren SBG Online sang so dien thoai :sentNumber:. Tran trong.';
-$lang['_SBG_MO_USER_OLD_PHONENUM_CHANGE_SUCCESS_MSG'] = 'Ban da doi thanh cong so dien thoai tren SBG Online sang so dien thoai :sentNumber:. Tran trong.';
+$lang['_SBG_MO_USER_REGISTER_SUCCESS_MSG'] = 'Chuc mung ban da dang ky thanh cong DV Soan bai giang Online. Ban duoc dung thu dich vu voi phi 0d hoac dang ky cac goi VIP voi phi tu 15000d/thang. Truy cap soanbaigiang.smas.vn voi tai khoan :username:, mat khau :password: de su dung DV. Vui long LH 01662860000 de biet them chi tiet';
+$lang['_SBG_MO_USER_REGISTER_DUPLICATE_MSG'] = 'So dien thoai cua ban da dang ky tai khoan DV Soan bai giang Online. Vui long long truy cap http://soanbaigiang.smas.vn de su dung DV hoac LH 01662860000 de biet them chi tiet';
+
+$lang['_SBG_MO_USER_PHONENUM_CHANGE_DUPLICATE_MSG'] = 'So dien thoai :sentNumber: da dang ky DV Soan bai giang Online. Vui long soan HD SBG gui 8062 (500d/tin) hoac LH 01662860000 de biet them chi tiet';
+$lang['_SBG_MO_USER_PHONENUM_CHANGE_INCORRECT_PASSWORD_MSG'] = 'Mat khau cua ban khong dung. Vui long kiem tra lai hoac LH 01662860000 de biet them chi tiet';
+
+$lang['_SBG_MO_USER_NEW_PHONENUM_CHANGE_SUCCESS_MSG'] = 'Ban da doi thanh cong tai khoan :username: tai DV Soan bai giang Online sang so dien thoai :sentNumber:. Vui long LH 01662860000 de biet them chi tiet';
+$lang['_SBG_MO_USER_OLD_PHONENUM_CHANGE_SUCCESS_MSG'] = 'Ban da doi thanh cong so dien thoai tai DV Soan bai giang Online sang so dien thoai :sentNumber:. Vui long LH 01662860000 de biet them chi tiet';
+
+//Pending updated
 $lang['_SBG_MO_USER_PHONENUM_NOT_REGISTER_MSG'] = 'So dien thoai :username: chua dang ky tai khoan tren he thong SBG Online. Tran trong.';
 $lang['_SBG_MO_USER_PASSWORD_RECOVERY_MSG'] = 'Mat khau moi cua ban tren SBG online la :pass:. Tran trong.';
@@ -81,2 +84,3 @@
 $lang['_SBG_MO_AMOUNT_WRONG_FORMAT_MSG'] = 'So tien nap khong hop le. Vui long kiem tra lai.';
 $lang['_SBG_MO_PHONENUM_WRONG_FORMAT_MSG'] = 'So dien thoai khach hang khong hop le. Vui long kiem tra lai';
+$lang['_SBG_MO_SUPPORT_MSG'] = 'Soan SBG DK de dang ky dich vu, SBG VIP TenGoiCuoc de dang ky goi cuoc su dung, SBG NAP SoTien de nap tien vao tk DV, SBG NAP SoTien SoDT de nap tien cho so dien thoai khac, SBG DDT SoDtCu MatKhau de doi so dien thoai dang ky, SBG MK de lay lai mat khau bi mat. Vui long LH 01662860000 de biet them chi tiet';
Index: pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php	(revision 646)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php	(revision 647)
@@ -114,8 +114,10 @@
             }
         }
+        
         if (isset($result['errors'])) {
             echo json_encode($result);
-            die();
-        }
+            exit();
+        }
+        
         $this->load->model('servicepackage_model');
         $us_id = $user_info['us_id'];
@@ -131,4 +133,7 @@
         $result['expire_date'] = $user['expire_date'];
         $result['success'] = 1;
+        $message = str_replace(':period:', date("d/m/Y", (strtotime($user['expire_date']))), lang('_SBG_REGISTER_VIP_SUCCESS_MSG'));
+        $result['message'] = $message;
+
 		$toDate = date("Y-m-d", (strtotime($result['expire_date'])));
 		$this->user_model->insertRegisterVipLog($user['cellphone'],$package['p_code'], false);
Index: pro-violet-viettel/sourcecode/application/modules/frontend/views/lecture_editor.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/frontend/views/lecture_editor.php	(revision 646)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/views/lecture_editor.php	(revision 647)
@@ -4,5 +4,7 @@
 $this->load->view('layout/frontend/sidebar');
 ?>
+
 				<div class="main-content">
+				<!-- <input type="button" value="Open" id="open-lecture"> -->
 					<div class="page-content no-padding">
 								<!-- PAGE CONTENT BEGINS -->
@@ -97,6 +99,6 @@
 	var url= "<?php echo base_url();?>";
 	var first_visit= "<?php echo $first_visit;?>";
-        var update_user_info="<?php echo $update_user_info;?>";
-        var us_id="<?php echo $us_id;?>";
+    var update_user_info="<?php echo $update_user_info;?>";
+    var us_id="<?php echo $us_id;?>";
 </script>		
 <?php
Index: pro-violet-viettel/sourcecode/application/modules/services/controllers/sendmessage.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/services/controllers/sendmessage.php	(revision 646)
+++ pro-violet-viettel/sourcecode/application/modules/services/controllers/sendmessage.php	(revision 647)
@@ -211,3 +211,8 @@
 		echo "<pre>" . htmlspecialchars($client->response, ENT_QUOTES) . "</pre>";		
 	}
+	
+	public function collaborator () 
+	{
+		
+	}
 }
Index: pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php	(revision 646)
+++ pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php	(revision 647)
@@ -1,59 +1,52 @@
 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
-if ( ! defined('_SBG_MO_REGISTER')) define('_SBG_MO_REGISTER', 0);
-if ( ! defined('_SBG_MO_REGISTER_FOR')) define('_SBG_MO_REGISTER_FOR', 1);
-if ( ! defined('_SBG_MO_PHONENUM_CHANGE')) define('_SBG_MO_PHONENUM_CHANGE', 2);
-if ( ! defined('_SBG_MO_PASSWORD_RECOVERY')) define('_SBG_MO_PASSWORD_RECOVERY', 3);
-if ( ! defined('_SBG_MO_PASSWORD_CHANGE')) define('_SBG_MO_PASSWORD_CHANGE', 4);
-if ( ! defined('_SBG_MO_VIP_REGISTER')) define('_SBG_MO_VIP_REGISTER', 5);
-if ( ! defined('_SBG_MO_PAY_TO_ACCOUNT')) define('_SBG_MO_PAY_TO_ACCOUNT', 6);
-if ( ! defined('_SBG_MO_PAY_TO_ACCOUNT_FOR')) define('_SBG_MO_PAY_TO_ACCOUNT_FOR', 7);
-if ( ! defined('_SBG_MO_UNSUBSCRIBE_SERVICE')) define('_SBG_MO_UNSUBSCRIBE_SERVICE', 8);
-
-if ( ! defined('_SBG_MO_SYNTAX_ERR')) define('_SBG_MO_SYNTAX_ERR', -1);
-
-if ( ! defined('_SBG_CARD_PAY_FAIL')) define('_SBG_CARD_PAY_FAIL', -1);
-if ( ! defined('_SBG_CARD_PAY_SUCCESS')) define('_SBG_CARD_PAY_SUCCESS', 1);
-
-if ( ! defined('_SBG_CHARGING_FAIL')) define('_SBG_CHARGING_FAIL', -1);
-if ( ! defined('_SBG_CHARGING_SUCCESS')) define('_SBG_CHARGING_SUCCESS', 1);
-
-if ( ! defined('_SBG_CHARGING_FAIL_NOT_ENOUGH')) define('_SBG_CHARGING_FAIL_NOT_ENOUGH', 401);
-if ( ! defined('_SBG_CHARGING_FAIL_NOT_VIETTEL')) define('_SBG_CHARGING_FAIL_NOT_VIETTEL', 402);
-if ( ! defined('_SBG_CHARGING_NUMBER_NOT_EXISTED')) define('_SBG_CHARGING_NUMBER_NOT_EXISTED', 403);
-
-if ( ! defined('_SBG_CHARGING_NUMBER_NOT_AVAILABLE')) define('_SBG_CHARGING_NUMBER_NOT_AVAILABLE', 404);
-if ( ! defined('_SBG_CHARGING_NUMBER_CHANGED_OWNER')) define('_SBG_CHARGING_NUMBER_CHANGED_OWNER', 405);
-
-if ( ! defined('_SBG_CHARGING_FAIL_MORETHAN_LIMIT')) define('_SBG_CHARGING_FAIL_MORETHAN_LIMIT', 406);
-if ( ! defined('_SBG_CHARGING_GENERAL_ERROR')) define('_SBG_CHARGING_GENERAL_ERROR', 440);
-if ( ! defined('_SBG_CHARGING_NUMBER_NOT_REGISTED')) define('_SBG_CHARGING_NUMBER_NOT_REGISTED', 501);
-
-if ( ! defined('_SBG_SEND_MT_FAIL')) define('_SBG_SEND_MT_FAIL', -1);
-if ( ! defined('_SBG_SEND_MT_SUCCESS')) define('_SBG_SEND_MT_SUCCESS', 1);
-
-if ( ! defined('_SBG_MT_SEND_NUMBER')) define('_SBG_MT_SEND_NUMBER', '841662860000');
-if ( ! defined('_SBG_MT_CP_CODE')) define('_SBG_MT_CP_CODE', '601');
-
-if ( ! defined('_SBG_SERVICE_COMMAND_CODE')) define('_SBG_SERVICE_COMMAND_CODE', 'SBG');
-if ( ! defined('_SBG_SERVICE_SERVICEID')) define('_SBG_SERVICE_SERVICEID', '8062');
-
-if ( ! defined('_SBG_MO_PROCCESS_ERR')) define('_SBG_MO_PROCCESS_ERR', 0);
+if ( ! defined('_SBG_MO_REGISTER')) 					define('_SBG_MO_REGISTER', 				'SUBSCR');
+if ( ! defined('_SBG_MO_REGISTER_FOR')) 				define('_SBG_MO_REGISTER_FOR', 			'SUBSCR_FOR');
+if ( ! defined('_SBG_MO_PHONENUM_CHANGE')) 				define('_SBG_MO_PHONENUM_CHANGE', 		'PHONE_CHANGE');
+if ( ! defined('_SBG_MO_PASSWORD_RECOVERY')) 			define('_SBG_MO_PASSWORD_RECOVERY', 	'PWD_RECOVER');
+if ( ! defined('_SBG_MO_VIP_REGISTER')) 				define('_SBG_MO_VIP_REGISTER', 			'REG_VIP');
+if ( ! defined('_SBG_MO_PAY_TO_ACCOUNT')) 				define('_SBG_MO_PAY_TO_ACCOUNT', 		'PAY');
+if ( ! defined('_SBG_MO_PAY_TO_ACCOUNT_FOR')) 			define('_SBG_MO_PAY_TO_ACCOUNT_FOR', 	'PAY_FOR');
+if ( ! defined('_SBG_MO_UNSUBSCRIBE_SERVICE')) 			define('_SBG_MO_UNSUBSCRIBE_SERVICE', 	'UNSUBSCR');
+if ( ! defined('_SBG_MO_SUPPOR_SERVICE')) 				define('_SBG_MO_SUPPOR_SERVICE', 		'SUPPORT');
+if ( ! defined('_SBG_MO_SYNTAX_ERR')) 					define('_SBG_MO_SYNTAX_ERR', 			'SYNTAX_ERR');
+
+if ( ! defined('_SBG_CARD_PAY_FAIL')) 					define('_SBG_CARD_PAY_FAIL', 			-1);
+if ( ! defined('_SBG_CARD_PAY_SUCCESS')) 				define('_SBG_CARD_PAY_SUCCESS', 		1);
+
+if ( ! defined('_SBG_CHARGING_FAIL')) 					define('_SBG_CHARGING_FAIL', -1);
+if ( ! defined('_SBG_CHARGING_SUCCESS')) 				define('_SBG_CHARGING_SUCCESS', 1);
+if ( ! defined('_SBG_CHARGING_FAIL_NOT_ENOUGH')) 		define('_SBG_CHARGING_FAIL_NOT_ENOUGH', 401);
+if ( ! defined('_SBG_CHARGING_FAIL_NOT_VIETTEL')) 		define('_SBG_CHARGING_FAIL_NOT_VIETTEL', 402);
+if ( ! defined('_SBG_CHARGING_NUMBER_NOT_EXISTED')) 	define('_SBG_CHARGING_NUMBER_NOT_EXISTED', 403);
+if ( ! defined('_SBG_CHARGING_NUMBER_NOT_AVAILABLE')) 	define('_SBG_CHARGING_NUMBER_NOT_AVAILABLE', 404);
+if ( ! defined('_SBG_CHARGING_NUMBER_CHANGED_OWNER')) 	define('_SBG_CHARGING_NUMBER_CHANGED_OWNER', 405);
+if ( ! defined('_SBG_CHARGING_FAIL_MORETHAN_LIMIT')) 	define('_SBG_CHARGING_FAIL_MORETHAN_LIMIT', 406);
+if ( ! defined('_SBG_CHARGING_GENERAL_ERROR')) 			define('_SBG_CHARGING_GENERAL_ERROR', 440);
+if ( ! defined('_SBG_CHARGING_NUMBER_NOT_REGISTED')) 	define('_SBG_CHARGING_NUMBER_NOT_REGISTED', 501);
+
+if ( ! defined('_SBG_SEND_MT_FAIL')) 					define('_SBG_SEND_MT_FAIL', -1);
+if ( ! defined('_SBG_SEND_MT_SUCCESS')) 				define('_SBG_SEND_MT_SUCCESS', 1);
+if ( ! defined('_SBG_MT_SEND_NUMBER')) 					define('_SBG_MT_SEND_NUMBER', '841662860000');
+if ( ! defined('_SBG_MT_CP_CODE')) 						define('_SBG_MT_CP_CODE', '601');
+
+if ( ! defined('_SBG_SERVICE_COMMAND_CODE'))			define('_SBG_SERVICE_COMMAND_CODE', 'SBG');
+if ( ! defined('_SBG_SERVICE_SERVICEID')) 				define('_SBG_SERVICE_SERVICEID', '8062');
+
+if ( ! defined('_SBG_MO_PROCCESS_ERR')) 				define('_SBG_MO_PROCCESS_ERR', 0);
 
 Class Services_model extends CI_Model 
 {
 	private $_arySmsMO = array(
-		_SBG_MO_REGISTER 			=> array('pattern' => '/^(SBG[[:blank:]])(DK)$/'),
-		_SBG_MO_REGISTER_FOR 		=> array('pattern' => '/^(SBG[[:blank:]])(DK)([[:blank:]][0-9]{10,11})$/'),
-		_SBG_MO_PHONENUM_CHANGE 	=> array('pattern' => '/^(SBG[[:blank:]])(DDT)([[:blank:]][0-9]{10,11})([[:blank:]][a-zA-Z0-9]{1,})$/'),
-		_SBG_MO_PASSWORD_RECOVERY 	=> array('pattern' => '/^(SBG[[:blank:]])(MK)$/'),
-		/* _SBG_MO_PASSWORD_CHANGE 	=> array('pattern' => '/^(SBG[[:blank:]])(MK)([[:blank:]][a-zA-Z0-9~!@#$%^&*]{4,16})$/'), */
-		_SBG_MO_VIP_REGISTER 		=> array('pattern' => '/^(SBG[[:blank:]])(VIP)([[:blank:]][0-9]{1,2})$/'),
-		_SBG_MO_PAY_TO_ACCOUNT 		=> array('pattern' => '/^(SBG[[:blank:]])(NAP)([[:blank:]][0-9]{3,})$/'),
-		_SBG_MO_PAY_TO_ACCOUNT_FOR 	=> array('pattern' => '/^(SBG[[:blank:]])(NAP)([[:blank:]][0-9]{3,})([[:blank:]][0-9]{10,11})$/'),
-		_SBG_MO_UNSUBSCRIBE_SERVICE => array('pattern' => '/^(SBG[[:blank:]])(HUY)$/')
-	);
-	
-	private $_aryServiceName = array('DK','DDT','VIP','NAP');	
+		_SBG_MO_REGISTER 			=> array('pattern' => '/^(SBG)([[:blank:]])(DK)$/'),
+		_SBG_MO_REGISTER_FOR 		=> array('pattern' => '/^(SBG)([[:blank:]])(DK)([[:blank:]])([0-9]{10,11})$/'),
+		_SBG_MO_PHONENUM_CHANGE 	=> array('pattern' => '/^(SBG)([[:blank:]])(DDT)([[:blank:]])([0-9]{10,11})([[:blank:]])([a-zA-Z0-9]{1,})$/'),
+		_SBG_MO_PASSWORD_RECOVERY 	=> array('pattern' => '/^(SBG)([[:blank:]])(MK)$/'),
+		_SBG_MO_VIP_REGISTER 		=> array('pattern' => '/^(SBG)([[:blank:]])(VIP)([[:blank:]])([a-zA-Z0-9]{1,})$/'),
+		_SBG_MO_PAY_TO_ACCOUNT 		=> array('pattern' => '/^(SBG)([[:blank:]])(NAP)([[:blank:]])([0-9]{3,})$/'),
+		_SBG_MO_PAY_TO_ACCOUNT_FOR 	=> array('pattern' => '/^(SBG)([[:blank:]])(NAP)([[:blank:]])([0-9]{3,})([[:blank:]])([0-9]{10,11})$/'),
+		_SBG_MO_SUPPOR_SERVICE 		=> array('pattern' => '/^(SBG)([[:blank:]])(HD)$/'),
+		_SBG_MO_UNSUBSCRIBE_SERVICE => array('pattern' => '/^(SBG)([[:blank:]])(HUY)$/')
+	);	
 	
 	public function __construct(){
@@ -63,70 +56,47 @@
 	}
 	
+	/**
+	 * messageAnalys
+	 * 
+	 * @todo Analysis content of incoming message
+	 * 
+	 * @param String $message - coming SMS
+	 * @return multitype:Ambigous <string, multitype> multitype:multitype
+	 */
 	public function messageAnalys ($message)
 	{
 		$aryMatched = array();	
 		$aryContent = array();
-		$result = false;
-		
-		foreach ($this->_arySmsMO as $key => $pattern)
+		$result = FALSE;
+		
+		foreach ($this->_arySmsMO as $case => $pattern)
 		{
-			$result = preg_match_all ($pattern['pattern'], strtoupper(trim($message)), $aryMatched);
-			if ((bool)$result) break;
-		}
-		
-		$key = (bool)$result ? $key:_SBG_MO_SYNTAX_ERR;
-		
-		if (count ($aryMatched) > 0) {
-			foreach ($aryMatched as $k => $val) {
-				if ($k == 0) continue;
-				if (count($val) == 0) {
-					$key = _SBG_MO_SYNTAX_ERR;
-					break;
-				}
-				$aryContent[] = trim($val[0]);			
-			} 
-		}
-	
-		if ((bool)$result == FALSE) {
-			$aryContent = array();
-			foreach(explode(' ',strtoupper(trim($message))) as $k => $val) {
-				$aryContent[] = $val;
+			$result = preg_match($pattern['pattern'], strtoupper(trim($message)));
+			if ((bool)$result) {
+				$aryMatched = explode(' ', trim($message));
+				break;
 			}
-			
-			$serviceName = $aryContent[1];
-			if (in_array($serviceName, $this->_aryServiceName)) {
-				if ($serviceName == 'DK' && count($aryContent) == 3) {
-					$key = _SBG_MO_REGISTER_FOR;
-				}
-				else if ($serviceName == 'DDT' && count($aryContent) == 4){
-					$key = _SBG_MO_PHONENUM_CHANGE;
-				}
-				else if ($serviceName == 'VIP' && count($aryContent) == 3){
-					$key = _SBG_MO_VIP_REGISTER;
-				}else if ($serviceName == 'NAP' && count($aryContent) == 3){
-					$key = _SBG_MO_PAY_TO_ACCOUNT;
-				}else if ($serviceName == 'NAP' && count($aryContent) == 4){
-					$key = _SBG_MO_PAY_TO_ACCOUNT_FOR;
-				}
-				
-				foreach ($aryContent as $k => $val) {
-					$aryContent[$k] = trim($val);
-				}
-				
-				$result = TRUE;
-			}
-		}
-		
-		if ($key == _SBG_MO_PHONENUM_CHANGE) {
-			$upcasePass = $aryContent[3];
-			$password = substr($message, -strlen($upcasePass));
-			$aryContent[$index] = $password;
-		}
-		
-		$aryResult = (bool)$result ? array('case' => $key, 'content' => $aryContent):array('case' => $key);
+		}
+		
+		$case = (bool)$result ? $case:_SBG_MO_SYNTAX_ERR;
+		
+		foreach($aryMatched as $k => $val) {
+			if ($k > 1) $aryContent[] = $val;			
+		}
+		
+		$aryResult = array('case' => $case, 'content' => $aryContent);
 		return $aryResult;
 	}
 	
-	public function processMORequest ($sentNumber,$message) 
+	/**
+	 * processMORequest
+	 * 
+	 * @todo process action analysed from messageAnalys
+	 * 
+	 * @param unknown $sentNumber
+	 * @param unknown $message
+	 * @return string
+	 */
+	public function processMORequest ($sentNumber, $message) 
 	{
 		$debugMsg = $message."\n";
@@ -145,5 +115,5 @@
 			case _SBG_MO_REGISTER_FOR:
 				if ($case == _SBG_MO_REGISTER_FOR) {
-					if (!preg_match('/^([0-9]{10,11}$)$/', $aryContents[2])) {
+					if (!preg_match('/^([0-9]{10,11}$)$/', $aryContents[0])) {
 						$smsReturn = _SBG_MO_PROCCESS_ERR.'|'.lang('_SBG_MO_PHONENUM_WRONG_FORMAT_MSG');
 						break;
@@ -151,6 +121,6 @@
 				}
 				
-				$userName = isset($aryContents[2]) ? $this->formatPhoneNumber($aryContents[2]) : $sentNumber;  
-				$collaborator = isset($aryContents[2]) ? $sentNumber:null;
+				$userName = isset($aryContents[0]) ? $this->formatPhoneNumber($aryContents[0]) : $sentNumber;  
+				$collaborator = isset($aryContents[0]) ? $sentNumber:null;
 				$collaboratorMsg = '';
 				
@@ -167,11 +137,11 @@
 				break;
 			case _SBG_MO_PHONENUM_CHANGE:
-				if (!preg_match('/^(09\d{8}|01\d{9})$/', $aryContents[2])) {
+				if (!preg_match('/^(09\d{8}|01\d{9})$/', $aryContents[0])) {
 					$smsReturn = _SBG_MO_PROCCESS_ERR.'|'.lang('_SBG_MO_PHONENUM_WRONG_FORMAT_MSG');
 					break;
 				}
 				
-				$oldPhoneNumber = $this->formatPhoneNumber($aryContents[2]);
-				$password = $aryContents[3];
+				$oldPhoneNumber = $this->formatPhoneNumber($aryContents[0]);
+				$password = $aryContents[1];
 				$smsReturn = $this->objUserModel->changeProfile($sentNumber, $oldPhoneNumber, $password);
 				
@@ -179,5 +149,4 @@
 				$changeResult = (int)$arySMS[0];
 				
-				//$sms = 'Ban da doi thanh cong so dien thoai tren SBG Online sang so dien thoai ' .$sentNumber. '. Tran trong.';
 				$aryPatterns = array('/:sentNumber:/');
 				$sms = preg_replace($aryPatterns, array($sentNumber), lang('_SBG_MO_USER_OLD_PHONENUM_CHANGE_SUCCESS_MSG'));
@@ -185,10 +154,8 @@
 				break;
 			case _SBG_MO_PASSWORD_RECOVERY:
-			/* case _SBG_MO_PASSWORD_CHANGE: */
-				/* $password = isset($aryContents[2]) ? $aryContents[2] : null; */
-				$smsReturn = $this->objUserModel->changePassword($sentNumber/* , $password */);
-				break;						
+				$smsReturn = $this->objUserModel->changePassword($sentNumber);
+				break;
 			case _SBG_MO_VIP_REGISTER:
-				$p_code = $aryContents[2];
+				$p_code = $aryContents[0];
 				$smsReturn = $this->objUserModel->registerVip($sentNumber, $p_code);
 				$this->objUserModel->insertRegisterVipLog($sentNumber, $p_code, true);
@@ -196,5 +163,5 @@
 			case _SBG_MO_PAY_TO_ACCOUNT:
 			case _SBG_MO_PAY_TO_ACCOUNT_FOR:
-				$userName = isset($aryContents[3]) ? $this->formatPhoneNumber($aryContents[3]) : $sentNumber;
+				$userName = isset($aryContents[1]) ? $this->formatPhoneNumber($aryContents[1]) : $sentNumber;
 				
 				if ($case == _SBG_MO_PAY_TO_ACCOUNT_FOR && !preg_match('/^(09\d{8}|01\d{9})$/', $userName)) {
@@ -203,5 +170,5 @@
 				}
 				
-				$amount = $aryContents[2];
+				$amount = $aryContents[0];
 				if (!preg_match('/^[0-9]{3,}$/', $amount)) {
 					$smsReturn = _SBG_MO_PROCCESS_ERR.'|'.lang('_SBG_MO_AMOUNT_WRONG_FORMAT_MSG');
@@ -215,9 +182,9 @@
 					if ($case == _SBG_MO_PAY_TO_ACCOUNT_FOR) {
 						$arySmsReturn = explode ('|', $smsReturn);
-						//$smsMT = 'Ban da nap thanh cong ' .$amount . 'VND vao tai khoan ' .$username. ' tren SBG Online tu thue bao ' .$sentNumber. '. Tran trong.';
 						$aryPatterns = array('/:amount:/', '/:username:/', '/:sentNumber:/');
 						$smsMT = preg_replace($aryPatterns, array($amount, $username, $sentNumber), lang('_SBG_MO_PAY_TO_ACCOUNT_FOR_MSG'));
 						$sendMT = $this->sendMT($this->formatPhoneNumber($userName, -1), $smsMT);
 					}
+					
 					//write to paid log
 					$paidTime = date('Y-m-d H:i:s');
@@ -225,8 +192,5 @@
 				}
 				else if ($result == _SBG_CHARGING_FAIL_NOT_ENOUGH) {
-					//$aryPatterns = array ('/:sendid:/', '/:amount:/', '/:username:/');
-					//$smsReturn = preg_replace($aryPatterns, array($sentNumber, $amount, $userName), _SBG_CHARGING_FAIL_NOT_ENOUGH_MSG);
 					$aryPatterns = array ('/:amount:/', '/:username:/');
-					//$smsReturn = preg_replace($aryPatterns, array($amount, $userName), _SBG_CHARGING_FAIL_NOT_ENOUGH_MSG);
 					$smsReturn = preg_replace($aryPatterns, array($amount, $userName), lang('_SBG_MO_CHARGING_FAIL_NOT_ENOUGH_MSG'));
 					$smsReturn = _SBG_MO_PROCCESS_ERR.'|'.$smsReturn;
@@ -234,5 +198,4 @@
 				else if ($result == _SBG_CHARGING_FAIL_MORETHAN_LIMIT) {
 					$aryPatterns = array ('/:sendid:/');
-					//$smsReturn = preg_replace($aryPatterns, array($sentNumber), _SBG_CHARGING_FAIL_MORETHAN_LIMIT_MSG);
 					$smsReturn = preg_replace($aryPatterns, array($sentNumber), lang('_SBG_MO_CHARGING_FAIL_MORETHAN_LIMIT_MSG'));
 					$smsReturn = _SBG_MO_PROCCESS_ERR.'|'.$smsReturn;
@@ -244,4 +207,7 @@
 				}
 				break;
+			case _SBG_MO_SUPPOR_SERVICE:
+				$smsReturn = '1|'.lang('_SBG_MO_SUPPORT_MSG');
+				break;
 			case _SBG_MO_UNSUBSCRIBE_SERVICE:
 			case _SBG_MO_SYNTAX_ERR:
@@ -254,4 +220,13 @@
 	}
 	
+	
+	/**
+	 * cardPaidProcess
+	 * 
+	 * @todo Call Topup webservice to check and lock prepaid-card
+	 * @param Array $aryCardInfo
+	 * @param Array $aryTopupResult
+	 * @return string
+	 */
 	public function cardPaidProcess ($aryCardInfo, &$aryTopupResult = array()) 
 	{
@@ -287,4 +262,13 @@
 	}
 	
+	/**
+	 * chargeRootAccountProcess
+	 * 
+	 * @todo Call charging webservice to charged fee from phone root account
+	 * @param String $sentID
+	 * @param Integer $amount
+	 * @param String $contents
+	 * @return string|number
+	 */
 	public function chargeRootAccountProcess ($sentID, $amount = 0, $contents = '') 
 	{
@@ -313,13 +297,12 @@
 		}
 		
-		$aryErrs = array (_SBG_CHARGING_FAIL_NOT_ENOUGH, 
-				_SBG_CHARGING_FAIL_NOT_VIETTEL, 
-				_SBG_CHARGING_FAIL_MORETHAN_LIMIT,
-				_SBG_CHARGING_NUMBER_NOT_EXISTED,
-				_SBG_CHARGING_NUMBER_NOT_AVAILABLE,
-				_SBG_CHARGING_NUMBER_CHANGED_OWNER,
-				_SBG_CHARGING_GENERAL_ERROR,
-				_SBG_CHARGING_NUMBER_NOT_REGISTED
-		);
+		$aryErrs = array (	_SBG_CHARGING_FAIL_NOT_ENOUGH, 
+							_SBG_CHARGING_FAIL_NOT_VIETTEL, 
+							_SBG_CHARGING_FAIL_MORETHAN_LIMIT,
+							_SBG_CHARGING_NUMBER_NOT_EXISTED,
+							_SBG_CHARGING_NUMBER_NOT_AVAILABLE,
+							_SBG_CHARGING_NUMBER_CHANGED_OWNER,
+							_SBG_CHARGING_GENERAL_ERROR,
+							_SBG_CHARGING_NUMBER_NOT_REGISTED);
 		
 		if (in_array((int)$result['processChargingResult'], $aryErrs)) 
@@ -329,4 +312,12 @@
 	}
 	
+	/**
+	 * sendMT
+	 * 
+	 * @todo Calling MT webservice to send a SMS to a phone number
+	 * @param String $receiverID
+	 * @param String $message
+	 * @return string
+	 */
 	public function sendMT ($receiverID, $message)
 	{
@@ -369,4 +360,12 @@
 	}
 	
+	/**
+	 * formatPhoneNumber
+	 * 
+	 * @todo format phone number to prefix 0 or 84
+	 * @param String $phoneNumber
+	 * @param Integer $direction
+	 * @return String
+	 */
 	public function formatPhoneNumber ($phoneNumber, $direction = 1) {
 		$aryMatch = array();
