$percent = $block ? mbitcoinvaluetoa($earning->amount * 100 / $block->amount) : ''; $algo = $block ? $block->algo : ''; echo "<tr class='ssrow'>"; echo "<td width=18><img width=16 src='/images/btc.png'></td>"; echo "<td><b>Rental</b><span style='font-size: .8em'> ({$algo})</span></td>"; echo "<td align=right style='font-size: .8em'><b>{$reward} BTC</b></td>"; echo "<td align=right style='font-size: .8em'>{$percent}%</td>"; echo "<td align=right style='font-size: .8em'>{$value}</td>"; echo "<td align=right style='font-size: .8em'>{$d} ago</td>"; echo "<td align=right style='font-size: .8em'>Cleared</td>"; echo "</tr>"; continue; } $reward = altcoinvaluetoa($earning->amount); $percent = mbitcoinvaluetoa($earning->amount * 100 / $block->amount); $value = altcoinvaluetoa($earning->amount * $earning->price * 1000); echo "<tr class='ssrow'>"; echo "<td width=18><img width=16 src='{$coin->image}'></td>"; echo "<td><b>{$coin->name}</b><span style='font-size: .8em'> ({$coin->algo})</span></td>"; echo "<td align=right style='font-size: .8em'><b>{$reward} {$coin->symbol_show}</b></td>"; echo "<td align=right style='font-size: .8em'>{$percent}%</td>"; echo "<td align=right style='font-size: .8em'>{$value}</td>"; echo "<td align=right style='font-size: .8em'>{$d} ago</td>"; echo "<td align=right style='font-size: .8em'>"; if ($earning->status == 0) { echo "Immature ({$block->confirmations})"; } else { if ($earning->status == 1) { echo 'Exchange'; } else { if ($earning->status == 2) {
} else { // sort by value foreach ($list as $item) { $coin = getdbo('db_coins', $item['coinid']); if (!$coin) { continue; } $name = substr($coin->name, 0, 12); $confirmed = controller()->memcache->get_database_scalar("wallet_confirmed-{$user->id}-{$coin->id}", "select sum(amount) from earnings where status=1 and userid={$user->id} and coinid={$coin->id}"); $unconfirmed = controller()->memcache->get_database_scalar("wallet_unconfirmed-{$user->id}-{$coin->id}", "select sum(amount) from earnings where status=0 and userid={$user->id} and coinid={$coin->id}"); $total = $confirmed + $unconfirmed; // $value = bitcoinvaluetoa($total * $coin->price / $refcoin->price); $value = bitcoinvaluetoa(yaamp_convert_amount_user($coin, $total, $user)); $confirmed = altcoinvaluetoa($confirmed); $unconfirmed = altcoinvaluetoa($unconfirmed); $total = altcoinvaluetoa($total); echo "<tr class='ssrow'>"; echo "<td width=18><img width=16 src='{$coin->image}'></td>"; echo "<td><b><a href='/site/block?id={$coin->id}' title='{$coin->version}'>{$name}</a></b><span style='font-size: .8em'> ({$coin->algo})</span></td>"; echo "<td align=right style='font-size: .8em;'>{$unconfirmed}</td>"; echo "<td align=right style='font-size: .8em;'>{$confirmed}</td>"; echo "<td align=right style='font-size: .8em;'>{$total}</td>"; echo "<td align=right style='font-size: .8em;'>{$value} {$refcoin->symbol}</td>"; echo "</tr>"; } } $d1 = microtime(true) - $t1; controller()->memcache->add_monitoring_function('wallet_results-1', $d1); } ////////////////////////////////////////////////////////////////////////////// // $confirmed = bitcoinvaluetoa(controller()->memcache->get_database_scalar("wallet_confirmed-$user->id",
<?php $coin = getdbo('db_coins', $_GET['id']); $remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport); $reserved1 = dboscalar("select sum(balance) from accounts where coinid={$coin->id}"); $reserved2 = dboscalar("select sum(amount*price) from earnings\n\twhere status!=2 and userid in (select id from accounts where coinid={$coin->id})"); $reserved = ($reserved1 + $reserved2) * 2; $owed = dboscalar("select sum(amount) from earnings where status!=2 and coinid={$coin->id}"); $owed_btc = $owed ? bitcoinvaluetoa($owed * $coin->price) : ''; $owed = $owed ? altcoinvaluetoa($owed) : ''; echo "cleared {$reserved1}, earnings {$reserved2}, reserved {$reserved}, balance {$coin->balance}, owed {$owed}, owned btc {$owed_btc}<br><br>"; ////////////////////////////////////////////////////////////////////////////////////// $list = getdbolist('db_markets', "coinid={$coin->id} order by price desc"); echo "<table class='dataGrid'>"; echo "<thead class=''>"; echo "<tr>"; echo "<th>Name</th>"; echo "<th>Price</th>"; echo "<th>Price2</th>"; echo "<th>Sent</th>"; echo "<th>Traded</th>"; echo "<th>Late</th>"; echo "<th>Deposit</th>"; echo "<th>Message</th>"; echo "</tr>"; echo "</thead><tbody>"; $bestmarket = getBestMarket($coin); foreach ($list as $market) { $price = bitcoinvaluetoa($market->price); $price2 = bitcoinvaluetoa($market->price2); $lowsymbol = strtolower($coin->symbol);