Gazelle/sections/tools/finances/bitcoin_balance.php

57 lines
1.2 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';
?>
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>
2013-11-23 08:01:14 +00:00
<?
if (empty($_GET['list'])) {
?>
<a href="?action=<?=$_GET['action']?>&amp;list=1" class="brackets">Show donor list</a>
<?
} else {
$BitcoinAddresses = DonationsBitcoin::get_received();
$DB->query("
SELECT i.UserID, i.BitcoinAddress
FROM users_info AS i
JOIN users_main AS m ON m.ID = i.UserID
WHERE BitcoinAddress != ''
ORDER BY m.Username ASC");
?>
<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-11-23 08:01:14 +00:00
while (list($UserID, $BitcoinAddress) = $DB->next_record(MYSQLI_NUM, false)) {
if (!isset($BitcoinAddresses[$BitcoinAddress])) {
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-11-23 08:01:14 +00:00
}
?>
</table>
2013-11-23 08:01:14 +00:00
<?
}
?>
</div>
2012-10-11 08:00:15 +00:00
<? View::show_footer(); ?>