Adding wallet information in Admin panel

Fixes #63 and adds proper wallet information:

* Wallet balance
* Locked balance for users
* Liquid assets available to pool owner
This commit is contained in:
Sebastian Grewe 2013-06-04 14:03:46 +02:00
parent f1e0e5cb97
commit 91d225e340
3 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,25 @@
<?php
// Make sure we are called from index.php
if (!defined('SECURITY'))
die('Hacking attempt');
// Check user to ensure they are admin
if (!$user->isAdmin($_SESSION['USERDATA']['id'])) {
header("HTTP/1.1 404 Page not found");
die();
}
if ($bitcoin->can_connect() === true){
$dBalance = $bitcoin->query('getbalance');
} else {
$dBalance = 0;
$_SESSION['POPUP'][] = array('CONTENT' => 'Unable to connect to litecoind RPC service: ' . $bitcoin->can_connect(), 'TYPE' => 'errormsg');
}
$smarty->assign("BALANCE", $dBalance);
$smarty->assign("LOCKED", $transaction->getLockedBalance());
// Tempalte specifics
$smarty->assign("CONTENT", "default.tpl");
?>

View File

@ -0,0 +1,16 @@
{include file="global/block_header.tpl" BLOCK_HEADER="Wallet Information"}
<table width="350px">
<tr>
<th>Wallet Balance</th>
<td class="right">{$BALANCE|number_format:"8"}</td>
</tr>
<tr>
<th>Locked for users</th>
<td class="right">{$LOCKED|number_format:"8"}</td>
</tr>
<tr>
<th>Liquid Assets</th>
<td class="right">{($BALANCE - $LOCKED)|number_format:"8"}</td>
</tr>
</table>
{include file="global/block_footer.tpl"}

View File

@ -14,6 +14,7 @@
<li><a href="{$smarty.server.PHP_SELF}?page=admin">Admin Panel</a>
<ul>
<li><a href="{$smarty.server.PHP_SELF}?page=admin&action=user">User Info</a></li>
<li><a href="{$smarty.server.PHP_SELF}?page=admin&action=wallet">Wallet Info</a></li>
</ul>
</li>
{/if}