From 0c2d5aa9d442f2b146a988edd15747eb3a861688 Mon Sep 17 00:00:00 2001 From: kanoi Date: Thu, 28 Aug 2014 14:32:45 +1000 Subject: [PATCH] php - add a Base BTC calc to pplns --- pool/page_pplns.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pool/page_pplns.php b/pool/page_pplns.php index 4b38074b..d6c98952 100644 --- a/pool/page_pplns.php +++ b/pool/page_pplns.php @@ -89,10 +89,21 @@ Block: $pg .= ''; $pg .= 'User'; $pg .= 'Diff Accepted'; + $pg .= '%'; + $pg .= 'Base BTC'; $pg .= "\n"; + + $diffacc_total = $ans['diffacc_total']; + if ($diffacc_total == 0) + $diffacc_total = pow(10,15); + $reward = 1.0 * $ans['block_reward'] / pow(10,8); $count = $ans['rows']; for ($i = 1; $i <= $count; $i++) { + $diffacc_user = $ans['diffacc_user'.$i]; + $diffacc_percent = number_format(100.0 * $diffacc_user / $diffacc_total, 2).'%'; + $diffacc_btc = number_format($reward * $diffacc_user / $diffacc_total, 8); + if (($i % 2) == 0) $row = 'even'; else @@ -100,7 +111,9 @@ Block: $pg .= ""; $pg .= ''.$ans['user'.$i].''; - $pg .= ''.$ans['diffacc_user'.$i].''; + $pg .= "$diffacc_user"; + $pg .= "$diffacc_percent"; + $pg .= "$diffacc_btc"; $pg .= "\n"; } $pg .= "\n";