[FIX] Pagination for Block Stats
This commit is contained in:
parent
1fa5d3b23e
commit
429ef80430
@ -13,18 +13,21 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
|
||||
}
|
||||
|
||||
$iHeight = 0;
|
||||
if (@$_REQUEST['next'] && !empty($_REQUEST['height']) && is_numeric($_REQUEST['height'])) {
|
||||
$iHeight = @$roundstats->getNextBlockForStats($_REQUEST['height'], $iLimit);
|
||||
if (!$iHeight) {
|
||||
$iBlock = $block->getLast();
|
||||
$iHeight = $iBlock['height'];
|
||||
}
|
||||
} else if (@$_REQUEST['prev'] && !empty($_REQUEST['height']) && is_numeric($_REQUEST['height'])) {
|
||||
$iHeight = $_REQUEST['height'];
|
||||
if (@$_REQUEST['next'] && !empty($_REQUEST['height'])) {
|
||||
$iHeight = @$roundstats->getNextBlock($_REQUEST['height']);
|
||||
if (!$iHeight) {
|
||||
$iBlock = $block->getLast();
|
||||
$iHeight = $iBlock['height'];
|
||||
}
|
||||
} else if (@$_REQUEST['prev'] && !empty($_REQUEST['height'])) {
|
||||
$iHeight = $roundstats->getPreviousBlock($_REQUEST['height']);
|
||||
} else if (empty($_REQUEST['height'])) {
|
||||
$aBlock = $block->getLast();
|
||||
$iHeight = $aBlock['height'];
|
||||
$iBlock = $block->getLast();
|
||||
$iHeight = $iBlock['height'];
|
||||
} else {
|
||||
$iHeight = $_REQUEST['height'];
|
||||
}
|
||||
$_REQUEST['height'] = $iHeight;
|
||||
|
||||
$test = false;
|
||||
if (@$_REQUEST['test'] && $user->isAdmin($_SESSION['USERDATA']['id'])) {
|
||||
@ -48,8 +51,8 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
|
||||
}
|
||||
}
|
||||
} else if ($config['payout_system'] == 'prop' || $config['payout_system'] == 'pps') {
|
||||
if ($setting->getValue('statistics_show_block_average') && !$test) {
|
||||
foreach($aBlocksFoundData as $key => $aData) {
|
||||
if ($setting->getValue('statistics_show_block_average') && !$test) {
|
||||
foreach($aBlocksFoundData as $key => $aData) {
|
||||
$aBlocksFoundData[$key]['block_avg'] = round($block->getAvgBlockShares($aData['height'], $config['pplns']['blockavg']['blockcount']));
|
||||
$use_average = true;
|
||||
}
|
||||
|
||||
@ -44,6 +44,8 @@ $(function () {
|
||||
<div class="panel-group">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<a href="{$smarty.server.SCRIPT_NAME}?page={$smarty.request.page|escape}&action={$smarty.request.action|escape}&height={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > ($BLOCKLIMIT - 1)}{$BLOCKSFOUND[$BLOCKLIMIT - 1].height}{/if}&prev=1"><i class="fa fa-chevron-left"></i></a>
|
||||
<a href="{$smarty.server.SCRIPT_NAME}?page={$smarty.request.page|escape}&action={$smarty.request.action|escape}&height={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > 0}{$BLOCKSFOUND[0].height}{/if}&next=1"><i class="fa fa-chevron-right pull-right"></i></a>
|
||||
<div class="flot-chart">
|
||||
<div id="block-area-chart"></div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user