Gazelle/sections/tools/finances/bitcoin_balance.php

50 lines
1.1 KiB
PHP
Raw Normal View History

<?
2013-04-05 08:00:43 +00:00
if (!check_perms('admin_donor_log')) {
error(403);
}
2013-10-01 23:08:42 +00:00
$Title = "Bitcoin Donation Balance";
View::show_header($Title);
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");
?>
2013-10-01 23:08:42 +00:00
<div class="header">
<h2><?=$Title?></h2>
</div>
<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-10-01 23:08:42 +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)) {
2013-09-08 08:00:57 +00:00
if (!isset($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(); ?>