Commit abebe7c4 authored by Antonio.Suerte's avatar Antonio.Suerte

Program Code Filter in Transaction Logs

parent 8178a592
......@@ -199,7 +199,7 @@ class MoneyRequest extends System {
$this -> result[PARAM_STATUS] = "REJECTED";
}
$this -> logPost();
$this -> logPost($this -> pnum);
}
private function getTransactionalParams(){
......@@ -275,6 +275,7 @@ class MoneyRequest extends System {
$this -> accessModifyCommon('INSERT_LOG_POST',
[
$this -> ip,
$this -> pnum,
$this -> referer,
'[REMITTANCE_CALLBACK_RESULT]'.json_encode($this -> result)
]);
......@@ -293,6 +294,7 @@ class MoneyRequest extends System {
$this -> accessModifyCommon('INSERT_LOG_POST', [
$this -> ip,
$this -> pnum,
$this -> referer,
"[INSERT_DB]{$encodedParams}"
]);
......@@ -352,6 +354,7 @@ class MoneyRequest extends System {
$this -> accessModifyCommon("INSERT_LOG_POST",
[
$this -> ip,
$this -> pnum,
$this -> referer,
'[INSERT_DB_ERR]'.json_encode($params)
]);
......
......@@ -25,16 +25,14 @@ class LogicSettlement extends SettlementModelClass {
function logic() {
try {
// POSTのログを取る
$this -> logPost();
// 初期データ処理
$this -> init();
// ロジック実行
$this -> biz();
// POSTのログを取る
$this -> logPost($this -> getProgramCode());
} catch (Exception $e) {
throw $e;
}
......@@ -210,13 +208,25 @@ class LogicSettlement extends SettlementModelClass {
&& $result == NO_COUNT) { // 正常終了
// logs the data that will be passed
$this -> accessModifyCommon('INSERT_LOG_POST', array($ip, $referer, "[TO_RETURN_URL_DATA]{$data}"));
$this -> accessModifyCommon('INSERT_LOG_POST', array(
$ip,
$this -> getProgramCode(),
$referer,
"[TO_RETURN_URL_DATA]{$data}"));
$this -> accessModifyCommon('INSERT_LOG_POST', array($ip, $referer, "[CALLBACK_SUCCESSFUL]{$jsonData}"));
$this -> accessModifyCommon('INSERT_LOG_POST', array(
$ip,
$this -> getProgramCode(),
$referer,
"[CALLBACK_SUCCESSFUL]{$jsonData}"));
header('Location: ' . $url);
} else { // 異常
$this -> accessModifyCommon('INSERT_LOG_POST', array($ip,$referer,"[CALLBACK_ERROR]{$jsonData}"));
$this -> accessModifyCommon('INSERT_LOG_POST', array(
$ip,
$this -> getProgramCode(),
$referer,
"[CALLBACK_ERROR]{$jsonData}"));
if($failUrl != NO_STRING) {
header('Location: ' . $failUrl);
}
......
......@@ -286,7 +286,7 @@ class SettlementModelClass extends ModelClassEx {
$_SESSION['settlement_currency'] = $this -> currency;
// POSTのログを取る
$this -> logPost();
$this -> logPost($this -> getProgramCode());
$this -> setType(CONTROL_NAME_LOGIN);
......@@ -600,7 +600,7 @@ class SettlementModelClass extends ModelClassEx {
}
function getAgentCodeURL(){
$baseUrl = 'https://'.SITE_DOMAIN_FULL.'/'. $this -> getLangage() .'/register';
$baseUrl = 'https://'.SITE_DOMAIN.'/'. $this -> getLangage() .'/register';
if(!empty($this -> pNum)){
$rowData = $this -> getRowData($this -> accessSelect('SELECT_AGENT_CODE_BY_AID', array($this -> pNum)));
$AgentCode = $this -> getColumnData($rowData, COLUMN_AGENT_CODE);
......@@ -923,6 +923,15 @@ class SettlementModelClass extends ModelClassEx {
function echoPNum() {
echo $this -> pNum;
}
/*-------------------------------------------------------------------------
* @function_name: 番組コードの取得
* @parameter : なし
* @return : 転送先URL
-------------------------------------------------------------------------*/
function getProgramCode() {
return $this -> pNum;
}
/*-------------------------------------------------------------------------
* @function_name: 送金元手数料の取得
......
......@@ -27,6 +27,10 @@ include_once('template/base_head.php');
<th>IP Address</th>
<td><input type="text" id="ip_address" name="ip_address" value="<?php $this -> echoIP(); ?>" class="w100p"></td>
</tr>
<tr>
<th>Program Code</th>
<td><input type="text" id="p_num" name="p_num" value="<?php $this -> echoProgramCode(); ?>" class="w100p"></td>
</tr>
<tr>
<th>URL</th>
<td><input type="text" id="url" name="url" value="<?php $this -> echoURL(); ?>" class="w100p"></td>
......@@ -68,6 +72,7 @@ include_once('template/base_head.php');
<?php }else{ ?>
<tr>
<th class="w10p">IP Address</th>
<th class="w10p">Program Code</th>
<th class="w5p">URL</th>
<th class="w60p">Post</th>
<th class="w10p">Date</th>
......
......@@ -4362,7 +4362,7 @@ class Common extends HtmlBuilder {
* @parameter : なし
* @return : なし
-------------------------------------------------------------------------*/
function logPost() {
function logPost($programCode = NO_STRING) {
// 変数宣言部
$params = array();
......@@ -4383,6 +4383,7 @@ class Common extends HtmlBuilder {
// 登録用パラメータ
$params[] = $ip;
$params[] = $programCode;
$params[] = $referer;
$params[] = $post;
......
......@@ -10117,6 +10117,7 @@ WHERE
<INSERT_LOG_POST>
INSERT INTO t_log_post (
ip_address
, p_num
, url
, post
, create_time
......@@ -11494,6 +11495,7 @@ WHERE
<LIST_LOG_POST>
SELECT
l_id
, p_num
, ip_address
, url
, post
......
......@@ -11,6 +11,7 @@ class TransactionLogsModelClass extends ModelClassEx {
private $post = NO_STRING;
private $url = NO_STRING;
private $ip = NO_STRING;
private $programCode = NO_STRING;
private $count = NO_COUNT;
......@@ -64,6 +65,7 @@ class TransactionLogsModelClass extends ModelClassEx {
$this -> ip = $this -> getDataPost(PARAM_IP_ADDRESS);
$this -> url = $this -> getDataPost('url');
$this -> post = $this -> getDataPost('post');
$this -> programCode = $this -> getDataPost(PARAM_P_NUM);
// ------------------ 検索系 ------------------//
$this -> lang = $this -> getLangage();
......@@ -96,7 +98,7 @@ class TransactionLogsModelClass extends ModelClassEx {
public function echoList() {
$solution = $this -> method;
$apiUrl = "https://secure.iwl.world/api/Logs/";
$apiUrl = SITE_PROTOCOL."://".SITE_DOMAIN_FULL."/api/Logs/";
//for deposit logs
$logFolder = dirname(SYSTEM_PATH).DIRECTORY_SEPARATOR.'api'.DIRECTORY_SEPARATOR.'Logs'.DIRECTORY_SEPARATOR;
......@@ -258,6 +260,7 @@ class TransactionLogsModelClass extends ModelClassEx {
foreach($this -> rs as $row) {
$rtn .= '<tr>'
. '<td> '. $this -> getColumnData($row, COLUMN_IP_ADDRESS) .'</td>'
. '<td> '. $this -> getColumnData($row, 'p_num') .'</td>'
. '<td>' . $this -> getColumnData($row, 'url') . '</td>'
. '<td style="word-break:break-all;">' . $this -> getColumnData($row, 'post') . '</td>'
. '<td>' . $this -> getColumnData($row, COLUMN_CREATE_TIME) . '</td>'
......@@ -265,7 +268,7 @@ class TransactionLogsModelClass extends ModelClassEx {
}
} else {
$rtn = '<tr><td colspan="6">' . $this -> getMessage(INFO, 'I_NO_SUCHE_SEARCH_DATA', array()) . '</td></tr>';
$rtn = '<tr><td colspan="5">' . $this -> getMessage(INFO, 'I_NO_SUCHE_SEARCH_DATA', array()) . '</td></tr>';
}
echo $rtn;
......@@ -288,7 +291,6 @@ class TransactionLogsModelClass extends ModelClassEx {
function getWhere() {
$where = NO_STRING;
$rtn = array();
$statuses = array();
if($this -> sFrom != '2014/01/01'
&& $this -> sFrom != NO_STRING) {
......@@ -319,6 +321,10 @@ class TransactionLogsModelClass extends ModelClassEx {
if($this -> post != NO_STRING) {
$where .= ' AND (post LIKE (\')%'. $this -> post .'%(\'))';
}
if($this -> programCode != NO_STRING){
$where .= ' AND (p_num = (\')'. $this -> programCode . '(\'))';
}
$rtn[] = $where;
......@@ -453,5 +459,9 @@ class TransactionLogsModelClass extends ModelClassEx {
function echoIP(){
echo $this -> ip;
}
function echoProgramCode(){
echo $this -> programCode;
}
}
?>
\ No newline at end of file
<?php
$page_title = "Transaction Logs";
$page_title = "取り引きロッグ";
include_once('template/base_head.php');
?>
<!-- サイドバー -->
......@@ -7,7 +7,7 @@ include_once('template/base_head.php');
<h1><a href=""><img src="../img/logo.png" alt="iWallet"></a></h1>
<div class="aside-heading">
<div class="btns">
<input type="button" id="btnSearch" value="Search" class="btn bg-default px50 hi22">
<input type="button" id="btnSearch" value="検索" class="btn bg-default px50 hi22">
</div>
</div>
<form id="searchForm" action="" method="post">
......@@ -24,9 +24,13 @@ include_once('template/base_head.php');
</tr>
<?php if($this -> getMethod() == 'From_DB'){ ?>
<tr>
<th>IP Address</th>
<th>IPアドレス</th>
<td><input type="text" id="ip_address" name="ip_address" value="<?php $this -> echoIP(); ?>" class="w100p"></td>
</tr>
<tr>
<th>番組コード</th>
<td><input type="text" id="p_num" name="p_num" value="<?php $this -> echoProgramCode(); ?>" class="w100p"></td>
</tr>
<tr>
<th>URL</th>
<td><input type="text" id="url" name="url" value="<?php $this -> echoURL(); ?>" class="w100p"></td>
......@@ -37,7 +41,7 @@ include_once('template/base_head.php');
</tr>
<tr>
<td colspan="2">
<span class="th">Specify Date</span>
<span class="th">日付け</span>
<input type="text" id="s_from" name="s_from" value="<?php $this -> echoTagFrom(); ?>" class="px110" placeholder=""> - <input type="text" id="s_to" name="s_to" value="<?php $this -> echoTagTo(); ?>" class="px110" placeholder="">
</td>
</tr>
......@@ -61,17 +65,18 @@ include_once('template/base_head.php');
<?php if($this -> getMethod() != 'From_DB'){ ?>
<tr>
<th class="w45p">Solutions</th>
<th class="w35p">Requests</th>
<th class="w35p">Response</th>
<th class="w35p">リクエスト</th>
<th class="w35p">返信</th>
</tr>
<?php $this -> echoList(); ?>
<?php }else{ ?>
<tr>
<th class="w10p">IP Address</th>
<th class="w10p">IPアドレス</th>
<th class="w10p">番組コード</th>
<th class="w5p">URL</th>
<th class="w60p">Post</th>
<th class="w10p">Date</th>
<th class="w60p">POST</th>
<th class="w10p">日付け</th>
</tr>
<?php $this -> echoListDB(); ?>
<?php } ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment