Commit 0b516633 authored by Anthony.Suerte's avatar Anthony.Suerte

Transaction History Optimization

parent 28bcb09b
......@@ -57,35 +57,44 @@ class UserTransactions extends OpenAPIAbstraction {
echo json_encode($result);
}
private function list(){
$list = $this -> accessSelect('LIST_USER_TRANSACTION', $this -> getUserAccountData());
$rowCount = count($list);
$totalPage = $this -> getTotalPageCommon(VAR_DEFAULT_PAGE_COUNT, $rowCount);
private function list(){
$countTransactions = $this -> getRowData($this -> accessSelect('SELECT_USER_TRANSACTION_COUNT', [
$this -> holder -> userAccount,
$this -> holder -> currency,
$this -> getWhereCount()
]));
$totalPage = $this -> getTotalPageCommon(VAR_DEFAULT_PAGE_COUNT, $countTransactions["overall_total"]);
$params = $this -> getUserAccountData();
$currentPage = !empty($this -> holder -> page) ? $this -> holder -> page : 1;
$currentPage = empty($this -> holder -> page) || !is_numeric($this -> holder -> page) ? 1 : $this -> holder -> page;
if($currentPage > $totalPage)
$currentPage = $totalPage;
$start = ($currentPage - 1) * VAR_DEFAULT_PAGE_COUNT;
$params[3] = "LIMIT {$start}, ".VAR_DEFAULT_PAGE_COUNT;
$list = $this -> accessSelect('LIST_USER_TRANSACTION', $params);
$start = ($currentPage - VAL_INT_1) * VAR_DEFAULT_PAGE_COUNT;
$end = $currentPage * VAR_DEFAULT_PAGE_COUNT;
$result = [
"row_count" => $rowCount,
"row_count" => $countTransactions["overall_total"],
"page_total" => $totalPage,
"current_page" => $currentPage,
"result" => []
];
for($i = $start; $i < $end && $i < $rowCount; $i++) {
$transaction = $this -> getRowData($list, $i);
foreach($list as $transaction){
$this -> statusIndication($transaction);
$result["result"][] = $transaction;
}
echo json_encode($result);
}
......@@ -97,6 +106,7 @@ class UserTransactions extends OpenAPIAbstraction {
$rtn[] = $this -> holder -> userAccount; // ユーザアカウント
$rtn[] = $this -> holder -> currency;
$rtn[] = $this -> getWhere(); // 検索条件
$rtn[] = NO_STRING;
return $rtn;
}
......@@ -132,6 +142,29 @@ class UserTransactions extends OpenAPIAbstraction {
return $rtn;
}
public function getWhereCount(){
// 変数宣言部
$params = array();
$rtn = NO_STRING;
// 日付指定(from)
if($this -> holder -> dateFrom != NO_STRING) {
$params[] = ' create_time >= (\')' . $this -> holder -> dateFrom . '(\')';
}
// 日付指定(to)
if($this -> holder -> dateTo != NO_STRING) {
$params[] = ' create_time < DATE_ADD((\')' . $this -> holder -> dateTo . '(\'), INTERVAL 1 DAY)';
}
// データが存在した場合
if($this -> isLoopData($params)) {
$rtn = DELIMIT_AND . implode(DELIMIT_AND, $params);
}
return $rtn;
}
private function statusIndication(&$row){
if($this -> getColumnData($row, COLUMN_TRANSACTION_TYPE) == VAL_INT_1) { // 入金
$row['type'] = VAL_STR_DEPOSIT;
......
......@@ -2238,4 +2238,9 @@ article div.article-heading{
header .logo-block img {
box-sizing: border-box;
height: 80px;
padding: 25px 20px 8px;
\ No newline at end of file
padding: 25px 20px 8px;
}
.ui-pagination{
padding-top: 15px;
}
\ No newline at end of file
......@@ -18,43 +18,53 @@ include_once('template/base_head.php');
</div>
<div class="pleft40 mb10"><?php $this -> echoMessage(); ?></div>
<form id="acForm" action="" method="post" class="pleft40">
<div class="filterCe">
<span>Currency</span> <select name="currency" class="px80">
<?php $this -> echoCurrencyList();?>
</select>&emsp;</div>
<div class="filterPse">
<span>Period</span> <input type="text" id="from" name="from" value="<?php $this -> echoFrom();?>" class="px130 datepicker">
</div>
<div class="filterPe"><span> - </span><input type="text" id="to" name="to" value="<?php $this -> echoTo();?>" class="px130 datepicker"></div>
<div class="filterB">
<input type="button" id="btnSearch" value="Search" class="btn bg-filter mb10">
<?php
if($this -> getAccountType() == "1"){
?>
<input type="button" id="btnExport" value="Export" class="btn bg-filter mb10">
<?php
}
?>
</div>
<table class="table col bdr default odd calign w99p fontXS" id="table-breakpoint">
<tr>
<th class="w5p">ID</th>
<th class="w7p break">Transaction Type</th>
<th class="w7p">Account Number</th>
<th class="w10p break">Account Name</th>
<th class="w7p">Money In</th>
<th class="w7p">Money Out</th>
<th class="w7p">Fee</th>
<th class="w7p">Submission Date</th>
<th class="w7p">Operation Date</th>
<th class="w7p">Ref.No</th>
<th class="w15p break">Message</th>
<th class="w5p break">Status</th>
<th class="w7p">Balance</th>
</tr>
<?php $this -> echoList();?>
</table>
<input type="hidden" value="" id="type" name="type" />
<div class="filterCe">
<span>Currency</span> <select name="currency" class="px80">
<?php $this -> echoCurrencyList();?>
</select>&emsp;</div>
<div class="filterPse">
<span>Period</span> <input type="text" id="from" name="from" value="<?php $this -> echoFrom();?>" class="px130 datepicker">
</div>
<div class="filterPe"><span> - </span><input type="text" id="to" name="to" value="<?php $this -> echoTo();?>" class="px130 datepicker"></div>
<div class="filterB">
<input type="button" id="btnSearch" value="Search" class="btn bg-filter mb10">
<?php
if($this -> getAccountType() == "1"){
?>
<input type="button" id="btnExport" value="Export" class="btn bg-filter mb10">
<?php
}
?>
</div>
<table class="table col bdr default odd calign w99p fontXS" id="table-breakpoint">
<tr>
<th class="w5p">ID</th>
<th class="w7p break">Transaction Type</th>
<th class="w7p">Account Number</th>
<th class="w10p break">Account Name</th>
<th class="w7p">Money In</th>
<th class="w7p">Money Out</th>
<th class="w7p">Fee</th>
<th class="w7p">Submission Date</th>
<th class="w7p">Operation Date</th>
<th class="w7p">Ref.No</th>
<th class="w15p break">Message</th>
<th class="w5p break">Status</th>
<th class="w7p">Balance</th>
</tr>
<?php $this -> echoList();?>
</table>
<input type="hidden" value="" id="type" name="type" />
<input type="hidden" value="<?php $this -> echoTotalPage()?>" id="max_page"/>
<div class="ui-pagination">
<span><strong>Search Results:</strong> <?php $this -> echoTotal(); ?>&nbsp;&nbsp;&nbsp;</span>
<span class="ui-current-page"><?php $this -> echoPage()?>/<?php $this -> echoTotalPage()?></span>
<input type="button" id="btnPrevPage" value="Previous" class="btn bg-filter mb10">
<input type="button" id="btnNextPage" value="Next" class="btn bg-filter mb10">
&nbsp;&nbsp;&nbsp;&nbsp
<input type="text" id="cur_page" name="page" value="<?php $this -> echoPage() ?>" class="px50">
<input type="button" id="dispPage" value="Display" class="btn bg-filter mb10">
</div>
</form>
</article>
</div>
......
......@@ -18,36 +18,46 @@ include_once('template/base_head.php');
</div>
<div class="pleft40 mb10"><?php $this -> echoMessage(); ?></div>
<form id="acForm" action="" method="post" class="pleft40">
<div class="filterCe">
<span>Mata Uang</span> <select name="currency" class="px80">
<?php $this -> echoCurrencyList();?>
</select>&emsp;</div>
<div class="filterPse">
<span>Periode</span> <input type="text" id="from" name="from" value="<?php $this -> echoFrom();?>" class="px130 datepicker">
</div>
<div class="filterPe"><span> - </span><input type="text" id="to" name="to" value="<?php $this -> echoTo();?>" class="px130 datepicker"></div>
<div class="filterB">
<input type="button" id="btnSearch" value="Cari" class="btn bg-filter">
</div>
<table class="table col bdr default odd calign w99p fontXS" id="table-breakpoint">
<tr>
<th class="w5p">ID</th>
<th class="w7p break">Jenis Transaksi</th>
<th class="w7p">Nomor Akun</th>
<th class="w10p break">Nama Akun</th>
<th class="w7p">Uang Masuk</th>
<th class="w7p">Uang Keluar</th>
<th class="w7p">Biaya</th>
<th class="w7p">Tanggal Pengajuan</th>
<th class="w7p">Tanggal Pengerjaan</th>
<th class="w7p">No. Referensi</th>
<th class="w15p break">Pesan</th>
<th class="w5p break">Status</th>
<th class="w7p">Saldo</th>
</tr>
<?php $this -> echoList();?>
</table>
<input type="hidden" value="" id="type" name="type" />
<div class="filterCe">
<span>Mata Uang</span> <select name="currency" class="px80">
<?php $this -> echoCurrencyList();?>
</select>&emsp;</div>
<div class="filterPse">
<span>Periode</span> <input type="text" id="from" name="from" value="<?php $this -> echoFrom();?>" class="px130 datepicker">
</div>
<div class="filterPe"><span> - </span><input type="text" id="to" name="to" value="<?php $this -> echoTo();?>" class="px130 datepicker"></div>
<div class="filterB">
<input type="button" id="btnSearch" value="Cari" class="btn bg-filter">
</div>
<table class="table col bdr default odd calign w99p fontXS" id="table-breakpoint">
<tr>
<th class="w5p">ID</th>
<th class="w7p break">Jenis Transaksi</th>
<th class="w7p">Nomor Akun</th>
<th class="w10p break">Nama Akun</th>
<th class="w7p">Uang Masuk</th>
<th class="w7p">Uang Keluar</th>
<th class="w7p">Biaya</th>
<th class="w7p">Tanggal Pengajuan</th>
<th class="w7p">Tanggal Pengerjaan</th>
<th class="w7p">No. Referensi</th>
<th class="w15p break">Pesan</th>
<th class="w5p break">Status</th>
<th class="w7p">Saldo</th>
</tr>
<?php $this -> echoList();?>
</table>
<input type="hidden" value="" id="type" name="type" />
<input type="hidden" value="<?php $this -> echoTotalPage()?>" id="max_page"/>
<div class="ui-pagination">
<span><strong>Hasil Pencarian:</strong> <?php $this -> echoTotal(); ?>&nbsp;&nbsp;&nbsp;</span>
<span class="ui-current-page"><?php $this -> echoPage()?>/<?php $this -> echoTotalPage()?></span>
<input type="button" id="btnPrevPage" value="Sebelumnya" class="btn bg-filter mb10">
<input type="button" id="btnNextPage" value="Lanjut" class="btn bg-filter mb10">
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" id="cur_page" name="page" value="<?php $this -> echoPage() ?>" class="px50">
<input type="button" id="dispPage" value="Tampilan" class="btn bg-filter mb10">
</div>
</form>
</article>
</div>
......
......@@ -18,43 +18,53 @@ include_once('template/base_head.php');
</div>
<div class="pleft40 mb10"><?php $this -> echoMessage(); ?></div>
<form id="acForm" action="" method="post" class="pleft40">
<div class="filterC">
<span>通貨</span> <select name="currency" class="px90">
<?php $this -> echoCurrencyList();?>
</select>&emsp;</div>
<div class="filterPs">
<span>期間</span> <input type="text" id="from" name="from" value="<?php $this -> echoFrom();?>" class="px130 datepicker">
</div>
<div class="filterP"><span> - </span><input type="text" id="to" name="to" value="<?php $this -> echoTo();?>" class="px130 datepicker"></div>
<div class="filterB">
<input type="button" id="btnSearch" value="表示" class="btn bg-filter mb10">
<?php
if($this -> getAccountType() == "1"){
?>
<input type="button" id="btnExport" value="エクスポート" class="btn bg-filter mb10">
<?php
}
?>
</div>
<table class="table col bdr default odd calign w99p fontXS" id="table-breakpoint">
<tr>
<th class="w5p"></th>
<th class="w7p">取引種別</th>
<th class="w7p">口座番号</th>
<th class="w10p break">口座名義</th>
<th class="w7p">入金額</th>
<th class="w7p">出金額</th>
<th class="w7p">手数料</th>
<th class="w7p">申請日</th>
<th class="w7p">処理日</th>
<th class="w7p">取引番号</th>
<th class="w15p break">メッセージ</th>
<th class="w5p break">状態</th>
<th class="w7p">残高</th>
</tr>
<?php $this -> echoList();?>
</table>
<input type="hidden" value="" id="type" name="type" />
<div class="filterC">
<span>通貨</span> <select name="currency" class="px90">
<?php $this -> echoCurrencyList();?>
</select>&emsp;</div>
<div class="filterPs">
<span>期間</span> <input type="text" id="from" name="from" value="<?php $this -> echoFrom();?>" class="px130 datepicker">
</div>
<div class="filterP"><span> - </span><input type="text" id="to" name="to" value="<?php $this -> echoTo();?>" class="px130 datepicker"></div>
<div class="filterB">
<input type="button" id="btnSearch" value="表示" class="btn bg-filter mb10">
<?php
if($this -> getAccountType() == "1"){
?>
<input type="button" id="btnExport" value="エクスポート" class="btn bg-filter mb10">
<?php
}
?>
</div>
<table class="table col bdr default odd calign w99p fontXS" id="table-breakpoint">
<tr>
<th class="w5p"></th>
<th class="w7p">取引種別</th>
<th class="w7p">口座番号</th>
<th class="w10p break">口座名義</th>
<th class="w7p">入金額</th>
<th class="w7p">出金額</th>
<th class="w7p">手数料</th>
<th class="w7p">申請日</th>
<th class="w7p">処理日</th>
<th class="w7p">取引番号</th>
<th class="w15p break">メッセージ</th>
<th class="w5p break">状態</th>
<th class="w7p">残高</th>
</tr>
<?php $this -> echoList();?>
</table>
<input type="hidden" value="" id="type" name="type" />
<input type="hidden" value="<?php $this -> echoTotalPage()?>" id="max_page"/>
<div class="ui-pagination">
<span><strong>検索結果:</strong> <?php $this -> echoTotal(); ?>&nbsp;&nbsp;&nbsp;</span>
<span class="ui-current-page"><?php $this -> echoPage()?>/<?php $this -> echoTotalPage()?></span>
<input type="button" id="btnPrevPage" value="前ページ" class="btn bg-filter mb10">
<input type="button" id="btnNextPage" value="次ページ" class="btn bg-filter mb10">
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" id="cur_page" name="page" value="<?php $this -> echoPage() ?>" class="px50">
<input type="button" id="dispPage" value="表示" class="btn bg-filter mb10">
</div>
</form>
</article>
</div>
......
$(function() {
$.fn.inputFilter = function(inputFilter) {
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
if (inputFilter(this.value)) {
this.oldValue = this.value;
this.oldSelectionStart = this.selectionStart;
this.oldSelectionEnd = this.selectionEnd;
} else if (this.hasOwnProperty("oldValue")) {
this.value = this.oldValue;
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
} else {
this.value = "";
}
});
};
$("#cur_page").inputFilter(function(value) {
return /^-?\d*$/.test(value); });
var currentPage = parseInt($("#cur_page").val())
if(currentPage == 1)
$("#btnPrevPage").hide()
$('#btnPrevPage').click(function() {
$('#type').val('search');
if((currentPage - 1) < 1)
return;
$("#cur_page").val(currentPage - 1)
submitForm();
});
$('#btnNextPage').click(function() {
$('#type').val('search');
var maximumPage = parseInt($("#max_page").val())
if((currentPage + 1) > maximumPage)
return;
$("#cur_page").val(currentPage + 1)
submitForm();
});
$('#dispPage').click(function(){
$('#type').val('search');
var maximumPage = parseInt($("#max_page").val())
var selectedPage = parseInt($("#cur_page").val())
if($("#cur_page").val().trim().length == 0)
return;
if(selectedPage > maximumPage || selectedPage < 1)
return;
submitForm();
})
$('#btnSearch').click(function() {
$('#type').val('search');
submitForm();
......
......@@ -45,9 +45,24 @@ class LogicHistory extends HistoryModelClass {
* @parameter : なし
* @return : なし
-------------------------------------------------------------------------*/
private function lists() {
$this -> setResult($this -> accessSelect('LIST_USER_TRANSACTION', $this -> getUserAccountData()));
private function lists() {
$countRow = $this -> getRowData($this -> accessSelect('SELECT_USER_TRANSACTION_COUNT', [
$this -> getUserData(PARAM_USER_ACCOUNT),
$this -> getCurrency(),
$this -> getWhereCount()
]));
$totalRows = $this -> getColumnData($countRow, "overall_total");
$start = ($this -> getPage() - 1) * $this -> getHistoryDefaultLimitCount();
$this -> setTotal($totalRows);
$this -> setTotalPage($this -> getTotalPageCommon($this -> getHistoryDefaultLimitCount(), $totalRows));
$userAccountArray = $this -> getUserAccountData();
$userAccountArray[3] = "LIMIT {$start}, {$this -> getHistoryDefaultLimitCount()}";
$this -> setResult($this -> accessSelect('LIST_USER_TRANSACTION', $userAccountArray));
$this -> setBalance($this -> accessSelect('LIST_USER_BALANCE_FROM_CURRENCY_DATE', $this -> getBalanceParams()));
}
......
......@@ -11,6 +11,10 @@ class HistoryModelClass extends ModelClassEx {
private $to = NO_STRING; // 期間終了
private $accountType = NO_STRING; // account type attribute (string). created by joshua dino
private $csvData = NO_STRING; // data attribute (string). created by joshua dino
private $total = NO_STRING;
private $page = NO_STRING;
private $totalPage = NO_STRING;
/*-------------------------------------------------------------------------
* @function_name: コントロールパネルシステムindexモデルクラスコンストラクタ
......@@ -64,6 +68,8 @@ class HistoryModelClass extends ModelClassEx {
if($this -> currency == NO_STRING) {
$this -> currency = USD;
}
$this -> page = empty($this -> getDataPost("page")) ? 1 : $this -> getDataPost("page");
// Fromの日付は確定させないとダメ
if($this -> getDataPost(PARAM_FROM) == NO_STRING) {
......@@ -110,6 +116,29 @@ class HistoryModelClass extends ModelClassEx {
return $rtn;
}
public function getWhereCount(){
// 変数宣言部
$params = array();
$rtn = NO_STRING;
// 日付指定(from)
if($this -> from != NO_STRING) {
$params[] = ' create_time >= (\')' . $this -> from . '(\')';
}
// 日付指定(to)
if($this -> to != NO_STRING) {
$params[] = ' create_time < DATE_ADD((\')' . $this -> to . '(\'), INTERVAL 1 DAY)';
}
// データが存在した場合
if($this -> isLoopData($params)) {
$rtn = DELIMIT_AND . implode(DELIMIT_AND, $params);
}
return $rtn;
}
/*-------------------------------------------------------------------------
* @function_name: サーバ側データチェック
......@@ -145,6 +174,7 @@ class HistoryModelClass extends ModelClassEx {
$rtn[] = $this -> getUserData(PARAM_USER_ACCOUNT); // ユーザアカウント
$rtn[] = $this -> currency;
$rtn[] = $this -> getWhere(); // 検索条件
$rtn[] = NO_STRING;
return $rtn;
}
......@@ -218,7 +248,12 @@ class HistoryModelClass extends ModelClassEx {
$rtn .= '</tr>';
$no = count($this -> rs);
$pageRowCount = $this -> page * $this -> getHistoryDefaultLimitCount();
if($this -> page == $this -> totalPage)
$pageRowCount = $this -> total;
$no = $pageRowCount;
$counter = $no; //counter for id number - added by Joshua Dino 04/23/2018
// データの数だけループを回す
......@@ -464,6 +499,18 @@ class HistoryModelClass extends ModelClassEx {
function getFrom() {
return $this -> from;
}
function getPage(){
return $this -> page;
}
function getCurrency(){
return $this -> currency;
}
function getHistoryDefaultLimitCount(){
return VAL_INT_10;
}
/*-------------------------------------------------------------------------
* @function_name: 期間開始の取得
......@@ -482,6 +529,23 @@ class HistoryModelClass extends ModelClassEx {
function echoTo() {
echo $this -> to;
}
/*-------------------------------------------------------------------------
* @function_name: 期間終了の取得
* @parameter : なし
* @return : 期間終了
-------------------------------------------------------------------------*/
function echoTotal() {
echo $this -> total;
}
function echoTotalPage(){
echo $this -> totalPage;
}
function echoPage(){
echo $this -> page;
}
/*-------------------------------------------------------------------------
* @function_name: 通貨一覧の取得
......@@ -500,6 +564,23 @@ class HistoryModelClass extends ModelClassEx {
public function setResult($rs) {
$this -> rs = $rs;
}
/*-------------------------------------------------------------------------
* @function_name: 全額の設定
* @parameter : 全額
* @return : なし
-------------------------------------------------------------------------*/
public function setTotal($total) {
$this -> total = $total;
}
public function setTotalPage($totalPage) {
$this -> totalPage = $totalPage;
}
public function setPage($page){
$this -> page = page;
}
/*-------------------------------------------------------------------------
* @function_name: バランスの設定
......
......@@ -18,43 +18,53 @@ include_once('template/base_head.php');
</div>
<div class="pleft40 mb10"><?php $this -> echoMessage(); ?></div>
<form id="acForm" action="" method="post" class="pleft40">
<div class="filterCe">
<span>币种</span> <select name="currency" class="px80">
<?php $this -> echoCurrencyList();?>
</select>&emsp;</div>
<div class="filterPse">
<span>期间</span> <input type="text" id="from" name="from" value="<?php $this -> echoFrom();?>" class="px130 datepicker">
</div>
<div class="filterPe"><span> - </span><input type="text" id="to" name="to" value="<?php $this -> echoTo();?>" class="px130 datepicker"></div>
<div class="filterB">
<input type="button" id="btnSearch" value="搜索" class="btn bg-filter mb10">
<?php
if($this -> getAccountType() == "1"){
?>
<input type="button" id="btnExport" value="导出" class="btn bg-filter mb10">
<?php
}
?>
</div>
<table class="table col bdr default odd calign w99p fontXS" id="table-breakpoint">
<tr>
<th class="w5p">ID</th>
<th class="w7p break">交易类型</th>
<th class="w7p">账户号码</th>
<th class="w10p break">账户名称</th>
<th class="w7p">收入</th>
<th class="w7p">支出</th>
<th class="w7p">手续费</th>
<th class="w7p">申请日期</th>
<th class="w7p">处理日期</th>
<th class="w7p">交易编号</th>
<th class="w15p break">备注</th>
<th class="w5p break">交易状态</th>
<th class="w7p">账户余额</th>
</tr>
<?php $this -> echoList();?>
</table>
<input type="hidden" value="" id="type" name="type" />
<div class="filterCe">
<span>币种</span> <select name="currency" class="px80">
<?php $this -> echoCurrencyList();?>
</select>&emsp;</div>
<div class="filterPse">
<span>期间</span> <input type="text" id="from" name="from" value="<?php $this -> echoFrom();?>" class="px130 datepicker">
</div>
<div class="filterPe"><span> - </span><input type="text" id="to" name="to" value="<?php $this -> echoTo();?>" class="px130 datepicker"></div>
<div class="filterB">
<input type="button" id="btnSearch" value="搜索" class="btn bg-filter mb10">
<?php
if($this -> getAccountType() == "1"){
?>
<input type="button" id="btnExport" value="导出" class="btn bg-filter mb10">
<?php
}
?>
</div>
<table class="table col bdr default odd calign w99p fontXS" id="table-breakpoint">
<tr>
<th class="w5p">ID</th>
<th class="w7p break">交易类型</th>
<th class="w7p">账户号码</th>
<th class="w10p break">账户名称</th>
<th class="w7p">收入</th>
<th class="w7p">支出</th>
<th class="w7p">手续费</th>
<th class="w7p">申请日期</th>
<th class="w7p">处理日期</th>
<th class="w7p">交易编号</th>
<th class="w15p break">备注</th>
<th class="w5p break">交易状态</th>
<th class="w7p">账户余额</th>
</tr>
<?php $this -> echoList();?>
</table>
<input type="hidden" value="" id="type" name="type" />
<input type="hidden" value="<?php $this -> echoTotalPage()?>" id="max_page"/>
<div class="ui-pagination">
<span><strong>搜寻结果:</strong> <?php $this -> echoTotal(); ?>&nbsp;&nbsp;&nbsp;</span>
<span class="ui-current-page"><?php $this -> echoPage()?>/<?php $this -> echoTotalPage()?></span>
<input type="button" id="btnPrevPage" value="返回" class="btn bg-filter mb10">
<input type="button" id="btnNextPage" value="下一步" class="btn bg-filter mb10">
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" id="cur_page" name="page" value="<?php $this -> echoPage() ?>" class="px50">
<input type="button" id="dispPage" value="表示" class="btn bg-filter mb10">
</div>
</form>
</article>
</div>
......
......@@ -4285,8 +4285,52 @@ WHERE
__ELEMENT03__
ORDER BY
transaction_time , msecond
__ELEMENT04__
</LIST_USER_TRANSACTION>
<SELECT_USER_TRANSACTION_COUNT>
SELECT
(remitter + receiver + deposit + withdrawal + benef_exchange
+ debit_exchange + from_request + to_request + with1 + with2 + with3 ) AS 'overall_total'
FROM (
SELECT
(SELECT COUNT(*) FROM t_deposit WHERE user_account = '__ELEMENT01__'
AND currency = '__ELEMENT02__' __ELEMENT03__ AND NOW() + INTERVAL 17 HOUR > deposit_date) deposit,
(SELECT COUNT(*) FROM t_withdraw WHERE user_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__' __ELEMENT03__ AND STATUS &lt;= 3
AND (TYPE = '0'
OR TYPE = '3'
OR TYPE = '1')) withdrawal,
(SELECT COUNT(*) FROM t_exchange WHERE user_account = '__ELEMENT01__'
AND currency = '__ELEMENT02__' __ELEMENT03__) benef_exchange,
(SELECT COUNT(*) FROM t_exchange WHERE user_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__' __ELEMENT03__) debit_exchange,
(SELECT COUNT(*) FROM t_transfer WHERE from_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__' __ELEMENT03__) remitter,
(SELECT COUNT(*) FROM t_transfer WHERE to_account = '__ELEMENT01__'
AND transfer_currency = '__ELEMENT02__' __ELEMENT03__) receiver,
(SELECT COUNT(*) FROM t_request WHERE from_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__' __ELEMENT03__ AND STATUS = 1) from_request,
(SELECT COUNT(*) FROM t_request WHERE to_account = '__ELEMENT01__'
AND currency = '__ELEMENT02__' __ELEMENT03__ AND STATUS = 1) to_request,
(SELECT COUNT(*) FROM t_withdraw WHERE user_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__' __ELEMENT03__ AND STATUS = '4') with1,
(SELECT COUNT(*) FROM t_withdraw WHERE user_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__' __ELEMENT03__ AND STATUS = '6') with2,
(SELECT COUNT(*) FROM t_withdraw WHERE user_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__' __ELEMENT03__ AND STATUS = '2' AND TYPE = '11') with3
) counts
</SELECT_USER_TRANSACTION_COUNT>
<LIST_USER_TRANSACTION_ADMIN_COUNT>
SELECT
count(*) total
......
......@@ -18,43 +18,53 @@ include_once('template/base_head.php');
</div>
<div class="pleft40 mb10"><?php $this -> echoMessage(); ?></div>
<form id="acForm" action="" method="post" class="pleft40">
<div class="filterCe">
<span>幣種</span> <select name="currency" class="px80">
<?php $this -> echoCurrencyList();?>
</select>&emsp;</div>
<div class="filterPse">
<span>期間</span> <input type="text" id="from" name="from" value="<?php $this -> echoFrom();?>" class="px130 datepicker">
</div>
<div class="filterPe"><span> - </span><input type="text" id="to" name="to" value="<?php $this -> echoTo();?>" class="px130 datepicker"></div>
<div class="filterB">
<input type="button" id="btnSearch" value="查詢" class="btn bg-filter mb10">
<?php
if($this -> getAccountType() == "1"){
?>
<input type="button" id="btnExport" value="導出" class="btn bg-filter mb10">
<?php
}
?>
</div>
<table class="table col bdr default odd calign w99p fontXS" id="table-breakpoint">
<tr>
<th class="w5p">ID</th>
<th class="w7p break">交易類型</th>
<th class="w7p">帳戶號碼</th>
<th class="w10p break">帳戶名稱</th>
<th class="w7p">帳戶儲值</th>
<th class="w7p">餘額轉出</th>
<th class="w7p">手續費</th>
<th class="w7p">申請日期</th>
<th class="w7p">處理日期</th>
<th class="w7p">交易編號</th>
<th class="w15p break">備註</th>
<th class="w5p break">交易狀態</th>
<th class="w7p">帳戶餘額</th>
</tr>
<?php $this -> echoList();?>
</table>
<input type="hidden" value="" id="type" name="type" />
<div class="filterCe">
<span>幣種</span> <select name="currency" class="px80">
<?php $this -> echoCurrencyList();?>
</select>&emsp;</div>
<div class="filterPse">
<span>期間</span> <input type="text" id="from" name="from" value="<?php $this -> echoFrom();?>" class="px130 datepicker">
</div>
<div class="filterPe"><span> - </span><input type="text" id="to" name="to" value="<?php $this -> echoTo();?>" class="px130 datepicker"></div>
<div class="filterB">
<input type="button" id="btnSearch" value="查詢" class="btn bg-filter mb10">
<?php
if($this -> getAccountType() == "1"){
?>
<input type="button" id="btnExport" value="導出" class="btn bg-filter mb10">
<?php
}
?>
</div>
<table class="table col bdr default odd calign w99p fontXS" id="table-breakpoint">
<tr>
<th class="w5p">ID</th>
<th class="w7p break">交易類型</th>
<th class="w7p">帳戶號碼</th>
<th class="w10p break">帳戶名稱</th>
<th class="w7p">帳戶儲值</th>
<th class="w7p">餘額轉出</th>
<th class="w7p">手續費</th>
<th class="w7p">申請日期</th>
<th class="w7p">處理日期</th>
<th class="w7p">交易編號</th>
<th class="w15p break">備註</th>
<th class="w5p break">交易狀態</th>
<th class="w7p">帳戶餘額</th>
</tr>
<?php $this -> echoList();?>
</table>
<input type="hidden" value="" id="type" name="type" />
<input type="hidden" value="<?php $this -> echoTotalPage()?>" id="max_page"/>
<div class="ui-pagination">
<span><strong>搜尋結果:</strong> <?php $this -> echoTotal(); ?>&nbsp;&nbsp;&nbsp;</span>
<span class="ui-current-page"><?php $this -> echoPage()?>/<?php $this -> echoTotalPage()?></span>
<input type="button" id="btnPrevPage" value="返回" class="btn bg-filter mb10">
<input type="button" id="btnNextPage" value="下一步" class="btn bg-filter mb10">
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" id="cur_page" name="page" value="<?php $this -> echoPage() ?>" class="px50">
<input type="button" id="dispPage" value="顯示" class="btn bg-filter mb10">
</div>
</form>
</article>
</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