Commit 73e18b10 authored by Anthony.Suerte's avatar Anthony.Suerte

All Currency Option @ User Transaction [FIRST COMMIT]

parent cc605885
<?php
header("Content-type: text/json");
include_once 'config.php';
class TransactionHistory extends System{
private $detailAccount;
private $transactionNumber;
private $emailAddress;
private $userAccount;
private $currency;
private $transactionType;
private $dateFrom;
private $dateTo;
private $page;
public function __construct(){
parent::__construct();
$this -> init();
}
public function init(){
$this -> setParameter();
$this -> validation();
}
private function setParameter(){
$this -> detailAccount = $this -> getDataPost("detailAccount");
$this -> transactionNumber = $this -> getDataPost("txnNum");
$this -> emailAddress = $this -> getDataPost("email");
$this -> userAccount = $this -> getDataPost("userAccount");
$this -> currency = $this -> getDataPost("cur");
$this -> transactionType = $this -> getDataPost("txnType");
$this -> dateFrom = $this -> getDataPost("from");
$this -> dateTo = $this -> getDataPost("to");
$this -> page = !empty($this -> getDataPost("page")) ? $this -> getDataPost("page") : 1;
}
private function validation(){
if($_SERVER['REQUEST_METHOD'] != 'POST'){
die(json_encode([
"error_code" => 1,
"message" => "Invalid Request Method [{$_SERVER['REQUEST_METHOD']}]"
]));
}
}
private function getWhere() {
$rtn = [];
$rtn[] = $this -> detailAccount;
$rtn[] = $this -> currency;
$whereStr = NO_STRING;
// 取引番号
if($this -> transactionNumber != NO_STRING) {
$whereStr .= ' AND transaction_number = (\')' . $this -> transactionNumber . '(\')';
}
// メールアドレス
if($this -> emailAddress != NO_STRING) {
$whereStr .= ' AND (withdraw_user.mail LIKE (\')%' . $this -> emailAddress . '%(\') OR deposit_user.mail LIKE (\')%' . $this -> emailAddress . '%(\'))';
}
// 口座番号
if($this -> userAccount != NO_STRING) {
$whereStr .= ' AND (deposit_account_number = (\')' . $this -> userAccount . '(\') OR withdraw_account_number = (\')' . $this -> userAccount . '(\'))';
}
// 開始日
if($this -> dateFrom != NO_STRING) {
$whereStr .= ' AND transaction_time >= (\')' . $this -> dateFrom . '(\')';
} else {
$whereStr .= ' AND transaction_time >= (\')' . date('Y/m/01', strtotime('-2 month')) . '(\')';
}
// 終了日
if($this -> dateTo != NO_STRING) {
$whereStr .= ' AND transaction_time < DATE_ADD((\')' . $this -> dateTo . '(\'), INTERVAL 1 DAY)';
} else {
$whereStr .= ' AND transaction_time < DATE_ADD((\')' . date('Y/m/d') . '(\'), INTERVAL 1 DAY)';
}
// anton
if($this -> transactionType != NO_STRING) {
switch($this -> transactionType){
case VAL_INT_1:
$whereStr .= ' AND transaction_type = (\')1(\')'; // 入金
break;
case VAL_INT_2:
$whereStr .= ' AND (transaction_type IN ((\')9(\'), (\')10(\'), (\')12(\')) OR (transaction_type = (\')2(\') AND type = (\')0(\')))'; // 出金
break;
case VAL_INT_3:
$whereStr .= ' AND transaction_type IN ((\')3(\'), (\')4(\'))'; // 通貨両替
break;
case VAL_INT_4:
$whereStr .= ' AND (transaction_type IN ((\')5(\'), (\')6(\')) OR (transaction_type = (\')2(\') AND type = (\')3(\')))'; // 口座振替
break;
case VAL_INT_5:
$whereStr .= ' AND transaction_type IN ((\')7(\'), (\')8(\'))'; // 引き落し
break;
case VAL_INT_6:
$whereStr .= ' AND (transaction_type = (\')11(\') OR trans.type = (\')1(\'))'; // 引き落し
break;
}
}
$rtn[] = $whereStr;
return $rtn;
}
public function result(){
$startTime = microtime(true);
$where = $this -> getWhere();
$defaultPageCount = VAR_DEFAULT_PAGE_COUNT;
$rowCount = $this -> getColumnData(
$this -> getRowData($this -> accessSelect('SELECT_USER_TRANSACTION_ADMIN_COUNT', $where), 0), "overall_total");
$start = ($this -> page - VAL_INT_1) * $defaultPageCount;
$where[] = " LIMIT {$start}, {$defaultPageCount}";
$totalPage = $this -> getTotalPageCommon($defaultPageCount, $rowCount);
$fetched = $this -> accessSelect('LIST_USER_TRANSACTION_ADMIN', $where);
if($this -> isLoopData($fetched)){
foreach($fetched as &$data){
if($this -> getColumnData($data, COLUMN_DEPOSIT_AMOUNT) != NO_STRING) {
$data[COLUMN_DEPOSIT_AMOUNT] = $this -> formatCurrency(
floatval($this -> getColumnData($data, COLUMN_DEPOSIT_AMOUNT)), $this -> currency);
}
if((strlen($this -> getColumnData($data, COLUMN_ACCOUNT_NUMBER) > 0))){
$data[COLUMN_ACCOUNT_NUMBER] = '<a href="account_edit?detail_account=' . $this -> getColumnData($data, COLUMN_ACCOUNT_NUMBER) . '">'
. $this -> getColumnData($data, COLUMN_ACCOUNT_NUMBER) .'</a>';
}
if($this -> getColumnData($data, COLUMN_WITHDRAW_AMOUNT) != NO_STRING) {
$data[COLUMN_WITHDRAW_AMOUNT] = $this -> formatCurrency(
floatval($this -> getColumnData($data, COLUMN_WITHDRAW_AMOUNT)), $this -> currency);
}
$data[COLUMN_FEE] = $this -> formatCurrency($this -> getColumnData($data, COLUMN_FEE), $this -> currency);
$data[COLUMN_MESSAGE] = ($this -> getColumnData($data, COLUMN_MESSAGE) != NULL) ?
$this -> getColumnData($data, COLUMN_MESSAGE) : $this -> getColumnData($data, COLUMN_METHOD);
$data[COLUMN_BALANCE] = $this -> formatCurrency($this -> getColumnData($data, COLUMN_BALANCE), $this -> currency);
}
}
$result = [
"row_count" => $rowCount,
"total_page" => $totalPage,
"current_page" => $this -> page,
"start_row" => $start + 1,
"elapsed_time" => (microtime(true) - $startTime),
"result" => $fetched,
];
echo json_encode($result);
}
}
$txn = new TransactionHistory();
$txn -> result();
......@@ -14,6 +14,56 @@ include_once('template/base_head.php');
<input type="button" id="btnSearch" value="Search" class="btn bg-default px50 hi22">
</div>
</div>
<table class="conditions fontS w100p">
<colgroup>
<col class="w50p">
<col class="w50p">
</colgroup>
<tr>
<td>Account Name:</td>
<td><strong><?php $this -> echoAccountInfo("account_name") ?></strong></td>
</tr>
<tr>
<td>Username:</td>
<td><strong><?php $this -> echoAccountInfo("user_name") ?></strong></td>
</tr>
<tr>
<td>Date of Birth:</td>
<td><strong><?php $this -> echoAccountInfo("birth_string") ?></strong></td>
</tr>
<tr>
<td>Account Type:</td>
<td><strong><?php $this -> echoAccountInfo("account_type") ?></strong></td>
</tr>
<tr>
<td>Account Status:</td>
<td><strong><?php $this -> echoAccountInfo("status") ?></strong></td>
</tr>
<tr>
<td>KYC Status:</td>
<td><strong><?php $this -> echoAccountInfo("kyc_validate_status") ?></strong></td>
</tr>
<tr>
<td>Risk Level:</td>
<td><strong><?php $this -> echoAccountInfo("risk_level") ?></strong></td>
</tr>
<tr>
<td>Tier Level:</td>
<td><strong><?php $this -> echoAccountInfo("tier_level") ?></strong></td>
</tr>
<tr>
<td>Remarks</td>
<td><i><?php $this -> echoAccountInfo("note") ?></i></td>
</tr>
<tr>
<td>Risk Remarks</td>
<td><i><?php $this -> echoAccountInfo("risk") ?></i></td>
</tr>
</table>
<hr/>
<table class="conditions fontS w100p">
<colgroup>
<col class="w50p">
......@@ -35,6 +85,7 @@ include_once('template/base_head.php');
<th>Currency Type</th>
<td>
<select id="s_currency" name="s_currency" class="w100p">
<option value="">--- All ---</option>
<?php $this -> echoCurrencyList(); ?>
</select>
</td>
......@@ -63,6 +114,10 @@ include_once('template/base_head.php');
<input type="button" id="btnBack" value="Back" class="btn bg-grad hi25 px100">
</p>
<input type="hidden" value="" id="s_type" name="type" />
<span style="display:none;" id="file_exporter_prog">
Exporting File...
</span>
</form>
</aside>
......@@ -72,12 +127,11 @@ include_once('template/base_head.php');
<article>
<div class="article-heading">
<h2><?php echo $page_title; ?> [<?php $this -> echoDetailAccount(); ?>]</h2>
<?php $this -> dispPager(); ?>
</div>
<?php $this -> echoList() ?>
<div class="article-bottom">
<?php $this -> dispPager(); ?>
</div>
<?php echo $this -> echoTransactionTables() ?>
<?php echo $this -> echoJavascriptLabels() ?>
</article>
</div>
</div>
......
This diff is collapsed.
......@@ -386,6 +386,11 @@ define('VAL_STR_2FA_PROF_CHANGE', 'プロフィール変更');
define('VAL_STR_2FA_MONEY_OUT', '出金');
define('VAL_STR_2FA_TEXT', '2段階メール確認(法人口座)');
define('VAL_STR_DEFAULT_ACCESS', 'デフォルトアクセス');
define('VAL_STR_ELAPSED_TIME', '経過時間');
define('VAL_STR_SECONDS', '秒');
define('VAL_STR_ACCOUNT_DETAILS', '口座詳細');
define('VAL_STR_ACCOUNT_TRANSACTIONS', '口座取引');
define('VAL_STR_LOADING_TRANSACTIONS', '取引が読み込み中。。。');
define('VAL_STR_SEARCH_MESSAGE', '検索結果はございません。');
define('VAL_STR_IMPORT_MESSAGE', 'インポートデータがありません。');
define('VAL_STR_ADMIN_EDIT', '編集');
......
......@@ -385,6 +385,11 @@ define('VAL_STR_2FA_PROF_CHANGE', 'Profile Changing');
define('VAL_STR_2FA_MONEY_OUT', 'Money-Out');
define('VAL_STR_2FA_TEXT', '2 Step E-Mail Verification (Corporate Account)');
define('VAL_STR_DEFAULT_ACCESS', 'Default Access');
define('VAL_STR_ELAPSED_TIME', 'Elapsed Time');
define('VAL_STR_SECONDS', 'sec(s).');
define('VAL_STR_LOADING_TRANSACTIONS', 'Loading Transactions...');
define('VAL_STR_ACCOUNT_DETAILS', 'Account Details');
define('VAL_STR_ACCOUNT_TRANSACTIONS', 'Account Transactions');
define('VAL_STR_SEARCH_MESSAGE', '0 Results Found.');
define('VAL_STR_IMPORT_MESSAGE', 'No Import Data.');
define('VAL_STR_ADMIN_EDIT', 'Edit');
......
......@@ -4996,19 +4996,19 @@ WHERE
AND user_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__'
AND TYPE = '11'
) AS trans_in
) AS trans
LEFT OUTER JOIN v_users_all AS withdraw_user
ON (trans_in.withdraw_account_number = withdraw_user.user_account)
ON (trans.withdraw_account_number = withdraw_user.user_account)
LEFT OUTER JOIN v_users_all AS deposit_user
ON (trans_in.deposit_account_number = deposit_user.user_account)
ON (trans.deposit_account_number = deposit_user.user_account)
WHERE 1
__ELEMENT03__
</SELECT_USER_TRANSACTION_ADMIN_COUNT>
<LIST_USER_TRANSACTION_ADMIN_COUNT_REVISED>
SELECT
count(trans_in.currency) total,
trans_in.currency as currency
count(trans.currency) total,
trans.currency as currency
FROM
(
SELECT
......@@ -5185,12 +5185,12 @@ WHERE
v_withdrawal_unified_for_balance
WHERE
user_account = '__ELEMENT01__'
) AS trans_in
) AS trans
LEFT OUTER JOIN v_users_all AS withdraw_user ON (trans_in.withdraw_account_number = withdraw_user.user_account)
LEFT OUTER JOIN v_users_all AS deposit_user ON (trans_in.deposit_account_number = deposit_user.user_account)
LEFT OUTER JOIN v_users_all AS withdraw_user ON (trans.withdraw_account_number = withdraw_user.user_account)
LEFT OUTER JOIN v_users_all AS deposit_user ON (trans.deposit_account_number = deposit_user.user_account)
WHERE 1
__ELEMENT02__
__ELEMENT03__
GROUP BY currency
ORDER BY currency DESC
......
......@@ -453,7 +453,10 @@ class AccountListModelClass extends ModelClassEx {
. '<td>' . $this -> getColumnData($row, COLUMN_CLOSE_TIME) . '</td>'
. '<td>' . $this -> getColumnData($row, COLUMN_SUSPENSION_TIME) . '</td>'
// . '<td class="blocka"><a href="javascript:actionDetail(\'' . $this -> getColumnData($row, COLUMN_USER_ACCOUNT) . '\');"><span class="fa fa-info-circle fa-lg"></span></a></td>'
. '<td class="blocka"><a href="account_edit?detail_account=' . $this -> getColumnData($row, COLUMN_USER_ACCOUNT) . '"><span class="fa fa-info-circle fa-lg"></span></a></td>'
. '<td class="blocka">'
.'<a href="account_edit?detail_account=' . $this -> getColumnData($row, COLUMN_USER_ACCOUNT) . '" title="'.VAL_STR_ACCOUNT_DETAILS.'"><span class="fa fa-info-circle fa-lg"></span></a>&nbsp;'
.'<a href="account_transactions?detail_account=' . $this -> getColumnData($row, COLUMN_USER_ACCOUNT) . '" title="'.VAL_STR_ACCOUNT_TRANSACTIONS.'"><span class="fa fa-university fa-lg"></span></a>'
.'</td>'
. '</tr>';
}
......
......@@ -10,7 +10,6 @@ class LogicAccountTransactions extends ModelAccountTransactions {
public function logic(){
$this -> init();
$this -> list();
}
......@@ -18,19 +17,7 @@ class LogicAccountTransactions extends ModelAccountTransactions {
$this -> setCurrencies($this -> accessSelect('LIST_MST_CURRENCY_ACTIVE', array()));
$where = $this -> getWhere();
$rowCount = $this -> getColumnData(
$this -> getRowData($this -> accessSelect('SELECT_USER_TRANSACTION_ADMIN_COUNT', $where), 0),
"overall_total");
$this -> setTotal($rowCount);
$start = ($this -> getTargetPage() - VAL_INT_1) * $this -> getDefaultPageCount();
$this -> setStart($start);
$where[] = " LIMIT {$start}, {$this -> getDefaultPageCount()}";
$this -> setResult($this -> accessSelect('LIST_USER_TRANSACTION_ADMIN', $where));
$this -> setCurrencyTxnCounter($this -> accessSelect('LIST_USER_TRANSACTION_ADMIN_COUNT_REVISED', $where));
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -14,6 +14,56 @@ include_once('template/base_head.php');
<input type="button" id="btnSearch" value="検索" class="btn bg-default px50 hi22">
</div>
</div>
<table class="conditions fontS w100p">
<colgroup>
<col class="w50p">
<col class="w50p">
</colgroup>
<tr>
<td>氏名:</td>
<td><strong><?php $this -> echoAccountInfo("account_name") ?></strong></td>
</tr>
<tr>
<td>ユーザー名:</td>
<td><strong><?php $this -> echoAccountInfo("user_name") ?></strong></td>
</tr>
<tr>
<td>生年月日:</td>
<td><strong><?php $this -> echoAccountInfo("birth_string") ?></strong></td>
</tr>
<tr>
<td>口座種別:</td>
<td><strong><?php $this -> echoAccountInfo("account_type") ?></strong></td>
</tr>
<tr>
<td>ステータス:</td>
<td><strong><?php $this -> echoAccountInfo("status") ?></strong></td>
</tr>
<tr>
<td>KYC認証:</td>
<td><strong><?php $this -> echoAccountInfo("kyc_validate_status") ?></strong></td>
</tr>
<tr>
<td>Riskレベル:</td>
<td><strong><?php $this -> echoAccountInfo("risk_level") ?></strong></td>
</tr>
<tr>
<td>ティアレベル:</td>
<td><strong><?php $this -> echoAccountInfo("tier_level") ?></strong></td>
</tr>
<tr>
<td>備考欄</td>
<td><i><?php $this -> echoAccountInfo("note") ?></i></td>
</tr>
<tr>
<td>Risk備考欄</td>
<td><i><?php $this -> echoAccountInfo("risk") ?></i></td>
</tr>
</table>
<hr/>
<table class="conditions fontS w100p">
<colgroup>
<col class="w50p">
......@@ -35,6 +85,7 @@ include_once('template/base_head.php');
<th>通貨種別</th>
<td>
<select id="s_currency" name="s_currency" class="w100p">
<option value="">--- すべて ---</option>
<?php $this -> echoCurrencyList(); ?>
</select>
</td>
......@@ -43,7 +94,7 @@ include_once('template/base_head.php');
<th>取引科目</th>
<td>
<select name="transaction_type" id="transaction_type" class="w100p">
<option value="">--- All ---</option>
<option value="">--- すべて ---</option>
<?php $this -> dispTransactionTypeList(); ?>
</select>
</td>
......@@ -63,6 +114,10 @@ include_once('template/base_head.php');
<input type="button" id="btnBack" value="戻る" class="btn bg-grad hi25 px100">
</p>
<input type="hidden" value="" id="s_type" name="type" />
<span style="display:none;" id="file_exporter_prog">
ファイルをエクスポート中。。。
</span>
</form>
</aside>
......@@ -71,13 +126,12 @@ include_once('template/base_head.php');
<?php include_once('template/base_nav.php'); ?>
<article>
<div class="article-heading">
<h2><?php echo $page_title; ?><?php $this -> echoDetailAccount(); ?></h2>
<?php $this -> dispPager(); ?>
</div>
<?php $this -> echoList() ?>
<div class="article-bottom">
<?php $this -> dispPager(); ?>
<h2><?php echo $page_title; ?><?php $this -> echoDetailAccount(); ?></h2>
</div>
<?php echo $this -> echoTransactionTables() ?>
<?php echo $this -> echoJavascriptLabels() ?>
</article>
</div>
</div>
......
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