round stats fixes
This commit is contained in:
parent
7e49e7c254
commit
c2169576ee
@ -124,7 +124,7 @@ class RoundStats {
|
||||
GROUP BY username ASC
|
||||
ORDER BY valid DESC
|
||||
");
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param('i',$iHeight) && $stmt->execute() && $result = $stmt->get_result())
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $iHeight) && $stmt->execute() && $result = $stmt->get_result())
|
||||
return $result->fetch_all(MYSQLI_ASSOC);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ $aSettings['statistics'][] = array(
|
||||
'display' => 'Show block average', 'type' => 'select',
|
||||
'options' => array( 0 => 'No', 1 => 'Yes' ),
|
||||
'default' => 0,
|
||||
'name' => 'show_block_average', 'value' => $setting->getValue('show_block_average'),
|
||||
'name' => 'statistics_show_block_average', 'value' => $setting->getValue('show_block_average'),
|
||||
'tooltip' => 'Show block average in block statistics page.'
|
||||
);
|
||||
$aSettings['statistics'][] = array(
|
||||
|
||||
@ -44,13 +44,13 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
|
||||
if ($config['payout_system'] == 'pplns') {
|
||||
foreach($aBlocksFoundData as $key => $aData) {
|
||||
$aBlocksFoundData[$key]['pplns_shares'] = $roundstats->getPPLNSRoundShares($aData['height']);
|
||||
if ($setting->getValue('show_block_average') && !$test) {
|
||||
if ($setting->getValue('statistics_show_block_average') && !$test) {
|
||||
$aBlocksFoundData[$key]['block_avg'] = round($block->getAvgBlockShares($aData['height'], $config['pplns']['blockavg']['blockcount']));
|
||||
$use_average = true;
|
||||
}
|
||||
}
|
||||
} else if ($config['payout_system'] == 'prop' || $config['payout_system'] == 'pps') {
|
||||
if ($setting->getValue('show_block_average') && !$test) {
|
||||
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;
|
||||
@ -68,7 +68,7 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($aBlocksFoundData);
|
||||
// Propagate content our template
|
||||
$smarty->assign("BLOCKSFOUND", $aBlocksFoundData);
|
||||
$smarty->assign("BLOCKLIMIT", $iLimit);
|
||||
|
||||
@ -26,6 +26,7 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
|
||||
$_REQUEST['height'] = $iHeight;
|
||||
|
||||
$iPPLNSShares = 0;
|
||||
$aSharesData = array();
|
||||
$aDetailsForBlockHeight = $roundstats->getDetailsForBlockHeight($iHeight);
|
||||
$aRoundShareStats = $roundstats->getRoundStatsForAccounts($iHeight);
|
||||
|
||||
|
||||
@ -44,10 +44,10 @@ target and network difficulty and assuming a zero variance scenario.
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="left">
|
||||
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKSFOUND[$BLOCKLIMIT - 1].height}&prev=1"><img src="{$PATH}/images/prev.png" /></a>
|
||||
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > ($BLOCKLIMIT - 1)}{$BLOCKSFOUND[$BLOCKLIMIT - 1].height}{/if}&prev=1"><img src="{$PATH}/images/prev.png" /></a>
|
||||
</td>
|
||||
<td class="right">
|
||||
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKSFOUND[0].height}&next=1"><img src="{$PATH}/images/next.png" /></a>
|
||||
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > 0}{$BLOCKSFOUND[0].height}{/if}&next=1"><img src="{$PATH}/images/next.png" /></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -90,7 +90,7 @@ target and network difficulty and assuming a zero variance scenario.
|
||||
{else if $BLOCKSFOUND[block].confirmations == -1}
|
||||
<font color="red">Orphan</font>
|
||||
{else}{$GLOBAL.confirmations - $BLOCKSFOUND[block].confirmations} left{/if}</td>
|
||||
<td>{if $BLOCKSFOUND[block].is_anonymous|default:"0" == 1}anonymous{else}{$BLOCKSFOUND[block].finder|default:"unknown"|escape}{/if}</td>
|
||||
<td>{if $BLOCKSFOUND[block].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$BLOCKSFOUND[block].finder|default:"unknown"|escape}{/if}</td>
|
||||
<td class="center">{$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"}</td>
|
||||
<td class="right">{$BLOCKSFOUND[block].difficulty|number_format:"8"}</td>
|
||||
<td class="right">{$BLOCKSFOUND[block].amount|number_format:"2"}</td>
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
{section contrib $PPLNSROUNDSHARES}
|
||||
<tr{if $GLOBAL.userdata.username|default:"" == $PPLNSROUNDSHARES[contrib].username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
|
||||
<td class="center">{$rank++}</td>
|
||||
<td>{if $PPLNSROUNDSHARES[contrib].is_anonymous|default:"0" == 1}anonymous{else}{$PPLNSROUNDSHARES[contrib].username|escape}{/if}</td>
|
||||
<td>{if $PPLNSROUNDSHARES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$PPLNSROUNDSHARES[contrib].username|escape}{/if}</td>
|
||||
<td class="right">{$PPLNSROUNDSHARES[contrib].pplns_valid|number_format}</td>
|
||||
<td class="right">{$PPLNSROUNDSHARES[contrib].pplns_invalid|number_format}</td>
|
||||
<td class="right">{if $PPLNSROUNDSHARES[contrib].pplns_invalid > 0 && $PPLNSROUNDSHARES[contrib].pplns_valid > 0}{($PPLNSROUNDSHARES[contrib].pplns_invalid / $PPLNSROUNDSHARES[contrib].pplns_valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
{assign var=percentage1 value=0}
|
||||
{section txs $ROUNDTRANSACTIONS}
|
||||
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDTRANSACTIONS[txs].username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
|
||||
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
|
||||
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
|
||||
<td class="right">{$SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid|number_format}</td>
|
||||
<td class="right">{if $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid > 0 }{(( 100 / $BLOCKDETAILS.shares) * $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid)|number_format:"2"}{else}0.00{/if}</td>
|
||||
<td class="right">{$PPLNSROUNDSHARES[txs].pplns_valid|number_format|default:"0"}</td>
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
{section contrib $ROUNDSHARES}
|
||||
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDSHARES[contrib].username} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
|
||||
<td class="center">{$rank++}</td>
|
||||
<td>{if $ROUNDSHARES[contrib].is_anonymous|default:"0" == 1}anonymous{else}{$ROUNDSHARES[contrib].username|escape}{/if}</td>
|
||||
<td>{if $ROUNDSHARES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDSHARES[contrib].username|escape}{/if}</td>
|
||||
<td class="right">{$ROUNDSHARES[contrib].valid|number_format}</td>
|
||||
<td class="right">{$ROUNDSHARES[contrib].invalid|number_format}</td>
|
||||
<td class="right">{if $ROUNDSHARES[contrib].invalid > 0 }{($ROUNDSHARES[contrib].invalid / $ROUNDSHARES[contrib].valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<tbody>
|
||||
{section txs $ROUNDTRANSACTIONS}
|
||||
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDTRANSACTIONS[txs].username} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
|
||||
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
|
||||
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
|
||||
<td class="right">{$ROUNDTRANSACTIONS[txs].type|default:""}</td>
|
||||
<td class="right">{(( 100 / $BLOCKDETAILS.shares) * $ROUNDSHARES[txs].valid)|number_format:"2"}</td>
|
||||
<td class="right">{$ROUNDTRANSACTIONS[txs].amount|default:"0"|number_format:"8"}</td>
|
||||
|
||||
@ -40,10 +40,10 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left">
|
||||
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKSFOUND[$BLOCKLIMIT - 1].height}&prev=1"><i class="icon-left-open"></i></a>
|
||||
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > ($BLOCKLIMIT - 1)}{$BLOCKSFOUND[$BLOCKLIMIT - 1].height}{/if}&prev=1"><i class="icon-left-open"></i></a>
|
||||
</td>
|
||||
<td align="right">
|
||||
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKSFOUND[0].height}&next=1"><i class="icon-right-open"></i></a>
|
||||
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > 0}{$BLOCKSFOUND[0].height}{/if}&next=1"><i class="icon-right-open"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -98,7 +98,7 @@
|
||||
<span class="unconfirmed">{$GLOBAL.confirmations - $BLOCKSFOUND[block].confirmations} left</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td>{if $BLOCKSFOUND[block].is_anonymous|default:"0" == 1}anonymous{else}{$BLOCKSFOUND[block].finder|default:"unknown"|escape}{/if}</td>
|
||||
<td>{if $BLOCKSFOUND[block].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$BLOCKSFOUND[block].finder|default:"unknown"|escape}{/if}</td>
|
||||
<td align="center">{$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"}</td>
|
||||
<td align="right">{$BLOCKSFOUND[block].difficulty|number_format:"2"}</td>
|
||||
<td align="right">{$BLOCKSFOUND[block].amount|number_format:"2"}</td>
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
{section contrib $PPLNSROUNDSHARES}
|
||||
<tr{if $GLOBAL.userdata.username|default:"" == $PPLNSROUNDSHARES[contrib].username} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
|
||||
<td align="center">{$rank++}</td>
|
||||
<td>{if $PPLNSROUNDSHARES[contrib].is_anonymous|default:"0" == 1}anonymous{else}{$PPLNSROUNDSHARES[contrib].username|escape}{/if}</td>
|
||||
<td>{if $PPLNSROUNDSHARES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$PPLNSROUNDSHARES[contrib].username|escape}{/if}</td>
|
||||
<td align="right">{$PPLNSROUNDSHARES[contrib].pplns_valid|number_format}</td>
|
||||
<td align="right">{$PPLNSROUNDSHARES[contrib].pplns_invalid|number_format}</td>
|
||||
<td align="right" style="padding-right: 25px;">{if $PPLNSROUNDSHARES[contrib].pplns_invalid > 0 && $PPLNSROUNDSHARES[contrib].pplns_valid > 0}{($PPLNSROUNDSHARES[contrib].pplns_invalid / $PPLNSROUNDSHARES[contrib].pplns_valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
{assign var=percentage1 value=0}
|
||||
{section txs $ROUNDTRANSACTIONS}
|
||||
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDTRANSACTIONS[txs].username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
|
||||
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
|
||||
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
|
||||
<td align="right">{$SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid|number_format}</td>
|
||||
<td align="right">{if $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid > 0 }{(( 100 / $BLOCKDETAILS.shares) * $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid)|number_format:"2"}{else}0.00{/if}</td>
|
||||
<td align="right">{$PPLNSROUNDSHARES[txs].pplns_valid|number_format|default:"0"}</td>
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
<tbody>
|
||||
{section txs $ROUNDTRANSACTIONS}
|
||||
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDTRANSACTIONS[txs].username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
|
||||
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
|
||||
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
|
||||
<td align="right">{$SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid|number_format}</td>
|
||||
<td align="right">{$SHARESDATA[$ROUNDTRANSACTIONS[txs].username].invalid|number_format}</td>
|
||||
<td align="right">{if $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].invalid > 0 }{($SHARESDATA[$ROUNDTRANSACTIONS[txs].username].invalid / $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
{section contrib $ROUNDSHARES}
|
||||
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDSHARES[contrib].username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
|
||||
<td align="center">{$rank++}</td>
|
||||
<td>{if $ROUNDSHARES[contrib].is_anonymous|default:"0" == 1}anonymous{else}{$ROUNDSHARES[contrib].username|escape}{/if}</td>
|
||||
<td>{if $ROUNDSHARES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDSHARES[contrib].username|escape}{/if}</td>
|
||||
<td align="right">{$ROUNDSHARES[contrib].valid|number_format}</td>
|
||||
<td align="right">{$ROUNDSHARES[contrib].invalid|number_format}</td>
|
||||
<td align="right" style="padding-right: 25px;">{if $ROUNDSHARES[contrib].invalid > 0 }{($ROUNDSHARES[contrib].invalid / $ROUNDSHARES[contrib].valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<tbody>
|
||||
{section txs $ROUNDTRANSACTIONS}
|
||||
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDTRANSACTIONS[txs].username} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
|
||||
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
|
||||
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
|
||||
<td align="center">{$ROUNDTRANSACTIONS[txs].type|default:""}</td>
|
||||
<td align="right">{(( 100 / $BLOCKDETAILS.shares) * $ROUNDSHARES[txs].valid)|default:"0"|number_format:"2"}</td>
|
||||
<td align="right" style="padding-right: 25px;">{$ROUNDTRANSACTIONS[txs].amount|default:"0"|number_format:"8"}</td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user