From f170e893afaa7c055adb2b36ab3b9c595d67b2ff Mon Sep 17 00:00:00 2001 From: kanoi Date: Mon, 8 Sep 2014 05:57:08 +1000 Subject: [PATCH] php - add more totals for workers page --- pool/page_workers.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pool/page_workers.php b/pool/page_workers.php index 9bdffd84..84b306d3 100644 --- a/pool/page_workers.php +++ b/pool/page_workers.php @@ -19,6 +19,9 @@ function doworker($data, $user) $pg .= "Invalid"; $pg .= "Hash Rate"; $pg .= "\n"; + $tsh = 0; + $tdif = 0; + $tinv = 0; $thr = 0; $i = 0; if ($ans['STATUS'] == 'ok') @@ -87,7 +90,9 @@ function doworker($data, $user) $pg .= "$lstdes"; $shareacc = number_format($ans['w_shareacc:'.$i], 0); + $tsh += $ans['w_shareacc:'.$i]; $diffacc = number_format($ans['w_diffacc:'.$i], 0); + $tdif += $ans['w_diffacc:'.$i]; $pg .= "$shareacc"; $pg .= "$diffacc"; @@ -96,6 +101,7 @@ function doworker($data, $user) $rej = number_format(100.0 * $ans['w_diffinv:'.$i] / $dtot, 3); else $rej = '0'; + $tinv += $ans['w_diffinv:'.$i]; $pg .= "$rej%"; @@ -138,7 +144,17 @@ function doworker($data, $user) $row = 'even'; else $row = 'odd'; - $pg .= ""; + $pg .= ""; + $shareacc = number_format($tsh, 0); + $pg .= "$shareacc"; + $diffacc = number_format($tdif, 0); + $pg .= "$diffacc"; + $dtot = $tdif + $tinv; + if ($dtot > 0) + $rej = number_format(100.0 * $tinv / $dtot, 3); + else + $rej = '0'; + $pg .= "$rej%"; $pg .= "$thr\n"; $pg .= "\n";