diff --git a/public/include/classes/roundstats.class.php b/public/include/classes/roundstats.class.php index 5cbbfb4e..aebdd257 100644 --- a/public/include/classes/roundstats.class.php +++ b/public/include/classes/roundstats.class.php @@ -29,12 +29,12 @@ class RoundStats { /** * Get next block for round stats **/ - public function getNextBlockDesc($iHeight=0) { + public function getNextBlock($iHeight=0) { $stmt = $this->mysqli->prepare(" SELECT height FROM $this->tableBlocks - WHERE height < ? - ORDER BY height DESC + WHERE height > ? + ORDER BY height ASC LIMIT 1"); if ($this->checkStmt($stmt) && $stmt->bind_param('i', $iHeight) && $stmt->execute() && $result = $stmt->get_result()) return $result->fetch_object()->height; @@ -44,12 +44,12 @@ class RoundStats { /** * Get prev block for round stats **/ - public function getNextBlockAsc($iHeight=0) { + public function getPreviousBlock($iHeight=0) { $stmt = $this->mysqli->prepare(" SELECT height FROM $this->tableBlocks - WHERE height > ? - ORDER BY height ASC + WHERE height < ? + ORDER BY height DESC LIMIT 1"); if ($this->checkStmt($stmt) && $stmt->bind_param('i', $iHeight) && $stmt->execute() && $result = $stmt->get_result()) return $result->fetch_object()->height; diff --git a/public/include/pages/statistics/round.inc.php b/public/include/pages/statistics/round.inc.php index b4d138e1..f7ce285d 100644 --- a/public/include/pages/statistics/round.inc.php +++ b/public/include/pages/statistics/round.inc.php @@ -7,19 +7,19 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) { $debug->append('No cached version available, fetching from backend', 3); if (@$_REQUEST['next'] && !empty($_REQUEST['height'])) { - $_REQUEST['height'] = $roundstats->getNextBlockDesc($_REQUEST['height']); + $iKey = $roundstats->getNextBlock($_REQUEST['height']); } else if (@$_REQUEST['prev'] && !empty($_REQUEST['height'])) { - $_REQUEST['height'] = $roundstats->getNextBlockAsc($_REQUEST['height']); -} + $iKey = $roundstats->getPreviousBlock($_REQUEST['height']); +} else { if (empty($_REQUEST['height'])) { $iBlock = $block->getLast(); $iKey = $iBlock['height']; - $_REQUEST['height'] = $iKey; } else { $iKey = $_REQUEST['height']; } - +} +echo $iKey; $aDetailsForBlockHeight = $roundstats->getDetailsForBlockHeight($iKey, $user->isAdmin($_SESSION['USERDATA']['id'])); $aRoundShareStats = $roundstats->getRoundStatsForAccounts($iKey, $user->isAdmin($_SESSION['USERDATA']['id'])); diff --git a/public/templates/mmcFE/statistics/round/block_stats.tpl b/public/templates/mmcFE/statistics/round/block_stats.tpl index 5943e421..75b33950 100644 --- a/public/templates/mmcFE/statistics/round/block_stats.tpl +++ b/public/templates/mmcFE/statistics/round/block_stats.tpl @@ -47,18 +47,18 @@
+
+