public function update_user_for_old_db($input_data)
 {
     $sql = "UPDATE Iuser \r\n\t\t\tSET 姓名 = '{$input_data['name']}',\r\n\t\t\t\t電話 = '{$input_data['tel']}',\r\n\t\t\t\t行動電話 = '{$input_data['mobile']}',\r\n\t\t\t\t通訊地址 = '{$input_data['address']}',\r\n\t\t\t\t電子郵件地址 = '{$input_data['email']}',\r\n\t\t\t\t性別 = '{$input_data['sex']}',\r\n\t\t\t\t身份別 = '{$input_data['status']}',\r\n\t\t\t\t指導老師姓名 = '{$input_data['boss_name']}',\r\n\t\t\t\t校別 = '{$input_data['organization']}',\r\n\t\t\t\t服務單位 = '{$input_data['department']}' \r\n\t\t\tWHERE 身分證字號 = '{$input_data['ID']}'";
     $sql = @ICONV("UTF-8", "BIG5//IGNORE", $sql);
     $query = $this->order_class->query($sql);
     return $this->order_class->affected_rows();
 }
 public function utf8_to_big5($arr)
 {
     if (!is_array($arr)) {
         $arr = @ICONV("UTF-8", "BIG5//IGNORE", $arr);
         return $arr;
     }
     foreach ($arr as $key => $value) {
         if (is_array($arr[$key])) {
             $arr[@ICONV("UTF-8", "BIG5//IGNORE", $key)] = $this->utf8_to_big5($arr[$key]);
         } else {
             $arr[@ICONV("UTF-8", "BIG5//IGNORE", $key)] = @ICONV("UTF-8", "BIG5//IGNORE", $value);
         }
     }
     return $arr;
 }
예제 #3
0
 public function postNext(Request $request)
 {
     $config = config('inicis');
     $p_mid = $config['mid'];
     $p_status = $request->get('P_STATUS');
     $p_rmesg1 = $request->get('P_RMESG1');
     $p_tid = $request->get('P_TID');
     $p_req_url = $request->get('P_REQ_URL');
     $p_noti = $request->get('P_NOTI');
     if ($p_status == '00') {
         $httpUtil = new HttpClient();
         // api 통신 시작
         $authMap = ['P_TID' => $p_tid, 'P_MID' => $p_mid];
         if ($httpUtil->processHTTP($p_req_url, $authMap)) {
             $authResultString = $httpUtil->body;
             $resultArr = [];
             parse_str($authResultString, $resultArr);
             if (!empty($resultArr) && $resultArr['P_STATUS'] == '00') {
                 // 결제 성공
                 $data = unserialize(urldecode($p_noti));
                 // 가상계좌 거래
                 if ($resultArr['P_TYPE'] === 'VBANK') {
                     $bank_code = sprintf('%02d', $resultArr['P_VACT_BANK_CODE']);
                     return $this->vaIssued($data['order_code'], $data['identifier'], $this->bank_code[$bank_code], $resultArr['P_VACT_NUM'], $resultArr['P_VACT_NAME']);
                 } else {
                     return $this->paymentComplete($data['order_code'], $data['identifier'], $data['method'], $resultArr['P_TID'], $resultArr['P_AMT']);
                 }
             } else {
                 // 결제 실패
                 return $this->paymentFailed($request, ICONV('EUC-KR', 'UTF-8', $resultArr['P_RMESG1']));
             }
         } else {
             echo 'Http Connect Error\\n';
             echo $httpUtil->errormsg;
             throw new Exception('Http Connect Error');
         }
     } else {
         return $this->paymentFailed($request, $p_rmesg1);
     }
 }