Index: pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php	(revision 773)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php	(revision 818)
@@ -453,4 +453,5 @@
 			$data['us_id'] = $us_id;
 			$data['username'] = $username;
+			$data['acc_balanced'] = number_format($user['acc_balanced']);
 			$data['perpage'] = 10;
 			$data['current_page'] = $this->uri->segment(6, 1);
Index: pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php	(revision 773)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php	(revision 818)
@@ -88,4 +88,5 @@
 				$us_id = $id;
 				$user ['created_time'] = date ( 'Y-m-d H:i:s' );
+				$user ['updated_time'] = date ( 'Y-m-d H:i:s' );
 				$user ['us_id'] = $us_id;
 				$user ['p_id'] = $trialpackage['p_id']; 
@@ -98,8 +99,14 @@
 				$this->db->query ( 'UNLOCK TABLES' );
 				$this->db->insert ( 'tbluser', $user );
+				//write_file('./log/test.log', date("H:i:s m-d-Y").": ". var_export($user, TRUE)."\n" , FOPEN_WRITE_CREATE);
 				$aryPatterns = array ('/:trialdays:/', '/:username:/', '/:password:/');
 				$trialdays = $this->config->item('trial_period');
 				$trialdays = strlen($trialdays) < 2 ? '0'. $trialdays : $trialdays;
-				$sms = preg_replace($aryPatterns, array($trialdays. ' ngay', $username, $password), lang('_SBG_MO_USER_REGISTER_SUCCESS_MSG'));
+				if ($this->isViettel($username)){
+					$sms = preg_replace($aryPatterns, array($trialdays. ' ngay', $username, $password), lang('_SBG_MO_USER_VIETTEL_REGISTER_SUCCESS_MSG'));
+				}else{
+					$aryPatterns = array ('/:username:/', '/:password:/');
+					$sms = preg_replace($aryPatterns, array($username, $password), lang('_SBG_MO_USER_NOT_VIETTEL_REGISTER_SUCCESS_MSG'));
+				}
 				$status = 1;
 				$aryPatterns = array('/:username:/');
@@ -565,12 +572,9 @@
 	{
 		$username = $data['username'];
-                $us_id = $data['us_id'];
-		$this->db->query ( 'UNLOCK TABLES' );
-                //$sql="SELECT tblregisterpackagelog.source,tblservicepackage.p_name,tblregisterpackagelog.created_time FROM tblregisterpackagelog INNER JOIN tblservicepackage ON tblservicepackage.p_code = tblregisterpackagelog.p_code where username = ? UNION SELECT tblpaidlog.source,tblpaidlog.amount,tblpaidlog.paid_time FROM tblpaidlog where us_id = ? ORDER BY created_time DESC LIMIT ".$data['start'].", ".$data['perpage']."";
-				$sql="SELECT tblregisterpackagelog.source,0 as amount,tblservicepackage.p_name,tblregisterpackagelog.created_time FROM tblregisterpackagelog INNER JOIN tblservicepackage ON tblservicepackage.p_code = tblregisterpackagelog.p_code where username = ? UNION SELECT tblpaidlog.source,tblpaidlog.amount,'Nạp tiền' as name,tblpaidlog.paid_time FROM tblpaidlog where us_id = ? ORDER BY created_time DESC LIMIT ".$data['start'].", ".$data['perpage']."";
-                $query = $this->db->query ( $sql, array (
-				"$username",
-                                $us_id
-		) );
+		$us_id = $data['us_id'];
+		$this->db->query ( 'UNLOCK TABLES' );
+		//$sql="SELECT tblregisterpackagelog.source,tblservicepackage.p_name,tblregisterpackagelog.created_time FROM tblregisterpackagelog INNER JOIN tblservicepackage ON tblservicepackage.p_code = tblregisterpackagelog.p_code where username = ? UNION SELECT tblpaidlog.source,tblpaidlog.amount,tblpaidlog.paid_time FROM tblpaidlog where us_id = ? ORDER BY created_time DESC LIMIT ".$data['start'].", ".$data['perpage']."";
+		$sql="SELECT tblregisterpackagelog.source,0 as amount,tblservicepackage.p_name,tblregisterpackagelog.created_time FROM tblregisterpackagelog INNER JOIN tblservicepackage ON tblservicepackage.p_code = tblregisterpackagelog.p_code where username = ? UNION SELECT tblpaidlog.source,tblpaidlog.amount,'Nạp tiền' as name,tblpaidlog.paid_time FROM tblpaidlog where us_id = ? ORDER BY created_time DESC LIMIT ".$data['start'].", ".$data['perpage']."";
+		$query = $this->db->query ( $sql, array ("$username", $us_id) );
 		$row = $query->result_array();
 		return $row;
@@ -597,3 +601,19 @@
 		}
 	}
+	
+	public function isViettel($number) {
+		$prefixViettel = array (
+					'96', '97', '98',
+					'096', '097', '098', '162', '163', '164', '165', '166', '167', '168', '169',
+					'8496', '8497', '8498', '0162', '0163', '0164', '0165', '0166', '0167', '0168', '0169',
+					'84162', '84163', '84164', '84165', '84166', '84167', '84168', '84169'
+		);
+		foreach ( $prefixViettel as $value ) {
+			if (strpos ( $number, $value ) === 0) {
+				return 1;
+			}
+		}
+		return 0;
+	}
+	
 }
