added all query parameter for address transactions
This commit is contained in:
parent
c9c7197b0e
commit
d4cb27dca7
2 changed files with 18 additions and 8 deletions
|
@ -443,6 +443,13 @@ class MainController extends AppController {
|
||||||
$stmt = $conn->execute('SELECT COUNT(TransactionId) AS Total FROM TransactionsAddresses WHERE AddressId = ?', [$addressId]);
|
$stmt = $conn->execute('SELECT COUNT(TransactionId) AS Total FROM TransactionsAddresses WHERE AddressId = ?', [$addressId]);
|
||||||
$count = $stmt->fetch(\PDO::FETCH_OBJ);
|
$count = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||||
$numTransactions = $count->Total;
|
$numTransactions = $count->Total;
|
||||||
|
$all = $this->request->query('all');
|
||||||
|
if ($all === 'true') {
|
||||||
|
$offset = 0;
|
||||||
|
$pageLimit = $numTransactions;
|
||||||
|
$numPages = 1;
|
||||||
|
$page = 1;
|
||||||
|
} else {
|
||||||
$numPages = ceil($numTransactions / $pageLimit);
|
$numPages = ceil($numTransactions / $pageLimit);
|
||||||
if ($page < 1) {
|
if ($page < 1) {
|
||||||
$page = 1;
|
$page = 1;
|
||||||
|
@ -452,6 +459,8 @@ class MainController extends AppController {
|
||||||
}
|
}
|
||||||
|
|
||||||
$offset = ($page - 1) * $pageLimit;
|
$offset = ($page - 1) * $pageLimit;
|
||||||
|
}
|
||||||
|
|
||||||
$stmt = $conn->execute('SELECT A.TotalReceived, A.TotalSent FROM Addresses A WHERE A.Id = ?', [$address->Id]);
|
$stmt = $conn->execute('SELECT A.TotalReceived, A.TotalSent FROM Addresses A WHERE A.Id = ?', [$address->Id]);
|
||||||
$totals = $stmt->fetch(\PDO::FETCH_OBJ);
|
$totals = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||||
|
|
||||||
|
@ -481,6 +490,7 @@ class MainController extends AppController {
|
||||||
$this->set('numTransactions', $numTransactions);
|
$this->set('numTransactions', $numTransactions);
|
||||||
$this->set('numPages', $numPages);
|
$this->set('numPages', $numPages);
|
||||||
$this->set('currentPage', $page);
|
$this->set('currentPage', $page);
|
||||||
|
$this->set('pageLimit', $pageLimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function qr($data = null) {
|
public function qr($data = null) {
|
||||||
|
|
|
@ -150,9 +150,9 @@
|
||||||
<h3>Recent Transactions</h3>
|
<h3>Recent Transactions</h3>
|
||||||
<div class="results-meta">
|
<div class="results-meta">
|
||||||
<?php if ($numTransactions > 0):
|
<?php if ($numTransactions > 0):
|
||||||
$begin = ($currentPage - 1) * 50 + 1;
|
$begin = ($currentPage - 1) * $pageLimit + 1;
|
||||||
?>
|
?>
|
||||||
Showing <?php echo number_format($begin, 0, '', ',') ?> - <?php echo number_format(min($numTransactions, ($begin + 50) - 1), 0, '', ','); ?> of <?php echo number_format($numTransactions, 0, '', ','); ?> result<?php echo $numTransactions == 1 ? '' : 's' ?>
|
Showing <?php echo number_format($begin, 0, '', ',') ?> - <?php echo number_format(min($numTransactions, ($begin + $pageLimit) - 1), 0, '', ','); ?> of <?php echo number_format($numTransactions, 0, '', ','); ?> result<?php echo $numTransactions == 1 ? '' : 's' ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue