[TEMPLATE] block stats in mmcfe

This commit is contained in:
root 2013-11-07 15:27:39 +01:00
parent e92e0d7abb
commit a7cda8fedc
6 changed files with 184 additions and 158 deletions

View File

@ -70,10 +70,9 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
}
$iHours = 24;
$now = new DateTime( "now" );
$aPoolStatistics = $statistics->getPoolStatsHours($iHours);
$iFirstBlockFound = $statistics->getFirstBlockFound();
$iTimeSinceFirstBlockFound = ($now->getTimestamp() - $iFirstBlockFound);
$iTimeSinceFirstBlockFound = (time() - $iFirstBlockFound);
// Past blocks found, max 4 weeks back
$iFoundBlocksByTime = $statistics->getLastBlocksbyTime();

View File

@ -0,0 +1,64 @@
{include file="global/block_header.tpl" BLOCK_HEADER="Block Shares" BLOCK_STYLE="clear:none;"}
<table width="100%" class="tablesorter" cellspacing="0">
<thead>
<tr>
<th align="left"></th>
<th align="center">Gen Est.</th>
<th align="center">Found</th>
<th align="center">Valid</th>
<th align="center">Orphan</th>
<th align="center">Rate Est.</th>
</tr>
</thead>
<tbody>
<tr>
<th align="left" style="padding-left: 15px">All Time</td>
<td align="center">{($FIRSTBLOCKFOUND / $COINGENTIME|default:"150")|number_format:"0"}</td>
<td align="center">{$LASTBLOCKSBYTIME.Total}</td>
<td align="center">{$LASTBLOCKSBYTIME.TotalValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.TotalOrphan}</td>
<td align="center">{($LASTBLOCKSBYTIME.Total|default:"0.00" / ($FIRSTBLOCKFOUND / $COINGENTIME|default:"150") * 100)|number_format:"2"} %</td>
</tr>
<tr>
<th align="left" style="padding-left: 15px">Last Hour</td>
<td align="center">{(3600 / $COINGENTIME|default:"150")}</td>
<td align="center">{$LASTBLOCKSBYTIME.1HourTotal}</td>
<td align="center">{$LASTBLOCKSBYTIME.1HourValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.1HourOrphan}</td>
<td align="center">{($LASTBLOCKSBYTIME.1HourTotal|default:"0.00" / (3600 / $COINGENTIME|default:"150") * 100)|number_format:"2"} %</td>
</tr>
<tr>
<th align="left" style="padding-left: 15px">Last 24 Hours</td>
<td align="center">{(86400 / $COINGENTIME|default:"150")}</td>
<td align="center">{$LASTBLOCKSBYTIME.24HourTotal}</td>
<td align="center">{$LASTBLOCKSBYTIME.24HourValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.24HourOrphan}</td>
<td align="center">{($LASTBLOCKSBYTIME.24HourTotal|default:"0.00" / (86400 / $COINGENTIME|default:"150") * 100)|number_format:"2"} %</td>
</tr>
<tr>
<th align="left" style="padding-left: 15px">Last 7 Days</td>
<td align="center">{(604800 / $COINGENTIME|default:"150")}</td>
<td align="center">{$LASTBLOCKSBYTIME.7DaysTotal}</td>
<td align="center">{$LASTBLOCKSBYTIME.7DaysValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.7DaysOrphan}</td>
<td align="center">{($LASTBLOCKSBYTIME.7DaysTotal|default:"0.00" / (604800 / $COINGENTIME|default:"150") * 100)|number_format:"2"} %</td>
</tr>
<tr>
<th align="left" style="padding-left: 15px">Last 4 Weeks</td>
<td align="center">{(2419200 / $COINGENTIME|default:"150")}</td>
<td align="center">{$LASTBLOCKSBYTIME.4WeeksTotal}</td>
<td align="center">{$LASTBLOCKSBYTIME.4WeeksValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.4WeeksOrphan}</td>
<td align="center">{($LASTBLOCKSBYTIME.4WeeksTotal|default:"0.00" / (2419200 / $COINGENTIME|default:"150") * 100)|number_format:"2"} %</td>
</tr>
<tr>
<th align="left" style="padding-left: 15px">Last 12 Month</td>
<td align="center">{(29030400 / $COINGENTIME|default:"150")}</td>
<td align="center">{$LASTBLOCKSBYTIME.12MonthTotal}</td>
<td align="center">{$LASTBLOCKSBYTIME.12MonthValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.12MonthOrphan}</td>
<td align="center">{($LASTBLOCKSBYTIME.12MonthTotal|default:"0.00" / (29030400 / $COINGENTIME|default:"150") * 100)|number_format:"2"} %</td>
</tr>
</tbody>
</table>
{include file="global/block_footer.tpl"}

View File

