コード例 #1
0
function WriteBoxHeader($title)
{
    echo "<div class='main-left-box'>";
    echo "<div class='main-left-title'>{$title}</div>";
    echo "<div class='main-left-inner'>";
}
$algo = user()->getState('yaamp-algo');
$target = yaamp_hashrate_constant($algo);
$interval = yaamp_hashrate_step();
$delay = time() - $interval;
$total_workers = getdbocount('db_workers', "algo=:algo", array(':algo' => $algo));
$total_extranonce = getdbocount('db_workers', "algo=:algo and subscribe", array(':algo' => $algo));
$total_hashrate = dboscalar("select sum(difficulty) * {$target} / {$interval} / 1000 from shares where valid and time>{$delay} and algo=:algo", array(':algo' => $algo));
$total_invalid = dboscalar("select sum(difficulty) * {$target} / {$interval} / 1000 from shares where not valid and time>{$delay} and algo=:algo", array(':algo' => $algo));
WriteBoxHeader("Miners Version ({$algo})");
//echo "<br><table class='dataGrid2'>";
showTableSorter('maintable2');
echo "<thead>";
echo "<tr>";
echo "<th>Version</th>";
echo "<th align=right>Count</th>";
echo "<th align=right>Extranonce</th>";
echo "<th align=right>Percent</th>";
echo "<th align=right>Hashrate*</th>";
echo "<th align=right>Reject</th>";
echo "</tr>";
echo "</thead><tbody>";
$error_tab = array(20 => 'Invalid nonce size', 21 => 'Invalid job id', 22 => 'Duplicate share', 23 => 'Invalid time rolling', 24 => 'Invalid extranonce2 size', 25 => 'Invalid share', 26 => 'Low difficulty share');
$versions = dbolist("select version, count(*) as c, sum(subscribe) as s from workers where algo=:algo group by version order by c desc", array(':algo' => $algo));
foreach ($versions as $item) {
コード例 #2
0
ファイル: wallet_results.php プロジェクト: zarethernet/yaamp
////////////////////////////////////////////////////////////////////////////
//$delay = 7*24*60*60;
$total_earned = bitcoinvaluetoa($total_unsold + $balance + $total_paid);
//$total_earned_usd = number_format($total_earned*$mining->usdbtc*$refcoin->price, 3, '.', ' ');
echo "<tr class='ssrow' style='border-top: 3px solid #eee;'>";
echo "<td><img width=16 src='{$refcoin->image}'></td>";
echo "<td colspan=3><b>Total Earned</b></td>";
echo "<td align=right style='font-size: .8em;'></td>";
echo "<td align=right style='font-size: .9em;'>{$total_earned} {$refcoin->symbol}</td>";
echo "</tr>";
echo "</table>";
echo "</div>";
$usd = number_format($mining->usdbtc, 2, '.', ' ');
echo "<p style='font-size: .8em'>\r\n\t&nbsp;* approximate from current exchange rates<br>\r\n\t&nbsp;** bitstamp <b>{$usd}</b> USD/BTC\r\n\t</p>";
echo "</div><br>";
WriteBoxHeader("Last 24 Hours Payouts: {$user->username}");
$t = time() - 24 * 60 * 60;
$list = getdbolist('db_payouts', "account_id={$user->id} and time>{$t} order by time desc");
echo "<table  class='dataGrid2'>";
echo "<thead>";
echo "<tr>";
echo "<th align=right>Time</th>";
echo "<th align=right>Amount</th>";
echo "<th>Tx</th>";
echo "</tr>";
echo "</thead>";
$total = 0;
foreach ($list as $payout) {
    $d = datetoa2($payout->time);
    $amount = bitcoinvaluetoa($payout->amount);
    $payout_tx = substr($payout->tx, 0, 36) . '...';
コード例 #3
0
<?php

function WriteBoxHeader($title)
{
    echo "<div class='main-left-box'>";
    echo "<div class='main-left-title'>{$title}</div>";
    echo "<div class='main-left-inner'>";
}
$algo = user()->getState('yaamp-algo');
$user = getuserparam(getparam('address'));
if (!$user || $user->is_locked) {
    return;
}
$count = getparam('count');
$count = $count ? $count : 50;
WriteBoxHeader("Last {$count} Earnings: {$user->username}");
$earnings = getdbolist('db_earnings', "userid={$user->id} order by create_time desc limit :count", array(':count' => $count));
echo "<table class='dataGrid2'>";
echo "<thead>";
echo "<tr>";
echo "<td></td>";
echo "<th>Name</th>";
echo "<th align=right>Amount</th>";
echo "<th align=right>Percent</th>";
echo "<th align=right>mBTC</th>";
echo "<th align=right>Time</th>";
echo "<th align=right>Status</th>";
echo "</tr>";
echo "</thead>";
foreach ($earnings as $earning) {
    $coin = getdbo('db_coins', $earning->coinid);
コード例 #4
0
    $allorders[$index]['speed'] += $order->accepted_speed;
    $allorders[$index]['workers'] += $order->workers;
    $allorders[$index]['btc'] += $order->btc_avail;
    $allorders[$index]['limit'] += $order->limit_speed;
}
$total_nicehash = 0;
foreach ($allorders as $i => $order) {
    $total_nicehash += $order['speed'];
}
function cmp($a, $b)
{
    return $a['price'] < $b['price'];
}
usort($allorders, 'cmp');
///////
WriteBoxHeader("Mining {$count} coins at {$total_rate}h/s * with {$worker} miners ({$algo})");
echo "<table  class='dataGrid2'>";
echo "<thead>";
echo "<tr>";
echo "<th></th>";
echo "<th>Name</th>";
echo "<th align=right>max</th>";
echo "<th align=right>mbtc</th>";
echo "<th align=right>profit</th>";
echo "<th align=right>TTF</th>";
echo "<th align=right>Hash *</th>";
echo "<th align=right>**</th>";
echo "</tr>";
echo "</thead>";
foreach ($list as $coin) {
    $name = substr($coin->name, 0, 12);
コード例 #5
0
<?php

function WriteBoxHeader($title)
{
    echo "<div class='main-left-box'>";
    echo "<div class='main-left-title'>{$title}</div>";
    echo "<div class='main-left-inner'>";
}
$algo = user()->getState('yaamp-algo');
$count = getparam('count');
$count = $count ? $count : 50;
WriteBoxHeader("Last {$count} Blocks ({$algo})");
if ($algo == 'all') {
    $db_blocks = getdbolist('db_blocks', "1 order by time desc limit :count", array(':count' => $count));
} else {
    $db_blocks = getdbolist('db_blocks', "algo=:algo order by time desc limit :count", array(':algo' => $algo, ':count' => $count));
}
echo "<table class='dataGrid2'>";
echo "<thead>";
echo "<tr>";
echo "<td></td>";
echo "<th>Name</th>";
echo "<th align=right>Amount</th>";
echo "<th align=right>Difficulty</th>";
echo "<th align=right>Block</th>";
echo "<th align=right>Time</th>";
echo "<th align=right>Status</th>";
echo "</tr>";
echo "</thead>";
foreach ($db_blocks as $db_block) {
    $d = datetoa2($db_block->time);