admin panel reports
This commit is contained in:
parent
21a378aac1
commit
1b277c69cf
@ -225,6 +225,97 @@ class RoundStats {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ALL last blocks from height for admin panel
|
||||
**/
|
||||
public function getAllReportBlocksFoundHeight($iHeight=0, $limit=10) {
|
||||
$stmt = $this->mysqli->prepare("
|
||||
SELECT
|
||||
height, shares
|
||||
FROM $this->tableBlocks
|
||||
WHERE height <= ?
|
||||
ORDER BY height DESC LIMIT ?");
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param("ii", $iHeight, $limit) && $stmt->execute() && $result = $stmt->get_result())
|
||||
return $result->fetch_all(MYSQLI_ASSOC);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get USER last blocks from height for admin panel
|
||||
**/
|
||||
public function getUserReportBlocksFoundHeight($iHeight=0, $limit=10, $iUser) {
|
||||
$stmt = $this->mysqli->prepare("
|
||||
SELECT
|
||||
b.height, b.shares
|
||||
FROM $this->tableBlocks AS b
|
||||
LEFT JOIN $this->tableStats AS s ON s.block_id = b.id
|
||||
LEFT JOIN $this->tableUsers AS a ON a.id = s.account_id
|
||||
WHERE b.height <= ? AND a.id = ?
|
||||
ORDER BY height DESC LIMIT ?");
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param('iii', $iHeight, $iUser, $limit) && $stmt->execute() && $result = $stmt->get_result())
|
||||
return $result->fetch_all(MYSQLI_ASSOC);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get shares for block height for user admin panel
|
||||
**/
|
||||
public function getRoundStatsForUser($iHeight=0, $iUser) {
|
||||
$stmt = $this->mysqli->prepare("
|
||||
SELECT
|
||||
s.valid,
|
||||
s.invalid,
|
||||
s.pplns_valid,
|
||||
s.pplns_invalid
|
||||
FROM $this->tableStats AS s
|
||||
LEFT JOIN $this->tableBlocks AS b ON s.block_id = b.id
|
||||
LEFT JOIN $this->tableUsers AS a ON a.id = s.account_id
|
||||
WHERE b.height = ? AND a.id = ?");
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $iHeight, $iUser) && $stmt->execute() && $result = $stmt->get_result())
|
||||
return $result->fetch_assoc();
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get credit transactions for round block height for admin panel
|
||||
**/
|
||||
public function getUserRoundTransHeight($iHeight=0, $iUser) {
|
||||
$this->debug->append("STA " . __METHOD__, 4);
|
||||
$stmt = $this->mysqli->prepare("
|
||||
SELECT
|
||||
IFNULL(t.amount, 0) AS amount
|
||||
FROM $this->tableTrans AS t
|
||||
LEFT JOIN $this->tableBlocks AS b ON t.block_id = b.id
|
||||
LEFT JOIN $this->tableUsers AS a ON t.account_id = a.id
|
||||
WHERE b.height = ? AND t.type = 'Credit' AND t.account_id = ?");
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $iHeight, $iUser) && $stmt->execute() && $result = $stmt->get_result())
|
||||
return $result->fetch_object()->amount;
|
||||
$this->debug->append('Unable to fetch transactions');
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all users for admin panel
|
||||
**/
|
||||
public function getAllUsers($filter='%') {
|
||||
$this->debug->append("STA " . __METHOD__, 4);
|
||||
$stmt = $this->mysqli->prepare("
|
||||
SELECT
|
||||
a.id AS id,
|
||||
a.username AS username
|
||||
FROM $this->tableUsers AS a
|
||||
WHERE a.username LIKE ?
|
||||
GROUP BY username
|
||||
ORDER BY username");
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param('s', $filter) && $stmt->execute() && $result = $stmt->get_result()) {
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$aData[$row['id']] = $row['username'];
|
||||
}
|
||||
return $aData;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function checkStmt($bState) {
|
||||
if ($bState ===! true) {
|
||||
$this->debug->append("Failed to prepare statement: " . $this->mysqli->error);
|
||||
|
||||
86
public/include/pages/admin/reports.inc.php
Normal file
86
public/include/pages/admin/reports.inc.php
Normal file
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
// Make sure we are called from index.php
|
||||
if (!defined('SECURITY')) die('Hacking attempt');
|
||||
|
||||
// Check user to ensure they are admin
|
||||
if (!$user->isAuthenticated() || !$user->isAdmin($_SESSION['USERDATA']['id'])) {
|
||||
header("HTTP/1.1 404 Page not found");
|
||||
die("404 Page not found");
|
||||
}
|
||||
|
||||
if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
|
||||
$debug->append('No cached version available, fetching from backend', 3);
|
||||
|
||||
$aUserList = $roundstats->getAllUsers('%');
|
||||
|
||||
$iHeight = 0;
|
||||
$iUserId = 0;
|
||||
$filter = 0;
|
||||
$userName = 'None';
|
||||
if (@$_REQUEST['id']) {
|
||||
$iUserId = $_REQUEST['id'];
|
||||
$userName = $user->getUserName($_REQUEST['id']);
|
||||
}
|
||||
|
||||
$setting->getValue('statistics_block_count') ? $iLimit = $setting->getValue('statistics_block_count') : $iLimit = 20;
|
||||
if (@$_REQUEST['limit']) {
|
||||
$iLimit = $_REQUEST['limit'];
|
||||
if ( $iLimit > 1000 )
|
||||
$iLimit = 1000;
|
||||
}
|
||||
|
||||
if (@$_REQUEST['next'] && !empty($_REQUEST['height'])) {
|
||||
$iHeight = @$roundstats->getNextBlockForStats($_REQUEST['height'], $iLimit);
|
||||
if (!$iHeight) {
|
||||
$aBlock = $block->getLast();
|
||||
$iHeight = $aBlock['height'];
|
||||
}
|
||||
} else if (@$_REQUEST['prev'] && !empty($_REQUEST['height'])) {
|
||||
$iHeight = $_REQUEST['height'];
|
||||
} else if (!empty($_REQUEST['height']) && is_numeric($_REQUEST['height'])) {
|
||||
$iHeight = $_REQUEST['height'];
|
||||
} else {
|
||||
$aBlock = $block->getLast();
|
||||
$iHeight = $aBlock['height'];
|
||||
}
|
||||
|
||||
if (@$_REQUEST['search']) {
|
||||
$iHeight = $roundstats->searchForBlockHeight($_REQUEST['search']);
|
||||
}
|
||||
|
||||
if (@$_REQUEST['filter']) {
|
||||
$filter = $_REQUEST['filter'];
|
||||
}
|
||||
|
||||
$aBlocksData = array();
|
||||
if ( $iUserId ) {
|
||||
if ($filter) {
|
||||
$aBlocksData = $roundstats->getAllReportBlocksFoundHeight($iHeight, $iLimit);
|
||||
} else {
|
||||
$aBlocksData = $roundstats->getUserReportBlocksFoundHeight($iHeight, $iLimit, $iUserId);
|
||||
}
|
||||
foreach($aBlocksData as $key => $aData) {
|
||||
$aBlocksData[$key]['pplns_shares'] = @$roundstats->getPPLNSRoundShares($aData['height']);
|
||||
$aBlocksData[$key]['user'] = @$roundstats->getRoundStatsForUser($aData['height'], $iUserId);
|
||||
$aBlocksData[$key]['user_credit'] = @$roundstats->getUserRoundTransHeight($aData['height'], $iUserId);
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign('REPORTDATA', $aBlocksData);
|
||||
$smarty->assign("USERLIST", $aUserList);
|
||||
$smarty->assign("USERNAME", $userName);
|
||||
$smarty->assign("USERID", $iUserId);
|
||||
$smarty->assign("BLOCKLIMIT", $iLimit);
|
||||
$smarty->assign("HEIGHT", $iHeight);
|
||||
$smarty->assign("FILTER", $filter);
|
||||
} else {
|
||||
$debug->append('Using cached page', 3);
|
||||
}
|
||||
|
||||
if ($user->isAuthenticated(false)) {
|
||||
$smarty->assign("CONTENT", "default.tpl");
|
||||
} else {
|
||||
$smarty->assign("CONTENT", "empty");
|
||||
}
|
||||
?>
|
||||
2
public/templates/mmcFE/admin/reports/default.tpl
Normal file
2
public/templates/mmcFE/admin/reports/default.tpl
Normal file
@ -0,0 +1,2 @@
|
||||
{include file="admin/reports/earnings_control.tpl"}
|
||||
{include file="admin/reports/earnings_report.tpl"}
|
||||
50
public/templates/mmcFE/admin/reports/earnings_control.tpl
Normal file
50
public/templates/mmcFE/admin/reports/earnings_control.tpl
Normal file
@ -0,0 +1,50 @@
|
||||
{include file="global/block_header.tpl" ALIGN="left" BLOCK_STYLE="width: 100%" BLOCK_HEADER="Earnings Information" STYLE="padding-left:5px;padding-right:5px;"}
|
||||
<form action="{$smarty.server.PHP_SELF}" method="post">
|
||||
<input type="hidden" name="page" value="{$smarty.request.page|escape}">
|
||||
<input type="hidden" name="action" value="{$smarty.request.action|escape}">
|
||||
<table 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($REPORTDATA) && count($REPORTDATA) > ($BLOCKLIMIT - 1)}{$REPORTDATA[$BLOCKLIMIT - 1].height}{/if}&prev=1&limit={$BLOCKLIMIT}&id={$USERID}&filter={$FILTER}"><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($REPORTDATA) && count($REPORTDATA) > 0}{$REPORTDATA[0].height}{/if}&next=1&limit={$BLOCKLIMIT}&id={$USERID}&filter={$FILTER}"><img src="{$PATH}/images/next.png" /></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table width="100%" border="0" style="font-size:13px;">
|
||||
<thead>
|
||||
<tr style="background-color:#B6DAFF;">
|
||||
<th class="center">Select User</th>
|
||||
<th class="center">Block Limit</th>
|
||||
<th class="center">Starting Block Height</th>
|
||||
<th class="center">Show Empty Rounds</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="center">
|
||||
{html_options name="id" options=$USERLIST selected=$USERID|default:"0"}
|
||||
</td>
|
||||
<td class="center">
|
||||
<input size="12" type="text" name="limit" value="{$BLOCKLIMIT|default:"20"}" />
|
||||
</td>
|
||||
<td class="center">
|
||||
<input size="12" type="text" name="search" value="{$HEIGHT|default:"%"}">
|
||||
</td>
|
||||
<td class="center">
|
||||
<input type="checkbox" name="filter" value="1" id="filter" {if $FILTER}checked{/if} />
|
||||
<label for="filter"></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right" colspan="4">
|
||||
<input type="submit" class="submit small" value="Submit">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
{include file="global/block_footer.tpl"}
|
||||
85
public/templates/mmcFE/admin/reports/earnings_report.tpl
Normal file
85
public/templates/mmcFE/admin/reports/earnings_report.tpl
Normal file
@ -0,0 +1,85 @@
|
||||
{include file="global/block_header.tpl" ALIGN="left" BLOCK_STYLE="width: 100%" BLOCK_HEADER="Earnings Report Last {$BLOCKLIMIT} Blocks For User: {$USERNAME}" STYLE="padding-left:5px;padding-right:5px;"}
|
||||
<table class="left" width="100%" class="sortable" style="font-size:12px;">
|
||||
<thead>
|
||||
<tr style="background-color:#B6DAFF;">
|
||||
<th >Block</th>
|
||||
<th class="right">Round Shares</th>
|
||||
<th class="right">Round Valid</th>
|
||||
<th class="right">Invalid</th>
|
||||
<th class="right">Invalid %</th>
|
||||
<th class="right">Round %</th>
|
||||
<th class="right">PPLNS Shares</th>
|
||||
<th class="right">PPLNS Valid</th>
|
||||
<th class="right">Invalid</th>
|
||||
<th class="right">Invalid %</th>
|
||||
<th class="right">PPLNS %</th>
|
||||
<th class="right">Variance</th>
|
||||
<th class="right">Amount</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{assign var=percentage value=0}
|
||||
{assign var=percentage1 value=0}
|
||||
{assign var=percentage2 value=0}
|
||||
{assign var=totalvalid value=0}
|
||||
{assign var=totalinvalid value=0}
|
||||
{assign var=totalshares value=0}
|
||||
{assign var=usertotalshares value=0}
|
||||
{assign var=totalpercentage value=0}
|
||||
{assign var=pplnsshares value=0}
|
||||
{assign var=userpplnsshares value=0}
|
||||
{assign var=pplnsvalid value=0}
|
||||
{assign var=pplnsinvalid value=0}
|
||||
{assign var=amount value=0}
|
||||
{section txs $REPORTDATA}
|
||||
{assign var="totalshares" value=$totalshares+$REPORTDATA[txs].shares}
|
||||
{assign var=totalvalid value=$totalvalid+$REPORTDATA[txs]['user'].valid}
|
||||
{assign var=totalinvalid value=$totalinvalid+$REPORTDATA[txs]['user'].invalid}
|
||||
{assign var="pplnsshares" value=$pplnsshares+$REPORTDATA[txs].pplns_shares}
|
||||
{assign var=pplnsvalid value=$pplnsvalid+$REPORTDATA[txs]['user'].pplns_valid}
|
||||
{assign var=pplnsinvalid value=$pplnsinvalid+$REPORTDATA[txs]['user'].pplns_invalid}
|
||||
{assign var=amount value=$amount+$REPORTDATA[txs].user_credit}
|
||||
{if $REPORTDATA[txs]['user'].pplns_valid > 0}
|
||||
{assign var="userpplnsshares" value=$userpplnsshares+$REPORTDATA[txs].pplns_shares}
|
||||
{/if}
|
||||
{if $REPORTDATA[txs]['user'].valid > 0}
|
||||
{assign var="usertotalshares" value=$usertotalshares+$REPORTDATA[txs].shares}
|
||||
{/if}
|
||||
<tr>
|
||||
<td><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round&height={$REPORTDATA[txs].height}">{$REPORTDATA[txs].height|default:"0"}</a></td>
|
||||
<td class="right">{$REPORTDATA[txs].shares|default:"0"}</td>
|
||||
<td class="right">{$REPORTDATA[txs]['user'].valid|number_format|default:"0"}</td>
|
||||
<td class="right">{$REPORTDATA[txs]['user'].invalid|number_format|default:"0"}</td>
|
||||
<td class="right">{if $REPORTDATA[txs]['user'].invalid > 0 }{($REPORTDATA[txs]['user'].invalid / $REPORTDATA[txs]['user'].valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
<td class="right">{if $REPORTDATA[txs]['user'].valid > 0 }{(( 100 / $REPORTDATA[txs].shares) * $REPORTDATA[txs]['user'].valid)|number_format:"2"}{else}0.00{/if}</td>
|
||||
<td class="right">{$REPORTDATA[txs].pplns_shares|number_format|default:"0"}</td>
|
||||
<td class="right">{$REPORTDATA[txs]['user'].pplns_valid|number_format|default:"0"}</td>
|
||||
<td class="right">{$REPORTDATA[txs]['user'].pplns_invalid|number_format|default:"0"}</td>
|
||||
<td class="right">{if $REPORTDATA[txs]['user'].pplns_invalid > 0 && $REPORTDATA[txs]['user'].pplns_valid > 0 }{($REPORTDATA[txs]['user'].pplns_invalid / $REPORTDATA[txs]['user'].pplns_valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
<td class="right">{if $REPORTDATA[txs].shares > 0 && $REPORTDATA[txs]['user'].pplns_valid > 0}{(( 100 / $REPORTDATA[txs].pplns_shares) * $REPORTDATA[txs]['user'].pplns_valid)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
<td class="right">{if $REPORTDATA[txs]['user'].valid > 0 && $REPORTDATA[txs]['user'].pplns_valid > 0}{math assign="percentage1" equation=(100 / ((( 100 / $REPORTDATA[txs].shares) * $REPORTDATA[txs]['user'].valid) / (( 100 / $REPORTDATA[txs].pplns_shares) * $REPORTDATA[txs]['user'].pplns_valid)))}{else if $REPORTDATA[txs]['user'].pplns_valid == 0}{assign var=percentage1 value=0}{else}{assign var=percentage1 value=100}{/if}
|
||||
<font color="{if ($percentage1 >= 100)}green{else}red{/if}">{$percentage1|number_format:"2"|default:"0"}</font></b></td>
|
||||
<td class="right">{$REPORTDATA[txs].user_credit|default:"0"|number_format:"8"}</td>
|
||||
{assign var=percentage1 value=0}
|
||||
</tr>
|
||||
{/section}
|
||||
<tr>
|
||||
<td><b>Totals</b></td>
|
||||
<td class="right">{$totalshares|number_format}</td>
|
||||
<td class="right">{$totalvalid|number_format}</td>
|
||||
<td class="right">{$totalinvalid|number_format}</td>
|
||||
<td class="right">{if $totalinvalid > 0 && $totalvalid > 0 }{($totalinvalid / $totalvalid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
<td class="right">{if $usertotalshares > 0 && $totalvalid > 0}{(( 100 / $usertotalshares) * $totalvalid)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
<td class="right">{$pplnsshares|number_format}</td>
|
||||
<td class="right">{$pplnsvalid|number_format}</td>
|
||||
<td class="right">{$pplnsinvalid|number_format}</td>
|
||||
<td class="right">{if $pplnsinvalid > 0 && $pplnsvalid > 0 }{($pplnsinvalid / $pplnsvalid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
<td class="right">{if $userpplnsshares > 0 && $pplnsvalid > 0}{(( 100 / $userpplnsshares) * $pplnsvalid)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
<td class="right">{if $totalvalid > 0 && $pplnsvalid > 0}{math assign="percentage2" equation=(100 / ((( 100 / $usertotalshares) * $totalvalid) / (( 100 / $userpplnsshares) * $pplnsvalid)))}{else if $pplnsvalid == 0}{assign var=percentage2 value=0}{else}{assign var=percentage2 value=100}{/if}
|
||||
<font color="{if ($percentage2 >= 100)}green{else}red{/if}">{$percentage2|number_format:"2"|default:"0"}</font></b></td>
|
||||
<td class="right">{$amount|default:"0"|number_format:"8"}</td>
|
||||
{assign var=percentage2 value=0}
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{include file="global/block_footer.tpl"}
|
||||
@ -21,6 +21,7 @@
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=admin&action=transactions">Transactions</a></li>
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=admin&action=settings">Settings</a></li>
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=admin&action=news">News</a></li>
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=admin&action=reports">Reports</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{/if}
|
||||
|
||||
2
public/templates/mpos/admin/reports/default.tpl
Normal file
2
public/templates/mpos/admin/reports/default.tpl
Normal file
@ -0,0 +1,2 @@
|
||||
{include file="admin/reports/earnings_control.tpl"}
|
||||
{include file="admin/reports/earnings_report.tpl"}
|
||||
55
public/templates/mpos/admin/reports/earnings_control.tpl
Normal file
55
public/templates/mpos/admin/reports/earnings_control.tpl
Normal file
@ -0,0 +1,55 @@
|
||||
<form action="{$smarty.server.PHP_SELF}" method="post">
|
||||
<input type="hidden" name="page" value="{$smarty.request.page|escape}">
|
||||
<input type="hidden" name="action" value="{$smarty.request.action|escape}">
|
||||
<article class="module width_full">
|
||||
<header><h3>Earnings Information</h3></header>
|
||||
<table class="tablesorter">
|
||||
<tbody>
|
||||
<td align="left">
|
||||
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={if is_array($REPORTDATA) && count($REPORTDATA) > ($BLOCKLIMIT - 1)}{$REPORTDATA[$BLOCKLIMIT - 1].height}{/if}&prev=1&limit={$BLOCKLIMIT}&id={$USERID}&filter={$FILTER}"<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={if is_array($REPORTDATA) && count($REPORTDATA) > 0}{$REPORTDATA[0].height}{/if}&next=1&limit={$BLOCKLIMIT}&id={$USERID}&filter={$FILTER}"><i class="icon-right-open"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="tablesorter">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<fieldset style="width:200px; padding-right:8px;">
|
||||
<label>Select User</label>
|
||||
{html_options name="id" options=$USERLIST selected=$USERID|default:"0"}
|
||||
</fieldset>
|
||||
</td>
|
||||
<td>
|
||||
<fieldset style="width:200px; padding-right:8px;">
|
||||
<label>Block Limit</label>
|
||||
<input size="10" type="text" name="limit" value="{$BLOCKLIMIT|default:"20"}" />
|
||||
</fieldset>
|
||||
</td>
|
||||
<td>
|
||||
<fieldset style="width:200px; padding-right:8px;">
|
||||
<label>Starting block height</label>
|
||||
<input type="text" class="pin" name="search" value="{$HEIGHT|default:"%"}">
|
||||
</fieldset>
|
||||
</td>
|
||||
<td align="center"><b>SHOW EMPTY ROUNDS</b><br><br>
|
||||
<span class="toggle">
|
||||
<label for="Show empty rounds">
|
||||
<input type="checkbox" class="ios-switch" name="filter" value="1" id="filter" {if $FILTER}checked{/if} />
|
||||
<div class="switch"></div>
|
||||
</label>
|
||||
</span>
|
||||
</td>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<footer>
|
||||
<div class="submit_link">
|
||||
<input type="submit" value="Submit" class="alt_btn">
|
||||
</div>
|
||||
</footer>
|
||||
</article>
|
||||
</form>
|
||||
88
public/templates/mpos/admin/reports/earnings_report.tpl
Normal file
88
public/templates/mpos/admin/reports/earnings_report.tpl
Normal file
@ -0,0 +1,88 @@
|
||||
<article class="module width_full">
|
||||
<header><h3>Earnings Report Last {$BLOCKLIMIT} Blocks For User: {$USERNAME}</h3></header>
|
||||
<table class="tablesorter" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th >Block</th>
|
||||
<th align="right">Round Shares</th>
|
||||
<th align="right">Round Valid</th>
|
||||
<th align="right">Invalid</th>
|
||||
<th align="right">Invalid %</th>
|
||||
<th align="right">Round %</th>
|
||||
<th align="right">PPLNS Shares</th>
|
||||
<th align="right">PPLNS Valid</th>
|
||||
<th align="right">Invalid</th>
|
||||
<th align="right">Invalid %</th>
|
||||
<th align="right">PPLNS %</th>
|
||||
<th align="right">Variance</th>
|
||||
<th align="right" style="padding-right: 25px;">Amount</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{assign var=percentage value=0}
|
||||
{assign var=percentage1 value=0}
|
||||
{assign var=percentage2 value=0}
|
||||
{assign var=totalvalid value=0}
|
||||
{assign var=totalinvalid value=0}
|
||||
{assign var=totalshares value=0}
|
||||
{assign var=usertotalshares value=0}
|
||||
{assign var=totalpercentage value=0}
|
||||
{assign var=pplnsshares value=0}
|
||||
{assign var=userpplnsshares value=0}
|
||||
{assign var=pplnsvalid value=0}
|
||||
{assign var=pplnsinvalid value=0}
|
||||
{assign var=amount value=0}
|
||||
{section txs $REPORTDATA}
|
||||
{assign var="totalshares" value=$totalshares+$REPORTDATA[txs].shares}
|
||||
{assign var=totalvalid value=$totalvalid+$REPORTDATA[txs]['user'].valid}
|
||||
{assign var=totalinvalid value=$totalinvalid+$REPORTDATA[txs]['user'].invalid}
|
||||
{assign var="pplnsshares" value=$pplnsshares+$REPORTDATA[txs].pplns_shares}
|
||||
{assign var=pplnsvalid value=$pplnsvalid+$REPORTDATA[txs]['user'].pplns_valid}
|
||||
{assign var=pplnsinvalid value=$pplnsinvalid+$REPORTDATA[txs]['user'].pplns_invalid}
|
||||
{assign var=amount value=$amount+$REPORTDATA[txs].user_credit}
|
||||
{if $REPORTDATA[txs]['user'].pplns_valid > 0}
|
||||
{assign var="userpplnsshares" value=$userpplnsshares+$REPORTDATA[txs].pplns_shares}
|
||||
{/if}
|
||||
{if $REPORTDATA[txs]['user'].valid > 0}
|
||||
{assign var="usertotalshares" value=$usertotalshares+$REPORTDATA[txs].shares}
|
||||
{/if}
|
||||
<tr>
|
||||
<td><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round&height={$REPORTDATA[txs].height}">{$REPORTDATA[txs].height|default:"0"}</a></td>
|
||||
<td align="right">{$REPORTDATA[txs].shares|default:"0"}</td>
|
||||
<td align="right">{$REPORTDATA[txs]['user'].valid|number_format|default:"0"}</td>
|
||||
<td align="right">{$REPORTDATA[txs]['user'].invalid|number_format|default:"0"}</td>
|
||||
<td align="right">{if $REPORTDATA[txs]['user'].invalid > 0 }{($REPORTDATA[txs]['user'].invalid / $REPORTDATA[txs]['user'].valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
<td align="right">{if $REPORTDATA[txs]['user'].valid > 0 }{(( 100 / $REPORTDATA[txs].shares) * $REPORTDATA[txs]['user'].valid)|number_format:"2"}{else}0.00{/if}</td>
|
||||
<td align="right">{$REPORTDATA[txs].pplns_shares|number_format|default:"0"}</td>
|
||||
<td align="right">{$REPORTDATA[txs]['user'].pplns_valid|number_format|default:"0"}</td>
|
||||
<td align="right">{$REPORTDATA[txs]['user'].pplns_invalid|number_format|default:"0"}</td>
|
||||
<td align="right">{if $REPORTDATA[txs]['user'].pplns_invalid > 0 && $REPORTDATA[txs]['user'].pplns_valid > 0 }{($REPORTDATA[txs]['user'].pplns_invalid / $REPORTDATA[txs]['user'].pplns_valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
<td align="right">{if $REPORTDATA[txs].shares > 0 && $REPORTDATA[txs]['user'].pplns_valid > 0}{(( 100 / $REPORTDATA[txs].pplns_shares) * $REPORTDATA[txs]['user'].pplns_valid)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
<td align="right">{if $REPORTDATA[txs]['user'].valid > 0 && $REPORTDATA[txs]['user'].pplns_valid > 0}{math assign="percentage1" equation=(100 / ((( 100 / $REPORTDATA[txs].shares) * $REPORTDATA[txs]['user'].valid) / (( 100 / $REPORTDATA[txs].pplns_shares) * $REPORTDATA[txs]['user'].pplns_valid)))}{else if $REPORTDATA[txs]['user'].pplns_valid == 0}{assign var=percentage1 value=0}{else}{assign var=percentage1 value=100}{/if}
|
||||
<font color="{if ($percentage1 >= 100)}green{else}red{/if}">{$percentage1|number_format:"2"|default:"0"}</font></b></td>
|
||||
<td align="right" style="padding-right: 25px;">{$REPORTDATA[txs].user_credit|default:"0"|number_format:"8"}</td>
|
||||
{assign var=percentage1 value=0}
|
||||
</tr>
|
||||
{/section}
|
||||
<tr>
|
||||
<td><b>Totals</b></td>
|
||||
<td align="right">{$totalshares|number_format}</td>
|
||||
<td align="right">{$totalvalid|number_format}</td>
|
||||
<td align="right">{$totalinvalid|number_format}</td>
|
||||
<td align="right">{if $totalinvalid > 0 && $totalvalid > 0 }{($totalinvalid / $totalvalid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
<td align="right">{if $usertotalshares > 0 && $totalvalid > 0}{(( 100 / $usertotalshares) * $totalvalid)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
<td align="right">{$pplnsshares|number_format}</td>
|
||||
<td align="right">{$pplnsvalid|number_format}</td>
|
||||
<td align="right">{$pplnsinvalid|number_format}</td>
|
||||
<td align="right">{if $pplnsinvalid > 0 && $pplnsvalid > 0 }{($pplnsinvalid / $pplnsvalid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
<td align="right">{if $userpplnsshares > 0 && $pplnsvalid > 0}{(( 100 / $userpplnsshares) * $pplnsvalid)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
|
||||
<td align="right">{if $totalvalid > 0 && $pplnsvalid > 0}{math assign="percentage2" equation=(100 / ((( 100 / $usertotalshares) * $totalvalid) / (( 100 / $userpplnsshares) * $pplnsvalid)))}{else if $pplnsvalid == 0}{assign var=percentage2 value=0}{else}{assign var=percentage2 value=100}{/if}
|
||||
<font color="{if ($percentage2 >= 100)}green{else}red{/if}">{$percentage2|number_format:"2"|default:"0"}</font></b></td>
|
||||
<td align="right" style="padding-right: 25px;">{$amount|default:"0"|number_format:"8"}</td>
|
||||
{assign var=percentage2 value=0}
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<footer>
|
||||
</footer>
|
||||
</article>
|
||||
@ -22,6 +22,7 @@
|
||||
<li class="icon-exchange"><a href="{$smarty.server.PHP_SELF}?page=admin&action=transactions">Transactions</a></li>
|
||||
<li class="icon-cog"><a href="{$smarty.server.PHP_SELF}?page=admin&action=settings">Settings</a></li>
|
||||
<li class="icon-doc"><a href="{$smarty.server.PHP_SELF}?page=admin&action=news">News</a></li>
|
||||
<li class="icon-chart"><a href="{$smarty.server.PHP_SELF}?page=admin&action=reports">Reports</a></li>
|
||||
</ul>
|
||||
{/if}
|
||||
{if $smarty.session.AUTHENTICATED|default}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user