Gazelle/sections/tools/data/bitcoin_balance.php

47 lines
1.0 KiB
PHP
Raw Normal View History

<?
2013-04-05 08:00:43 +00:00
if (!check_perms('admin_donor_log')) {
error(403);
}
2012-10-11 08:00:15 +00:00
View::show_header('Bitcoin donation balance');
2013-08-28 23:08:41 +00:00
$Balance = DonationsBitcoin::get_balance() . ' BTC';
$BitcoinAddresses = DonationsBitcoin::get_received();
2013-08-15 08:00:52 +00:00
$Debug->log_var($BitcoinAddresses, 'Bitcoin addresses');
2013-08-28 23:08:41 +00:00
$UserQ = $DB->query("
2013-07-04 08:00:56 +00:00
SELECT i.UserID, i.BitcoinAddress
FROM users_info AS i
JOIN users_main AS m ON m.ID = i.UserID
2013-08-28 23:08:41 +00:00
WHERE BitcoinAddress != ''
2013-07-04 08:00:56 +00:00
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>
<?
2013-08-15 08:00:52 +00:00
while (list($UserID, $BitcoinAddress) = $DB->next_record(MYSQLI_NUM, false)) {
if (!$BitcoinAddresses[$BitcoinAddress]) {
2013-04-05 08:00:43 +00:00
continue;
}
2013-08-15 08:00:52 +00:00
?>
<tr>
2013-08-15 08:00:52 +00:00
<td><?=Users::format_username($UserID, true, false, false, false)?></td>
<td><tt><?=$BitcoinAddress?></tt></td>
<td><?=$BitcoinAddresses[$BitcoinAddress]?> BTC</td>
</tr>
2013-07-04 08:00:56 +00:00
<?
2013-08-28 23:08:41 +00:00
$DB->set_query_id($UserQ);
}
?>
</table>
</div>
2012-10-11 08:00:15 +00:00
<? View::show_footer(); ?>