echo "<th align=left>Algo</th>";
    echo "<th align=right>Diff</th>";
    echo "<th align=right title='extranonce.subscribe'>ES**</th>";
    echo "<th align=right width=80>Hashrate*</th>";
    echo "<th align=right width=60>Reject*</th>";
    echo "</tr>";
    echo "</thead>";
    foreach ($workers as $worker) {
        $user_rate1 = yaamp_worker_rate($worker->id, $worker->algo);
        $user_rate1_bad = yaamp_worker_rate_bad($worker->id, $worker->algo);
        $percent = $user_rate1 + $user_rate1_bad ? $user_rate1_bad * 100 / ($user_rate1 + $user_rate1_bad) : 0;
        $percent = $percent ? round($percent, 1) . '%' : '';
        $user_rate1 = $user_rate1 ? Itoa2($user_rate1) . 'h/s' : '';
        $version = substr($worker->version, 0, 16);
        $password = substr($worker->password, 0, 16);
        $subscribe = Booltoa($worker->subscribe);
        echo "<tr class='ssrow'>";
        echo "<td title='{$worker->version}'>{$version}</td>";
        echo "<td title='{$worker->password}'>{$password}</td>";
        echo "<td>{$worker->algo}</td>";
        echo "<td align=right>{$worker->difficulty}</td>";
        echo "<td align=right>{$subscribe}</td>";
        echo "<td align=right>{$user_rate1}</td>";
        echo "<td align=right>{$percent}</td>";
        echo "</tr>";
    }
    echo "</table>";
}
echo "</div>";
echo "<p style='font-size: .8em'>\r\n\t\t&nbsp;* approximate from the last 5 minutes submitted shares<br>\r\n\t\t&nbsp;** extranonce.subscribe<br>\r\n\t\t</p>";
echo "</div><br>";
//echo "<table class='dataGrid'>";
showTableSorter('maintable');
echo "<thead>";
echo "<tr>";
echo "<th>ID</th>";
echo "<th>User</th>";
echo "<th>Host</th>";
echo "<th>Db</th>";
echo "<th>Idle</th>";
echo "<th>Created</th>";
echo "<th>Last</th>";
echo "<th></th>";
echo "</tr>";
echo "</thead><tbody>";
foreach ($list as $conn) {
    echo "<tr class='ssrow'>";
    $d1 = sectoa($conn->idle);
    $d2 = datetoa2($conn->created);
    $d3 = datetoa2($conn->last);
    $b = Booltoa($conn->last == $last);
    echo "<td>{$conn->id}</td>";
    echo "<td>{$conn->user}</td>";
    echo "<td>{$conn->host}</td>";
    echo "<td>{$conn->db}</td>";
    echo "<td>{$d1}</td>";
    echo "<td>{$d2}</td>";
    echo "<td>{$d3}</td>";
    echo "<td>{$b}</td>";
    echo "</tr>";
}
echo "</tbody></table><br>";
Example #3
0
 $rent = $rent ? mbitcoinvaluetoa($rent) : '-';
 $norm = mbitcoinvaluetoa($norm);
 $t = time() - 24 * 60 * 60;
 $avgprice = dboscalar("select avg(price) from hashrate where algo=:algo and time>{$t}", array(':algo' => $algo));
 $avgprice = $avgprice ? mbitcoinvaluetoa(take_yaamp_fee($avgprice, $algo)) : '-';
 $t1 = time() - 24 * 60 * 60;
 $total1 = dboscalar("select sum(amount*price) from blocks where category!='orphan' and time>{$t1} and algo=:algo", array(':algo' => $algo));
 $hashrate1 = dboscalar("select avg(hashrate) from hashrate where time>{$t1} and algo=:algo", array(':algo' => $algo));
 if ($algo == 'sha256') {
     $btcmhday1 = $hashrate1 != 0 ? mbitcoinvaluetoa($total1 / $hashrate1 * 1000000 * 1000000) : '';
 } else {
     $btcmhday1 = $hashrate1 != 0 ? mbitcoinvaluetoa($total1 / $hashrate1 * 1000000 * 1000) : '';
 }
 $fees = yaamp_fee($algo);
 $stratum = getdbosql('db_stratums', "algo=:algo", array(':algo' => $algo));
 $isup = Booltoa($stratum);
 echo "<tr class='ssrow'>";
 echo "<td style='background-color: {$algo_color}'><b><a href='/site/gomining?algo={$algo}'>{$algo}</a></b></td>";
 echo "<td align=right'>{$isup}</td>";
 echo "<td align=right style='font-size: .8em;'>{$coins}</td>";
 echo "<td align=right style='font-size: .8em;'>{$count}</td>";
 echo "<td align=right style='font-size: .8em;'>{$fees}%</td>";
 echo "<td align=right style='font-size: .8em;'>{$hashrate}</td>";
 echo "<td align=right style='font-size: .8em;'>{$hashrate_jobs}</td>";
 if ($bad > 10) {
     echo "<td align=right style='font-size: .8em; color: white; background-color: #d9534f'>{$bad}%</td>";
 } else {
     if ($bad > 5) {
         echo "<td align=right style='font-size: .8em; color: white; background-color: #f0ad4e'>{$bad}%</td>";
     } else {
         echo "<td align=right style='font-size: .8em;'>{$bad}%</td>";