\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 .= ""; $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"; $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); } # ?>