Changeset 707
- Timestamp:
- Jan 27, 2015 10:53:31 AM (10 years ago)
- Location:
- pro-violet-viettel/sourcecode
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/api.violet.vn/www/apps/platform/modules/space/actions/actions.class.php
r692 r707 353 353 $this->CreateSpaceFile($tempFile, $fileName, $fileSize, $catId, $userId); 354 354 } 355 echo '{"status":"error"}';355 echo '{"status":"error"}'; 356 356 return sfView::NONE; 357 357 } -
pro-violet-viettel/sourcecode/application/language/message/messages_lang.php
r706 r707 77 77 $lang['_SBG_MO_PAY_TO_ACCOUNT_SUCCESS_MSG'] = 'Ban da nap thanh cong :amount:d vao tai khoan cua DV Soan bai giang Online. Chi tiet LH 01662860000 (cuoc goi di dong).'; 78 78 $lang['_SBG_MO_PAY_TO_ACCOUNT_FOR_MSG'] = 'Ban da duoc nap :amount:d vao tai khoan cua DV Soan bai giang Online tu so dien thoai :sentNumber:. Chi tiet LH 01662860000 (cuoc goi di dong).'; 79 $lang['_SBG_MO_PAY_TO_ACCOUNT_FOR_OTHER_SUCCESS_MSG'] = ' 79 $lang['_SBG_MO_PAY_TO_ACCOUNT_FOR_OTHER_SUCCESS_MSG'] = 'Ban da nap thanh cong :amount:d vao tai khoan :username: cua DV Soan bai giang Online. Chi tiet LH 01662860000 (cuoc goi di dong).'; 80 80 $lang['_SBG_MO_ACCOUNT_NOT_FOUND_MSG'] = 'So thue bao :username: chua dang ky DV Soan bai giang Online. De dang ky, soan SBG DK gui 8062 (500d/tin). Chi tiet soan SBG HD gui 8062 (500d/tin) hoac LH 01662860000 (cuoc goi di dong).'; 81 81 $lang['_SBG_MO_CHARGING_FAIL_NOT_ENOUGH_MSG'] = 'Tai khoan cua ban khong du de thuc hien nap :amount: vao tai khoan cua DV Soan bai giang Online. Chi tiet LH 01662860000 (cuoc goi di dong).:amount: '; -
pro-violet-viettel/sourcecode/application/modules/admin/controllers/home.php
r636 r707 47 47 48 48 public function logout() { 49 $this->session->sess_destroy(); 49 //$this->session->sess_destroy(); 50 $this->session->unset_userdata('adminInfo'); 50 51 redirect("/admin/home"); 51 52 } -
pro-violet-viettel/sourcecode/application/modules/frontend/controllers/home.php
r671 r707 63 63 parse_str ( $result['data'] ); 64 64 $is_viettel = $this->is_viettel ( $phone ); 65 65 66 if ($autologin == 1) { 66 67 $cookie_name = 'siteCookie'; … … 69 70 setcookie ( $cookie_name, 'username=' . $username . '&user=' . $result['data'] . '&us_id=' . $id, time () + $cookie_time ); 70 71 } 72 71 73 $userdata = array ( 72 74 'username' => $username, … … 82 84 83 85 public function signout() { 84 $this->session->sess_destroy ();86 //$this->session->sess_destroy (); 85 87 // unset($this->session->userdata); 88 $this->session->unset_userdata('userInfo'); 86 89 $cookie_name = "siteCookie"; 87 90 setcookie ( $cookie_name, 'username=' . "", time () - 3600 ); -
pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php
r706 r707 17 17 public function profile() { 18 18 $user_info = $this->session->userdata('userInfo'); 19 19 20 if ($user_info) { 20 21 $this->load->model('User_model'); -
pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php
r706 r707 103 103 $sms = preg_replace($aryPatterns, array($trialdays. ' ngay', $username, $password), lang('_SBG_MO_USER_REGISTER_SUCCESS_MSG')); 104 104 $status = 1; 105 $aryPatterns = array('/: collaborator:/');106 $collaboratorMsg = $status . '|'. preg_replace($aryPatterns, array($ collaborator), lang('_SBG_MO_COLLABOLATOR_REGISTER_SUCCESS_MSG'));105 $aryPatterns = array('/:username:/'); 106 $collaboratorMsg = $status . '|'. preg_replace($aryPatterns, array($username), lang('_SBG_MO_COLLABOLATOR_REGISTER_SUCCESS_MSG')); 107 107 break; 108 108 case 2 : … … 327 327 } 328 328 329 public function registerVip($username, $p_code ) {329 public function registerVip($username, $p_code, &$packageData = null) { 330 330 $user = array (); 331 331 $sms = ''; … … 333 333 $result = $this->get_user_by_cellphone ( $username ); 334 334 $package = $this->get_package ( ( int ) $p_code ); 335 335 336 if (!$package) 336 337 { … … 339 340 return $status . '|' . $sms; 340 341 } 342 343 $packageData = $package; 344 341 345 if ($result) { 342 343 346 if ($result ['acc_balanced'] >= $package ['p_price']) { 344 347 $us_id = $result ['us_id']; … … 497 500 $this->db->query ( 'UNLOCK TABLES' ); 498 501 $sql = 'INSERT INTO tblcardlog(sender, us_id, status, pin_code, serial_num, card_value, created_time) VALUES(?,?,?,?,?,?,?)'; 499 $query =$this->db->query ($sql, $cardlog);502 return $this->db->query ($sql, $cardlog); 500 503 } 501 504 -
pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php
r706 r707 119 119 </div> 120 120 <div class="col-sm-3"> 121 < h4><small><a href="#" data-toggle="modal" data-target="#changeProfile"><i>Äá»i sá» Äiá»n thoại</i></a></small></h4>121 <!--<h4><small><a href="#" data-toggle="modal" data-target="#changeProfile"><i>Äá»i sá» Äiá»n thoại</i></a></small></h4>--> 122 122 </div> 123 123 </div> … … 245 245 <h4 class="header blue bolder smaller">Nạp tiá»n bằng tà i khoản gá»c</h4> 246 246 <div class="alert alert-block alert-success"> 247 <p> 248 <span <?php if(($is_viettel==1)) echo 'style="display: none;"'?> >Sá» dụng thuê bao <strong><?php echo @$username; ?></strong> soạn tin nhắn: <strong>SBG NAP [SoTien] gá»i 8062</strong>.</span><br/>247 <p> 248 <span <?php if(($is_viettel==1)) /*echo 'style="display: none;"'*/{?> >Sá» dụng thuê bao <strong><?php echo @$username; ?></strong> soạn tin nhắn: <strong>SBG NAP [SoTien] gá»i 8062</strong>.<?php } ?> </span><br/> 249 249 Nếu QuÜ vá» sá» dụng thuê bao Viettel khác thì soạn tin nhắn: <strong>SBG NAP [SoTien] <?php echo $username; ?> gá»i tá»i 8062</strong>. 250 250 -
pro-violet-viettel/sourcecode/application/modules/services/controllers/recharge.php
r698 r707 15 15 public function recharge_card() 16 16 { 17 $trackingFile = '/srv/www/sbg/log/recharge_card.log'; 18 error_log ('--START CARD CHARGE--'."\n", 3, $trackingFile); 19 error_log ('TIME: '.date('Y-m-d H:i:s')."\n", 3, $trackingFile); 20 17 21 $userID = $this->uri->segment(4); 18 22 $input = $this->input->post(); … … 21 25 $isLocked = 0; 22 26 27 error_log ('$cardSerial: '.$cardSerial."\n", 3, $trackingFile); 28 error_log ('$cardSerial: '.$pinCard."\n", 3, $trackingFile); 29 error_log ('$userID: '.$userID."\n", 3, $trackingFile); 30 23 31 $user = $this->objUserModel->get_user_by_id($userID); 24 32 $lockFilePreFix = $user['cellphone']; … … 26 34 $maxReach = $this->config->item('topup_lock_max_reach'); 27 35 $timeToUnlock = $this->config->item('topup_unlock_minute'); 36 37 error_log ('Phone num: '.$user['cellphone']."\n", 3, $trackingFile); 38 error_log ('Locked: '.($isLocked ? 'LOCKED':'UNLOCKED')."\n", 3, $trackingFile); 28 39 29 40 $isLocked = createLockFile($lockFilePreFix, $maxReach, $timeToUnlock, $lockFilePath, TRUE); … … 56 67 $chargCard = $this->services_model->cardPaidProcess($aryParams, $aryResult); 57 68 $status = $chargCard; 69 70 error_log ('CALL TOPUP SERVICE: '.($status ? 'SUCCESS':'NOT SUCCESS')."\n", 3, $trackingFile); 71 error_log ('CALL TOPUP SERVICE DATA: '.var_export($aryResult, TRUE)."\n", 3, $trackingFile); 58 72 59 73 $paidType = 2; … … 66 80 $updateData = array('acc_balanced' => $user['acc_balanced'], 'updated_time' => $user['updated_time'] ); 67 81 $updated = $this->objUserModel->updateUser($userID, $updateData); 82 error_log ('UPDATE ACCOUNT SUCCESS: '.($updated ? 'SUCCESS':'NOT SUCCESS')."\n", 3, $trackingFile); 68 83 } 69 84 … … 76 91 $aryPatterns = array('/:amount:/', '/:username:/', '/:acc_balanced:/'); 77 92 $result['message'] = preg_replace($aryPatterns, array($amount, $user['cellphone'], $user['acc_balanced']), lang('_SBG_CHARGING_FROM_CARD_SUCCESS_MSG')); 78 $this->objUserModel->insertPaidlog($user['cellphone'], $user['cellphone'], $paidType, $amount, $paidTime); 93 $paidResult = $this->objUserModel->insertPaidlog($user['cellphone'], $user['cellphone'], $paidType, $amount, $paidTime); 94 error_log ('INSERT PAID LOG: '.var_export($paidResult, TRUE)."\n", 3, $trackingFile); 79 95 releaseLockFile($lockFilePreFix, $lockFilePath); 80 96 } … … 89 105 } 90 106 91 $this->objUserModel->insertCardlog($user['cellphone'],$userID, $status, $pinCard, $cardSerial, $cardValue, $updatedTime); 92 107 $cardLogResult = $this->objUserModel->insertCardlog($user['cellphone'],$userID, $status, $pinCard, $cardSerial, $cardValue, $updatedTime); 108 error_log ('INSERT CARD LOG: '.var_export($cardLogResult, TRUE)."\n", 3, $trackingFile); 109 93 110 $result['us_id'] = $userID; 94 111 $result['UPDATED_DATA'] = $user; 95 112 $result['errMsg'] = $errMsg; 96 113 echo json_encode($result); 114 error_log ('RETURN JSON: '.json_encode($result)."\n", 3, $trackingFile); 115 error_log ('--FINISH CARD CHARGE--'."\n", 3, $trackingFile); 97 116 } 98 117 } -
pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php
r689 r707 43 43 _SBG_MO_REGISTER => array('pattern' => '/^(SBG)([[:blank:]])(DK)$/'), 44 44 _SBG_MO_REGISTER_FOR => array('pattern' => '/^(SBG)([[:blank:]])(DK)([[:blank:]])([0-9]{10,11})$/'), 45 _SBG_MO_PHONENUM_CHANGE => array('pattern' => '/^(SBG)([[:blank:]])(DDT)([[:blank:]])([0-9]{10,11})([[:blank:]])([a-zA-Z0-9]{1,})$/'),45 //_SBG_MO_PHONENUM_CHANGE => array('pattern' => '/^(SBG)([[:blank:]])(DDT)([[:blank:]])([0-9]{10,11})([[:blank:]])([a-zA-Z0-9]{1,})$/'), 46 46 _SBG_MO_PASSWORD_RECOVERY => array('pattern' => '/^(SBG)([[:blank:]])(MK)$/'), 47 47 _SBG_MO_VIP_REGISTER => array('pattern' => '/^(SBG)([[:blank:]])(VIP)([[:blank:]])([a-zA-Z0-9]{1,})$/'), … … 87 87 } 88 88 89 return array('case' => $case, 'content' => $aryContent); ;89 return array('case' => $case, 'content' => $aryContent); 90 90 } 91 91 … … 127 127 128 128 $sms = $this->objUserModel->register($userName, $collaborator, $collaboratorMsg); 129 129 130 if ($case == _SBG_MO_REGISTER_FOR) { 130 131 $smsReturn = $collaboratorMsg; … … 136 137 $smsReturn = $sms; 137 138 } 139 138 140 break; 139 141 case _SBG_MO_PHONENUM_CHANGE: … … 158 160 break; 159 161 case _SBG_MO_VIP_REGISTER: 162 $packageData = array(); 160 163 $p_code = $aryContents[0]; 161 $smsReturn = $this->objUserModel->registerVip($sentNumber, $p_code); 162 $this->objUserModel->insertRegisterVipLog($sentNumber, $p_code, true); 163 break; 164 $smsReturn = $this->objUserModel->registerVip($sentNumber, $p_code, $packageData); 165 166 $arySmsReturn = explode('|', $smsReturn); 167 $result = $arySmsReturn[0]; 168 169 if (trim($arySmsReturn[1]) == trim(lang('_SBG_MO_USER_REGISTER_VIP_FAIL_NOT_ENOUGH_MSG'))) { 170 171 $amount = $packageData ['p_price']; 172 $result = $this->chargeRootAccountProcess($sentNumber, $amount, $sentNumber.' paid for SBG'); 173 174 if ($result == _SBG_CHARGING_SUCCESS) { 175 $this->objUserModel->rechargeAccount($sentNumber, $amount); 176 $smsReturn = $this->objUserModel->registerVip($sentNumber, $p_code, $packageData); 177 178 $paidTime = date('Y-m-d H:i:s'); 179 $this->objUserModel->insertPaidlog($sentNumber, $sentNumber, _SBG_PAIDTYPE_SMS, $amount, $paidTime); 180 $result = 1; 181 } 182 } 183 184 if ((int)$result == 1) $this->objUserModel->insertRegisterVipLog($sentNumber, $p_code, true); 185 break; 186 164 187 case _SBG_MO_PAY_TO_ACCOUNT: 165 188 case _SBG_MO_PAY_TO_ACCOUNT_FOR: 189 166 190 $userName = isset($aryContents[1]) ? $this->formatPhoneNumber($aryContents[1]) : $sentNumber; 167 191 … … 186 210 $smsMT = preg_replace($aryPatterns, array($amount, $sentNumber), lang('_SBG_MO_PAY_TO_ACCOUNT_FOR_MSG')); 187 211 $sendMT = $this->sendMT($this->formatPhoneNumber($userName, -1), $smsMT); 212 $smsReturn = $arySmsReturn[0].'|'.preg_replace(array('/:amount:/','/:username:/'), array($amount, $userName), lang('_SBG_MO_PAY_TO_ACCOUNT_FOR_OTHER_SUCCESS_MSG')); 188 213 } 189 190 214 //write to paid log 191 215 $paidTime = date('Y-m-d H:i:s'); … … 290 314 'Contents' => $contents 291 315 ); 292 316 293 317 $xml = $this->load->view('charging', $aryParams, true); 294 318 $client = new nusoap_client($url); -
pro-violet-viettel/sourcecode/application/views/layout/admin/sidebar.php
r703 r707 122 122 <a href="<?php echo $base_url; ?>admin/reportprovince"> 123 123 <i class="icon-double-angle-right"></i> 124 Thá»ng kê doanh thu124 Báo cáo thuê bao theo tá»nh 125 125 </a> 126 126 </li> … … 128 128 <a href="<?php echo $base_url; ?>admin/reportpackage"> 129 129 <i class="icon-double-angle-right"></i> 130 Thá»ng kê doanh thu gói130 Báo cáo doanh thu theo tá»nh 131 131 </a> 132 132 </li> -
pro-violet-viettel/sourcecode/assets/css/custom.css
r631 r707 308 308 width: 64px 309 309 } 310 311 #form-field-province {padding-left: 0;} -
pro-violet-viettel/sourcecode/index.php
r289 r707 19 19 * 20 20 */ 21 define('ENVIRONMENT', ' development');21 define('ENVIRONMENT', 'production'); 22 22 /* 23 23 *---------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.