255) $grn = 255; if ($grn > 190) $fg = '#00f'; else $fg = '#fff'; $bg = sprintf("#00%02x00", $grn); } if ($pct > 100) { $red = (log10(pow($pct,4.0)) - 8.0) / 3.0 * 255; if ($red < 0) $red = 0; if ($red > 255) $red = 255; $fg = '#fff'; $bg = sprintf("#%02x0000", $red); } return array($fg, $bg); } # function doblocks($data, $user) { $blink = ' 0) { $pct = 100.0 * $diffacc / $netdiff; list($fg, $bg) = pctcolour($pct); $bpct = "$starp".number_format($pct, 2).'%'; $bg = " bgcolor=$bg"; $blktot += $diffacc; if ($stat != 'Orphan') $nettot += $netdiff; } else { $bg = ''; $bpct = '?'; } $pg .= ""; $pg .= "$hifld"; $pg .= "".$ans['workername:'.$i].''; $pg .= "".btcfmt($ans['reward:'.$i]).''; $pg .= "".gmdate('Y-m-d H:i:s+00', $ans['firstcreatedate:'.$i]).''; $pg .= "".$stat.''; $pg .= "$stara$acc"; $pg .= "$bpct"; $pg .= "\n"; } } if ($nettot > 0) { if (($i % 2) == 0) $row = 'even'; else $row = 'odd'; $pct = 100.0 * $blktot / $nettot; list($fg, $bg) = pctcolour($pct); $bpct = "".number_format($pct, 2).'%'; $bg = " bgcolor=$bg"; $pg .= ""; $pg .= ""; $pg .= "".$bpct.''; $pg .= "\n"; } $pg .= "\n"; return $pg; } # function show_blocks($page, $menu, $name, $user) { gopage(NULL, 'doblocks', $page, $menu, $name, $user); } # ?>