@ -0,0 +1,58 @@
{include file="global/block_header.tpl" BLOCK_HEADER="Block Shares" BLOCK_STYLE="clear:none;"}
<article class="module width_full">
<table width="70%" class="stats" rel="line">
<caption>Block Shares</caption>
<thead>
<tr>
{section block $BLOCKSFOUND step=-1}
<th scope="col">{$BLOCKSFOUND[block].height}</th>
{/section}
</th>
</thead>
<tbody>
<tr>
<th scope="row">Expected</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].estshares}</td>
{/section}
</tr>
<tr>
<th scope="row">Actual</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].shares}</td>
{/section}
</tr>
{if $GLOBAL.config.payout_system == 'pplns'}<tr>
<th scope="row">PPLNS</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].pplns_shares}</td>
{/section}
</tr>{/if}
{if $USEBLOCKAVERAGE}<tr>
<th scope="row">Average</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].block_avg}</td>
{/section}
</tr>{/if}
</tbody>
</table>
<table align="left" width="100%" border="0" style="font-size:13px;">
<tbody>
<tr>
<td class="left">
<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={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > 0}{$BLOCKSFOUND[0].height}{/if}&next=1"><img src="{$PATH}/images/next.png" /></i></a>
</td>
</tr>
</tbody>
</table>
<center><br>
<p style="padding-left:30px; padding-redight:30px; font-size:10px;">
The graph above illustrates N shares to find a block vs. E Shares expected to find a block based on
target and network difficulty and assuming a zero variance scenario.
</p>
</article>
{include file="global/block_footer.tpl"}

View File

@ -0,0 +1,27 @@
{include file="global/block_header.tpl" BLOCK_HEADER="Block Shares" BLOCK_STYLE="clear:none;"}
<header><h3>Last 24 hour totals</h3></header>
<table width="100%" class="tablesorter" cellspacing="0">
<thead>
<tr style="background-color:#B6DAFF;">
<th align="center">Blocks Found</th>
<th align="center">Rewards</th>
<th align="center">Avg Difficulty</th>
<th align="center">Expected Shares</th>
<th align="center">Actual Shares</th>
<th align="center" style="padding-right: 25px;">Percentage</th>
</tr>
</thead>
<tbody>
{assign var=percentage1 value=0}
<tr>
<td align="center">{$POOLSTATS.count|number_format:"0"}</td>
<td align="center">{$POOLSTATS.rewards|number_format:"4"}</td>
<td align="center">{$POOLSTATS.average|number_format:"4"}</td>
<td align="center">{$POOLSTATS.expected|number_format:"0"}</td>
<td align="center">{$POOLSTATS.shares|number_format:"0"}</td>
<td align="center" style="padding-right: 25px;">{if $POOLSTATS.shares > 0}{math assign="percentage1" equation="shares1 / estshares1 * 100" shares1=$POOLSTATS.shares estshares1=$POOLSTATS.expected}{/if}
<font color="{if ($percentage1 <= 100)}green{else}red{/if}">{$percentage1|number_format:"2"}</font></b></td>
</tr>
</tbody>
</table>
{include file="global/block_footer.tpl"}

View File

@ -0,0 +1,30 @@
{include file="global/block_header.tpl" BLOCK_HEADER="Last $BLOCKLIMIT Blocks Found" BLOCK_STYLE="clear:none;"}
<center>
<table width="100%" style="font-size:13px;">
<thead>
<tr style="background-color:#B6DAFF;">
<th class="center">Block</th>
<th>Finder</th>
<th class="center">Time</th>
<th class="right">Actual Shares</th>
</tr>
</thead>
<tbody>
{assign var=rank value=1}
{section block $BLOCKSFOUND}
<tr class="{cycle values="odd,even"}">
<td><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round&height={$BLOCKSFOUND[block].height}">{$BLOCKSFOUND[block].height}</a></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].shares|number_format}</td>
</tr>
{/section}
</tbody>
</table>
</center>
{if $GLOBAL.config.payout_system != 'pps'}
<ul>
<li>Note: <font color="orange">Round Earnings are not credited until {$GLOBAL.confirmations} confirms.</font></li>
</ul>
{/if}
{include file="global/block_footer.tpl"}

View File

