here to jump to the start of the last payout
";
$pg .= "
\n";
$pg .= "";
$pg .= "Shift | ";
$pg .= "Start UTC | ";
$pg .= "Length | ";
$pg .= "Your Diff | ";
$pg .= "Inv Diff | ";
$pg .= "Avg Hs | ";
$pg .= "Shares | ";
$pg .= "Avg Share | ";
$pg .= "Rewards | ";
$pg .= "Rewarded* | ";
$pg .= "PPS% | ";
$pg .= "
\n";
if (($ans['STATUS'] != 'ok') || !isset($ans['prefix_all']))
$pg = 'Shifts
'.$pg;
else
{
$pre = $ans['prefix_all'];
$count = $ans['rows'];
$pg = 'Last '.($count+1).' Shifts
'.$pg;
for ($i = 0; $i < $count; $i++)
{
$u = '';
$mark = '';
if (isset($ans['lastpayoutstart:'.$i])
&& $ans['lastpayoutstart:'.$i] != '')
{
$u = 'u';
$mark = '';
}
if (($i % 2) == 0)
$row = "even$u";
else
$row = "odd$u";
$pg .= "";
$shifname = $ans['shift:'.$i];
$shif = preg_replace(array('/^.* to /','/^.*fin: /'), '', $shifname);
$ablock = false;
if (preg_match('/to.*Block.* fin/', $shifname) == 1)
$ablock = true;
else
{
$shifex = $ans['endmarkextra:'.$i];
if (preg_match('/Block .* fin/', $shifex) == 1)
$ablock = true;
}
if ($ablock === true)
$btc = ' ';
else
$btc = '';
$pg .= "$shif$btc$mark | ";
$start = $ans['start:'.$i];
$pg .= ''.utcd($start, true).' | ';
$nd = $ans['end:'.$i];
$elapsed = $nd - $start;
$pg .= ''.howmanyhrs($elapsed).' | ';
$diffacc = $ans[$pre.'diffacc:'.$i];
$pg .= ''.difffmt($diffacc).' | ';
$diffinv = $ans[$pre.'diffinv:'.$i];
$pg .= ''.difffmt($diffinv).' | ';
$hr = $diffacc * pow(2,32) / $elapsed;
$pg .= ''.dsprate($hr).' | ';
$shareacc = $ans[$pre.'shareacc:'.$i];
$pg .= ''.difffmt($shareacc).' | ';
if ($shareacc > 0)
$avgsh = $diffacc / $shareacc;
else
$avgsh = 0;
$pg .= ''.number_format($avgsh, 2).' | ';
$pg .= ''.$ans['rewards:'.$i].' | ';
$ppsr = (float)$ans['ppsrewarded:'.$i];
if ($ppsr > 0)
$ppsd = sprintf('%.3e', $ppsr);
else
$ppsd = '0';
$pg .= "$ppsd | ";
$ppsv = (float)$ans['ppsvalue:'.$i];
if ($ppsv > 0)
$pgot = number_format(100.0 * $ppsr / $ppsv, 2).'%';
else
$pgot = '?';
$pg .= "$pgot | ";
$pg .= "
\n";
}
}
$pg .= "
\n";
$pg .= "* The Rewarded value unit is satoshis per 1diff share
";
return $pg;
}
#
function show_shifts($info, $page, $menu, $name, $user)
{
gopage($info, NULL, 'doshifts', $page, $menu, $name, $user);
}
#
?>