Ignore:
Timestamp:
Nov 24, 2014 4:27:40 PM (10 years ago)
Author:
dungnv
Message:
 
Location:
pro-violet-viettel/sourcecode/application/modules
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php

    r599 r620  
    192192               
    193193                if ($checkSentNumber) {
    194                         $sms = "So Dien thoai " . $sentNumber . " da dang ky tren he thong SBG Online. Tran trong.";
     194                        $sms = "So dien thoai " . $sentNumber . " da dang ky tai khoan tren he thong SBG Online. Tran trong.";
    195195                        $status = 0;
    196196                        return $status . '|' . $sms;
     
    234234                                        break;
    235235                                case 2:
    236                                         $sms = "So Dien thoai " . $sentNumber . " da dang ky tren he thong SBG Online. Tran trong";
     236                                        $sms = "So dien thoai " . $sentNumber . " da dang ky tai khoan tren he thong SBG Online. Tran trong";
    237237                                        $status = 0;
    238238                                        break;
     
    247247                        }
    248248                } else {
    249                         $sms = "Tai khoan ".$username." chua dang ky tai khoan tren he thong SBG Online. Tran trong.";
     249                        $sms = "So dien thoai ".$username." chua dang ky tai khoan tren he thong SBG Online. Tran trong.";
    250250                        $status = 0;
    251251                }
  • pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php

    r608 r620  
    476476                        </div>
    477477                        <div class="modal-body">
    478                                 <div id="no_success_charge_info" class="alert alert-block alert-success"><center>Mã thẻ hoặc Serial khÃŽng đúng hoặc đã được sá»­ dụng. Quí vị vui lòng kiểm tra lại!</center></div>
     478                                <div id="no_success_charge_info" class="alert alert-block alert-success"><center></center></div>
    479479                                <center><button id="package_register_finish_button" data-dismiss="modal" class="btn btn-primary" >Đóng</button></center>
    480480                        </div>
  • pro-violet-viettel/sourcecode/application/modules/services/controllers/recharge.php

    r611 r620  
    66        {
    77                parent::__construct();
     8                $this->load->model('frontend/user_model', 'objUserModel');
     9                $this->load->helper('lockfile');
     10                $this->load->model('services_model');
    811        }
    912       
     
    1417                $cardSerial = $input['card_serial'];
    1518                $pinCard = $input['pin_card'];
    16                 $aryParams = array(
    17                         'EWalletID' => $this->config->item('EWalletID'),
    18                         'CardSerial' => $cardSerial,
    19                         'PinCard' => $pinCard,
    20                 );
    21                
    22                 $this->load->model('services_model');
    23                 $aryResult = array();
    24                 $data = $this->services_model->cardPaidProcess($aryParams,  $aryResult);
    25                 $this->load->model('frontend/user_model', 'objUserModel');
    26                 $paidType = 2;
    27                 $amount = $aryResult['TransactionAmount'];
    28                 $paidTime = date('Y-m-d H:i:s');
     19                $isLocked = 0;
    2920               
    3021                $user = $this->objUserModel->get_user_by_id($userID);
    31                 $user['acc_balanced'] = $user['acc_balanced'] + $amount;
    32                 $user['updated_time'] = date('Y-m-d H:i:s');
    33                 if ($amount>0){
    34                         $this->objUserModel->updateUser($userID, $user);
     22                $lockFilePreFix = $user['cellphone'];
     23                $lockFilePath = $this->config->item('topup_lock_path');
     24                $maxReach = $this->config->item('topup_lock_max_reach');
     25                $timeToUnlock = $this->config->item('topup_unlock_minute');
     26
     27                $isLocked = createLockFile($lockFilePreFix, $maxReach, $timeToUnlock, $lockFilePath, 1);
     28                $chargCard = _SBG_CARD_PAY_SUCCESS;
     29                $result = array();
     30                $result['maxReach'] = $maxReach;
     31                $result['timeToUnlock'] = $timeToUnlock;
     32                $result['isLocked'] = $isLocked;
     33                $result['tmp'] = $maxReach;
     34               
     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                $errMsg = '';
     38               
     39                if ($isLocked == 0) {
     40                        $aryParams = array(
     41                                        'EWalletID' => $this->config->item('EWalletID'),
     42                                        'CardSerial' => $cardSerial,
     43                                        'PinCard' => $pinCard,
     44                        );
     45                       
     46                        $aryResult = array();
     47                        $chargCard = $this->services_model->cardPaidProcess($aryParams,  $aryResult);
     48                       
     49                        $paidType = 2;
     50                        $amount = $aryResult['TransactionAmount'];
     51                        $paidTime = date('Y-m-d H:i:s');
     52                        $user['acc_balanced'] = $user['acc_balanced'] + $amount;
     53                        $user['updated_time'] = date('Y-m-d H:i:s');
     54                        if ($amount>0){
     55                                $this->objUserModel->updateUser($userID, $user);
     56                        }
     57                       
     58                        $result['success'] = $chargCard;
     59                       
     60                        if ($chargCard == _SBG_CARD_PAY_SUCCESS){
     61                                $result['username'] = $user['cellphone'];
     62                                $result['acc_balanced'] = $user['acc_balanced'];
     63                                $result['amount'] = $amount;
     64                                $this->objUserModel->insertPaidlog($user['cellphone'], $user['cellphone'], $paidType, $amount, $paidTime);
     65                                releaseLockFile($lockFilePreFix, $lockFilePath);
     66                        }
     67                        else {
     68                                $isLocked = createLockFile($lockFilePreFix, $maxReach, $timeToUnlock, $lockFilePath);
     69                                $errMsg = $isLocked == 1 ? $chargErrMsg .'<br />'.$lockedMsg : $chargErrMsg;
     70                        }
     71                }else if ($isLocked == 1) {
     72                        $errMsg = $lockedMsg;
     73                        $result['success'] = _SBG_CARD_PAY_FAIL;
    3574                }
    3675               
    37                 $result = array();
    38                 if ($data == 1){
    39                         $result['success'] = 1;
    40                         $result['username'] = $user['cellphone'];
    41                         $result['acc_balanced'] = $user['acc_balanced'];
    42                         $result['amount'] = $amount;
    43                         $this->objUserModel->insertPaidlog($user['cellphone'], $user['cellphone'], $paidType, $amount, $paidTime);
    44                 }else
    45                 {
    46                         $result['success'] = 0;
    47                 }
     76                $result['errMsg'] = $errMsg;
    4877                echo json_encode($result);
    4978        }
  • pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php

    r616 r620  
    1212
    1313if ( ! defined('_SBG_MO_SYNTAX_ERR')) define('_SBG_MO_SYNTAX_ERR', -1);
    14 if ( ! defined('_SBG_MO_SYNTAX_ERR_MSG')) define('_SBG_MO_SYNTAX_ERR_MSG', 'SBG Online khong co dich vu này, ban vui long kiem tra lai. Tran trong.');
     14if ( ! defined('_SBG_MO_SYNTAX_ERR_MSG')) define('_SBG_MO_SYNTAX_ERR_MSG', 'SBG Online khong co dich vu nay, ban vui long kiem tra lai. Tran trong.');
    1515
    1616if ( ! defined('_SBG_CARD_PAY_FAIL')) define('_SBG_CARD_PAY_FAIL', -1);
Note: See TracChangeset for help on using the changeset viewer.