Ignore:
Timestamp:
Jan 15, 2015 12:08:25 PM (10 years ago)
Author:
dungnv
Message:
 
Location:
pro-violet-viettel/sourcecode/application/modules/services/controllers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/application/modules/services/controllers/recharge.php

    r636 r695  
    4141                $chargErrMsg = lang('_SBG_CHARGING_FROM_CARD_FAIL_MSG');
    4242                $errMsg = '';
    43                
     43                $cardValue = 0;
    4444                if ($isLocked == 0) {
    4545                        $aryParams = array(
     
    5050                       
    5151                        $aryResult = array();
     52                        //$aryResult['TransactionAmount'] = 10000;
    5253                        $chargCard = $this->services_model->cardPaidProcess($aryParams,  $aryResult);
    53                        
     54                        //$chargCard = _SBG_CARD_PAY_SUCCESS;
     55                        $status = $chargCard;
    5456                        $paidType = 2;
    5557                        $amount = $aryResult['TransactionAmount'];
     58                        $cardValue = $amount;
    5659                        $paidTime = date('Y-m-d H:i:s');
    5760                        $user['acc_balanced'] = $user['acc_balanced'] + $amount;
    5861                        $user['updated_time'] = date('Y-m-d H:i:s');
    59                         if ($amount>0){
    60                                 $this->objUserModel->updateUser($userID, $user);
     62                        if ($amount > 0){
     63                                $updateData = array('acc_balanced' => $user['acc_balanced'], 'updated_time' => $user['updated_time'] );
     64                                $updated = $this->objUserModel->updateUser($userID, $updateData);
    6165                        }
    6266                       
     
    7478                        else {
    7579                                $isLocked = createLockFile($lockFilePreFix, $maxReach, $timeToUnlock, $lockFilePath, FALSE);
    76                                 $errMsg = $isLocked == 1 ? $chargErrMsg .'<br />'.$lockedMsg : $chargErrMsg;
     80                                $errMsg = $isLocked == 1 ? $chargErrMsg .'<br />'.$lockedMsg : $chargErrMsg;
     81                                $status = 0;
    7782                        }
    7883                }else if ($isLocked == 1) {
    7984                        $errMsg = $lockedMsg;
    8085                        $result['success'] = _SBG_CARD_PAY_FAIL;
     86                        $status = -1;
    8187                }
     88
     89                $this->objUserModel->insertCardlog($user['cellphone'],$userID, $status, $pinCard, $cardSerial, $cardValue, $user['updated_time']);
    8290               
     91                $result['us_id'] = $userID;
     92                $result['UPDATED_DATA'] = $user;
    8393                $result['errMsg'] = $errMsg;
    8494                echo json_encode($result);
  • pro-violet-viettel/sourcecode/application/modules/services/controllers/sendmessage.php

    r689 r695  
    215215        {
    216216                error_reporting(E_ALL);
     217
    217218                $this->load->model('Services_model');
    218219               
     
    221222                // get total page
    222223                $totalpage = 1;
     224
    223225                $default = $this->Services_model->getCollaborator(2,1,1);
     226               
     227                $data = mb_convert_encoding($default, 'UTF-8');
     228
    224229                if($default){
    225                         $xml = simplexml_load_string($default);
     230                        $xml = simplexml_load_string($data);
    226231                        $xml->registerXPathNamespace("S", "http://schemas.xmlsoap.org/soap/envelope/");
    227232                        $xml = $xml->xpath('//S:Body')[0];
     
    230235                }
    231236               
    232                 $result = $this->Services_model->getCollaborator(2,1,$totalpage);
     237                var_dump($totalpage);
     238
     239                /*$result = $this->Services_model->getCollaborator(2,1,$totalpage);
    233240                if ($result){
    234241                        $xml = simplexml_load_string($result);
     
    258265                        $logMsg = date('Y-m-d H:i:s') . " Result is null \n";
    259266                        write_file('./log/sync_collaborator.log', $logMsg, FOPEN_WRITE_CREATE);
    260                 }
     267                }*/
    261268        }
    262269}
     270
     271        function fix_latin1_mangled_with_utf8_maybe_hopefully_most_of_the_time($str)
     272        {
     273                return preg_replace_callback('#[\\xA1-\\xFF](?![\\x80-\\xBF]{2,})#', 'utf8_encode_callback', $str);
     274        }
     275
     276        function utf8_encode_callback($m)
     277        {
     278                return utf8_encode($m[0]);
     279        }
Note: See TracChangeset for help on using the changeset viewer.