255) $grn = 255; if ($grn > 190) $fg = 'blue'; else $fg = 'white'; $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 = 'white'; $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; $cdfv = 1 - exp(-1 * $diffacc / $netdiff); $cdf = number_format($cdfv, 2); } else { $bg = ''; $bpct = '?'; $cdf = '?'; } if ($wantcsv === false) { $pg .= ""; $pg .= "$hifld"; if ($user !== null) $pg .= "".htmlspecialchars($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 .= "$cdf"; $pg .= "\n"; } else { $csv .= "$hi,"; $csv .= "\"$stat\","; $csv .= $ans['firstcreatedate:'.$i].','; $csv .= "$diffacc,"; $csv .= "$netdiff\n"; } } } if ($wantcsv === true) { echo $csv; exit(0); } 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 .= 'Total:'; $pg .= ''; $pg .= "\n"; if ($orph === true) { $pg .= '