@ -1,156 +1,4 @@
{include file="global/block_header.tpl" BLOCK_HEADER="Block Shares" BLOCK_STYLE="clear:none;"}
<table width="70%" class="stats" rel="line">
<caption>Block Shares</caption>
<thead>
<tr>
{section block $BLOCKSFOUND step=-1}
<th scope="col">{$BLOCKSFOUND[block].height}</th>
{/section}
</th>
</thead>
<tbody>
<tr>
<th scope="row">Expected</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].estshares}</td>
{/section}
</tr>
<tr>
<th scope="row">Actual</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].shares}</td>
{/section}
</tr>
{if $GLOBAL.config.payout_system == 'pplns'}<tr>
<th scope="row">PPLNS</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].pplns_shares}</td>
{/section}
</tr>{/if}
{if $USEBLOCKAVERAGE}<tr>
<th scope="row">Average</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].block_avg}</td>
{/section}
</tr>{/if}
</tbody>
</table>
<center><br>
<p style="padding-left:30px; padding-redight:30px; font-size:10px;">
The graph above illustrates N shares to find a block vs. E Shares expected to find a block based on
target and network difficulty and assuming a zero variance scenario.
</p>
<table width="100%" style="font-size:13px;">
<thead>
<tr>
<th class="center" colspan="6">Last 24 hour totals</th>
</tr>
<tr style="background-color:#B6DAFF;">
<th class="center">Blocks Found</th>
<th class="center">Rewards</th>
<th class="center">Avg Difficulty</th>
<th class="center">Expected Shares</th>
<th class="center">Actual Shares</th>
<th class="center">Percentage</th>
</tr>
</thead>
<tbody>
{assign var=percentage1 value=0}
<tr>
<td class="center">{$POOLSTATS.count|number_format:"0"}</td>
<td class="center">{$POOLSTATS.rewards|number_format:"4"}</td>
<td class="center">{$POOLSTATS.average|number_format:"4"}</td>
<td class="center">{$POOLSTATS.expected|number_format:"0"}</td>
<td class="center">{$POOLSTATS.shares|number_format:"0"}</td>
<td class="center">{if $POOLSTATS.shares > 0}{math assign="percentage1" equation="shares1 / estshares1 * 100" shares1=$POOLSTATS.shares estshares1=$POOLSTATS.expected}{/if}
<font color="{if ($percentage1 <= 100)}green{else}red{/if}">{$percentage1|number_format:"2"}</font></b></td>
</tr>
</tbody>
</table>
<table align="left" width="100%" border="0" style="font-size:13px;">
<tbody>
<tr>
<td class="left">
<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={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > 0}{$BLOCKSFOUND[0].height}{/if}&next=1"><img src="{$PATH}/images/next.png" /></i></a>
</td>
</tr>
</tbody>
</table>
</center>
{include file="global/block_footer.tpl"}
{include file="global/block_header.tpl" BLOCK_HEADER="Last $BLOCKLIMIT Blocks Found" BLOCK_STYLE="clear:none;"}
<center>
<table width="100%" class="sortable" style="font-size:13px;">
<thead>
<tr style="background-color:#B6DAFF;">
<th class="center">Block</th>
<th class="center">Validity</th>
<th>Finder</th>
<th class="center">Time</th>
<th class="right">Difficulty</th>
<th class="right">Amount</th>
<th class="right">Expected Shares</th>
{if $GLOBAL.config.payout_system == 'pplns'}<th class="right">PPLNS Shares</th>{/if}
<th class="right">Actual Shares</th>
<th class="right">Percentage</th>
</tr>
</thead>
<tbody>
{assign var=count value=0}
{assign var=totalexpectedshares value=0}
{assign var=totalshares value=0}
{assign var=totalpercentage value=0}
{assign var=pplnsshares value=0}
{section block $BLOCKSFOUND}
{assign var="totalshares" value=$totalshares+$BLOCKSFOUND[block].shares}
{assign var="count" value=$count+1}
{if $GLOBAL.config.payout_system == 'pplns'}{assign var="pplnsshares" value=$pplnsshares+$BLOCKSFOUND[block].pplns_shares}{/if}
<tr class="{cycle values="odd,even"}">
<td class="center"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round&height={$BLOCKSFOUND[block].height}">{$BLOCKSFOUND[block].height}</a></td>
<td class="center">
{if $BLOCKSFOUND[block].confirmations >= $GLOBAL.confirmations}
<font color="green">Confirmed</font>
{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 && $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>
<td class="right">
{$BLOCKSFOUND[block].estshares|number_format}
{assign var="totalexpectedshares" value=$totalexpectedshares+$BLOCKSFOUND[block].estshares}
</td>
{if $GLOBAL.config.payout_system == 'pplns'}<td class="right">{$BLOCKSFOUND[block].pplns_shares|number_format}</td>{/if}
<td class="right">{$BLOCKSFOUND[block].shares|number_format}</td>
<td class="right">
{math assign="percentage" equation="shares / estshares * 100" shares=$BLOCKSFOUND[block].shares estshares=$BLOCKSFOUND[block].estshares}
{assign var="totalpercentage" value=$totalpercentage+$percentage}
<font color="{if ($percentage <= 100)}green{else}red{/if}">{$percentage|number_format:"2"}</font>
</td>
</tr>
{/section}
{if $count > 0}
<tr>
<td colspan="6" class="right"><b>Totals</b></td>
<td class="right">{$totalexpectedshares|number_format}</td>
{if $GLOBAL.config.payout_system == 'pplns'}<td class="right">{$pplnsshares|number_format}</td>{/if}
<td class="right">{$totalshares|number_format}</td>
<td class="right"><font color="{if (($totalpercentage / $count) <= 100)}green{else}red{/if}">{($totalpercentage / $count)|number_format:"2"}</font>
</tr>
{/if}
</tbody>
</table>
</center>
{if $GLOBAL.config.payout_system != 'pps'}
<ul>
<li>Note: <font color="orange">Round Earnings are not credited until {$GLOBAL.confirmations} confirms.</font></li>
</ul>
{/if}
{include file="global/block_footer.tpl"}
{include file="statistics/blocks/block_shares_graph.tpl"}
{include file="statistics/blocks/block_overview_time.tpl"}
{include file="statistics/blocks/block_shares_time.tpl"}
{include file="statistics/blocks/blocks_found_details.tpl"}