Pool Stats';
if (isset($data['info']) && $data['info'] !== false)
{
$info = $data['info'];
$dsp = '?THs';
$dsp5m = '?THs';
$dsp1hr = '?THs';
$dsp24hr = '?THs';
if (isset($info['p_hashrate']))
{
$hr = $info['p_hashrate'];
if ($hr != '?')
$dsp = dsprate($hr);
}
if (isset($info['p_hashrate5m']))
{
$hr = $info['p_hashrate5m'];
if ($hr != '?')
$dsp5m = dsprate($hr);
}
if (isset($info['p_hashrate1hr']))
{
$hr = $info['p_hashrate1hr'];
if ($hr != '?')
$dsp1hr = dsprate($hr);
}
if (isset($info['p_hashrate24hr']))
{
$hr = $info['p_hashrate24hr'];
if ($hr != '?')
$dsp24hr = dsprate($hr);
}
$pg .= '
';
$pg .= "Pool Hashrate: $dsp | ";
$pg .= "5m: $dsp5m | ";
$pg .= "1hr: $dsp1hr | ";
$pg .= "24hr: $dsp24hr | ";
$pg .= '
';
}
$ans = getAllUsers($user);
$pg .= "\n";
$pg .= "";
$pg .= "Username | ";
$pg .= "Hash Rate 5m | ";
$pg .= "
\n";
if ($ans['STATUS'] == 'ok')
{
$all = array();
$count = $ans['rows'];
for ($i = 0; $i < $count; $i++)
{
$all[] = array('username' => $ans['username:'.$i],
'userid' => $ans['userid:'.$i],
'u_hashrate5m' => $ans['u_hashrate5m:'.$i]);
}
usort($all, 'allusersort');
for ($i = 0; $i < $count; $i++)
{
if (($i % 2) == 0)
$row = 'even';
else
$row = 'odd';
$pg .= "";
$pg .= ''.htmlspecialchars($all[$i]['username']).' | ';
$uhr = $all[$i]['u_hashrate5m'];
if ($uhr == '?')
$dsp = '?GHs';
else
$dsp = dsprate($uhr);
$pg .= "$dsp | ";
$pg .= "
\n";
}
}
$pg .= "
\n";
return $pg;
}
#
function show_stats($page, $menu, $name, $user)
{
gopage(NULL, 'dostats', $page, $menu, $name, $user);
}
#
?>