- Timestamp:
- Dec 3, 2014 2:59:16 PM (11 years ago)
- Location:
- pro-violet-viettel/sourcecode/application/modules/services
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/services/controllers/recharge.php
r627 r636 9 9 $this->load->helper('lockfile'); 10 10 $this->load->model('services_model'); 11 $this->load->helper('language'); 12 $this->lang->load('messages', 'message'); 11 13 } 12 14 … … 33 35 $result['tmp'] = $maxReach; 34 36 35 $lockedMsg = 'QuÜ vá» Äã nháºp sai thÃŽng tin thẻ cà o '. $maxReach .' lần liên tiếp.<br />Xin chá» '. $timeToUnlock .' phút sau Äá» thao tác lại!'; 36 $chargErrMsg = 'Mã thẻ hoặc Serial khÃŽng Äúng hoặc Äã ÄÆ°á»£c sá» dụng. QuÜ vá» vui lòng kiá»m tra lại!'; 37 //$lockedMsg = 'QuÜ vá» Äã nháºp sai thÃŽng tin thẻ cà o '. $maxReach .' lần liên tiếp.<br />Xin chá» '. $timeToUnlock .' phút sau Äá» thao tác lại!'; 38 $aryPatterns = array('/:maxReach:/', '/:timeToUnlock:/'); 39 $lockedMsg = preg_replace($aryPatterns, array($maxReach, $timeToUnlock), lang('_SBG_CHARGING_FROM_CARD_LOCKED_MSG')); 40 //$chargErrMsg = 'Mã thẻ hoặc Serial khÃŽng Äúng hoặc Äã ÄÆ°á»£c sá» dụng. QuÜ vá» vui lòng kiá»m tra lại!'; 41 $chargErrMsg = lang('_SBG_CHARGING_FROM_CARD_FAIL_MSG'); 37 42 $errMsg = ''; 38 43 … … 59 64 60 65 if ($chargCard == _SBG_CARD_PAY_SUCCESS){ 61 $result['username'] = $user['cellphone'];66 //$result['username'] = $user['cellphone']; 62 67 $result['acc_balanced'] = $user['acc_balanced']; 63 $result['amount'] = $amount; 68 //$result['amount'] = $amount; 69 $aryPatterns = array('/:amount:/', '/:username:/', '/:acc_balanced:/'); 70 $result['message'] = preg_replace($aryPatterns, array($amount, $user['cellphone'], $user['acc_balanced']), lang('_SBG_CHARGING_FROM_CARD_SUCCESS_MSG')); 64 71 $this->objUserModel->insertPaidlog($user['cellphone'], $user['cellphone'], $paidType, $amount, $paidTime); 65 72 releaseLockFile($lockFilePreFix, $lockFilePath); -
pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php
r633 r636 43 43 if ( ! defined('_SBG_SERVICE_COMMAND_CODE')) define('_SBG_SERVICE_COMMAND_CODE', 'SBG'); 44 44 if ( ! defined('_SBG_SERVICE_SERVICEID')) define('_SBG_SERVICE_SERVICEID', '8062'); 45 46 if ( ! defined('_SBG_MO_PROCCESS_ERR')) define('_SBG_MO_PROCCESS_ERR', 0); 45 47 46 48 Class Services_model extends CI_Model … … 62 64 public function __construct(){ 63 65 parent::__construct(); 66 $this->load->helper('language'); 67 $this->lang->load('messages', 'message'); 64 68 } 65 69 … … 147 151 if ($case == _SBG_MO_REGISTER_FOR) { 148 152 if (!preg_match('/^([0-9]{10,11}$)$/', $aryContents[2])) { 149 $smsReturn = '0|So dien thoai khach hang khong hop le. Vui long kiem tra lai.';153 $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.lang('_SBG_MO_PHONENUM_WRONG_FORMAT_MSG'); 150 154 break; 151 155 } … … 169 173 case _SBG_MO_PHONENUM_CHANGE: 170 174 if (!preg_match('/^(09\d{8}|01\d{9})$/', $aryContents[2])) { 171 $smsReturn = '0|So dien thoai khach hang khong hop le. Vui long kiem tra lai.';175 $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.lang('_SBG_MO_PHONENUM_WRONG_FORMAT_MSG'); 172 176 break; 173 177 } … … 180 184 $changeResult = (int)$arySMS[0]; 181 185 182 $sms = 'Ban da doi thanh cong so dien thoai tren SBG Online sang so dien thoai ' .$sentNumber. '. Tran trong.'; 186 //$sms = 'Ban da doi thanh cong so dien thoai tren SBG Online sang so dien thoai ' .$sentNumber. '. Tran trong.'; 187 $aryPatterns = array('/:sentNumber:/'); 188 $sms = preg_replace($aryPatterns, array($sentNumber), lang('_SBG_MO_USER_OLD_PHONENUM_CHANGE_SUCCESS_MSG')); 183 189 $sendMT = $changeResult == 1 ? $this->sendMT($this->formatPhoneNumber($oldPhoneNumber, -1), $sms) : ''; 184 190 break; … … 199 205 200 206 if ($case == _SBG_MO_PAY_TO_ACCOUNT_FOR && !preg_match('/^(09\d{8}|01\d{9})$/', $userName)) { 201 $smsReturn = '0|So dien thoai khach hang khong hop le. Vui long kiem tra lai.';207 $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.lang('_SBG_MO_PHONENUM_WRONG_FORMAT_MSG'); 202 208 break; 203 209 } … … 205 211 $amount = $aryContents[2]; 206 212 if (!preg_match('/^[0-9]{3,}$/', $amount)) { 207 $smsReturn = '0|So tien nap khong hop le. Vui long kiem tra lai.';213 $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.lang('_SBG_MO_AMOUNT_WRONG_FORMAT_MSG'); 208 214 break; 209 215 } … … 215 221 if ($case == _SBG_MO_PAY_TO_ACCOUNT_FOR) { 216 222 $arySmsReturn = explode ('|', $smsReturn); 217 $smsMT = 'Ban da nap thanh cong ' .$amount . 'VND vao tai khoan ' .$username. ' tren SBG Online tu thue bao ' .$sentNumber. '. Tran trong.'; 223 //$smsMT = 'Ban da nap thanh cong ' .$amount . 'VND vao tai khoan ' .$username. ' tren SBG Online tu thue bao ' .$sentNumber. '. Tran trong.'; 224 $aryPatterns = array('/:amount:/', '/:username:/', '/:sentNumber:/'); 225 $smsMT = preg_replace($aryPatterns, array($amount, $username, $sentNumber), lang('_SBG_MO_PAY_TO_ACCOUNT_FOR_MSG')); 218 226 $sendMT = $this->sendMT($this->formatPhoneNumber($userName, -1), $smsMT); 219 227 } … … 226 234 //$smsReturn = preg_replace($aryPatterns, array($sentNumber, $amount, $userName), _SBG_CHARGING_FAIL_NOT_ENOUGH_MSG); 227 235 $aryPatterns = array ('/:amount:/', '/:username:/'); 228 $smsReturn = preg_replace($aryPatterns, array($amount, $userName), _SBG_CHARGING_FAIL_NOT_ENOUGH_MSG); 229 $smsReturn = '0|'.$smsReturn; 236 //$smsReturn = preg_replace($aryPatterns, array($amount, $userName), _SBG_CHARGING_FAIL_NOT_ENOUGH_MSG); 237 $smsReturn = preg_replace($aryPatterns, array($amount, $userName), lang('_SBG_MO_CHARGING_FAIL_NOT_ENOUGH_MSG')); 238 $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.$smsReturn; 230 239 } 231 240 else if ($result == _SBG_CHARGING_FAIL_MORETHAN_LIMIT) { 232 241 $aryPatterns = array ('/:sendid:/'); 233 $smsReturn = preg_replace($aryPatterns, array($sentNumber), _SBG_CHARGING_FAIL_MORETHAN_LIMIT_MSG); 234 $smsReturn = '0|'.$smsReturn; 242 //$smsReturn = preg_replace($aryPatterns, array($sentNumber), _SBG_CHARGING_FAIL_MORETHAN_LIMIT_MSG); 243 $smsReturn = preg_replace($aryPatterns, array($sentNumber), lang('_SBG_MO_CHARGING_FAIL_MORETHAN_LIMIT_MSG')); 244 $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.$smsReturn; 235 245 }else if ($result == _SBG_CHARGING_FAIL_NOT_VIETTEL || $result == _SBG_CHARGING_NUMBER_NOT_EXISTED || $result == _SBG_CHARGING_NUMBER_NOT_AVAILABLE) { 236 $smsReturn = '0|'._SBG_CHARGING_FAIL_NOT_VIETTEL_MSG;246 $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.lang('_SBG_MO_CHARGING_FAIL_NOT_VIETTEL_MSG'); 237 247 } 238 248 else { 239 $smsReturn = '0|Loi, khong thanh toan duoc tu tai khoan goc';249 $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.lang('_SBG_MO_CHARGING_FAIL_MSG'); 240 250 } 241 251 break; … … 243 253 case _SBG_MO_SYNTAX_ERR: 244 254 default: 245 $smsReturn = '0|'._SBG_MO_SYNTAX_ERR_MSG;255 $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.lang('_SBG_MO_SYNTAX_ERR_MSG'); 246 256 break; 247 257 }
Note: See TracChangeset
for help on using the changeset viewer.