getState('yaamp-algo'); if($algo == 'all') return; echo "
"; echo "
Pool Stats ($algo)
"; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $t1 = time() - 60*60; $t2 = time() - 24*60*60; $t3 = time() - 7*24*60*60; $t4 = time() - 30*24*60*60; $total1 = 0; $total2 = 0; $total3 = 0; $total4 = 0; $algo = user()->getState('yaamp-algo'); $list = dbolist("SELECT coin_id FROM blocks where category!='orphan' and time>$t4 and coin_id in (select id from coins where algo=:algo) group by coin_id order by id desc", array(':algo'=>$algo)); foreach($list as $item) { $coin = getdbo('db_coins', $item['coin_id']); if($coin->symbol == 'BTC') continue; $res1 = controller()->memcache->get_database_row("history_item1-$coin->id-$algo", "select count(*) as a, sum(amount*price) as b from blocks where category!='orphan' and time>$t1 and coin_id=$coin->id and algo=:algo", array(':algo'=>$algo)); $res2 = controller()->memcache->get_database_row("history_item2-$coin->id-$algo", "select count(*) as a, sum(amount*price) as b from blocks where category!='orphan' and time>$t2 and coin_id=$coin->id and algo=:algo", array(':algo'=>$algo)); $res3 = controller()->memcache->get_database_row("history_item3-$coin->id-$algo", "select count(*) as a, sum(amount*price) as b from blocks where category!='orphan' and time>$t3 and coin_id=$coin->id and algo=:algo", array(':algo'=>$algo)); $res4 = controller()->memcache->get_database_row("history_item4-$coin->id-$algo", "select count(*) as a, sum(amount*price) as b from blocks where category!='orphan' and time>$t4 and coin_id=$coin->id and algo=:algo", array(':algo'=>$algo)); $total1 += $res1['b']; $total2 += $res2['b']; $total3 += $res3['b']; $total4 += $res4['b']; $name = substr($coin->name, 0, 12); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } /////////////////////////////////////////////////////////////////////// $hashrate1 = controller()->memcache->get_database_scalar("history_hashrate1-$algo", "select avg(hashrate) from hashrate where time>$t1 and algo=:algo", array(':algo'=>$algo)); $hashrate2 = controller()->memcache->get_database_scalar("history_hashrate2-$algo", "select avg(hashrate) from hashrate where time>$t2 and algo=:algo", array(':algo'=>$algo)); $hashrate3 = controller()->memcache->get_database_scalar("history_hashrate3-$algo", "select avg(hashrate) from hashrate where time>$t3 and algo=:algo", array(':algo'=>$algo)); $hashrate4 = controller()->memcache->get_database_scalar("history_hashrate4-$algo", "select avg(hashrate) from hashstats where time>$t4 and algo=:algo", array(':algo'=>$algo)); $hashrate1 = max($hashrate1 , 1); $hashrate2 = max($hashrate2 , 1); $hashrate3 = max($hashrate3 , 1); $hashrate4 = max($hashrate4 , 1); $btcmhday1 = mbitcoinvaluetoa($total1 / $hashrate1 * 1000000 * 24 * 1000); $btcmhday2 = mbitcoinvaluetoa($total2 / $hashrate2 * 1000000 * 1 * 1000); $btcmhday3 = mbitcoinvaluetoa($total3 / $hashrate3 * 1000000 / 7 * 1000); $btcmhday4 = mbitcoinvaluetoa($total4 / $hashrate4 * 1000000 / 30 * 1000); $hashrate1 = Itoa2($hashrate1); $hashrate2 = Itoa2($hashrate2); $hashrate3 = Itoa2($hashrate3); $hashrate4 = Itoa2($hashrate4); $total1 = bitcoinvaluetoa($total1); $total2 = bitcoinvaluetoa($total2); $total3 = bitcoinvaluetoa($total3); $total4 = bitcoinvaluetoa($total4); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; /////////////////////////////////////////////////////////////////////// echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; /////////////////////////////////////////////////////////////////////// echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
NameLast HourLast 24 HoursLast 7 DaysLast 30 Days
$name{$res1['a']}{$res2['a']}{$res3['a']}{$res4['a']}
BTC Value$total1$total2$total3$total4
Avg Hashrate{$hashrate1}h/s{$hashrate2}h/s{$hashrate3}h/s{$hashrate4}h/s
mBTC/Mh/d$btcmhday1$btcmhday2$btcmhday3$btcmhday4
"; echo "
"; echo "
"; echo "

";