Gazelle/sections/tools/data/bitcoin_balance.php

44 lines
1018 B
PHP
Raw Normal View History

<?
if(!check_perms('admin_donor_log')) { error(403); }
include(SERVER_ROOT.'/sections/donate/config.php');
2012-10-11 08:00:15 +00:00
View::show_header('Bitcoin donation balance');
$Balance = btc_balance() . " BTC";
$Receiveds = btc_received();
2012-07-10 08:00:12 +00:00
$DB->query("SELECT i.UserID, i.BitcoinAddress FROM users_info AS i JOIN users_main AS m ON m.ID = i.UserID
WHERE BitcoinAddress IS NOT NULL ORDER BY m.Username ASC");
?>
<div class="thin">
2012-08-19 08:00:19 +00:00
<div class="header">
<h3><?=$Balance?></h3>
</div>
<table>
2012-09-01 08:00:24 +00:00
<tr class="colhead">
<th>Username</th>
2013-02-15 08:00:35 +00:00
<th>Receiving Bitcoin address</th>
<th>Amount</th>
</tr>
<?
while ($row = $DB->next_record()) {
$amount = false;
foreach ($Receiveds as $R) {
if ($R->address == $row['BitcoinAddress']) {
$amount = $R->amount . ' BTC';
}
}
if ($amount === false) { continue; }
?>
<tr>
2012-10-11 08:00:15 +00:00
<td><?=Users::format_username($row['UserID'], true, false, false, false)?></td>
<td><tt><?=$row['BitcoinAddress']?></tt></td>
<td><?=$amount?></td>
</tr>
<?
}
?>
</table>
</div>
2012-10-11 08:00:15 +00:00
<? View::show_footer(); ?>