\n";
$pg .= "
";
$pg .= "Shift | ";
$pg .= "Start | ";
$pg .= "Length | ";
$pg .= "Your Diff | ";
$pg .= "Avg Hs | ";
$pg .= "Shares | ";
$pg .= "Avg Share | ";
$pg .= "
\n";
if ($ans['STATUS'] != 'ok')
$pg = 'Shifts
'.$pg;
else
{
$count = $ans['rows'];
$pg = 'Last '.($count+1).' Shifts
'.$pg;
for ($i = 0; $i < $count; $i++)
{
if (($i % 2) == 0)
$row = 'even';
else
$row = 'odd';
$pg .= "";
$shif = preg_replace(array('/^.* to /','/^.*fin: /'), '', $ans['shift:'.$i]);
$pg .= "$shif | ";
$start = $ans['start:'.$i];
$pg .= ''.utcd($start).' | ';
$nd = $ans['end:'.$i];
$elapsed = $nd - $start;
$pg .= ''.howmanyhrs($elapsed).' | ';
$diffacc = $ans['diffacc:'.$i];
$pg .= ''.difffmt($diffacc).' | ';
$hr = $diffacc * pow(2,32) / $elapsed;
$pg .= ''.dsprate($hr).' | ';
$shareacc = $ans['shareacc:'.$i];
$pg .= ''.difffmt($shareacc).' | ';
if ($shareacc > 0)
$avgsh = $diffacc / $shareacc;
else
$avgsh = 0;
$pg .= ''.number_format($avgsh, 2).' | ';
$pg .= "
\n";
}
}
$pg .= "\n";
return $pg;
}
#
function show_shifts($info, $page, $menu, $name, $user)
{
gopage($info, NULL, 'doshifts', $page, $menu, $name, $user);
}
#
?>