Browse Source

php - add a Base BTC calc to pplns

master
kanoi 10 years ago
parent
commit
0c2d5aa9d4
  1. 15
      pool/page_pplns.php

15
pool/page_pplns.php

@ -89,10 +89,21 @@ Block: <input type=text name=blk size=10 value=''>
$pg .= '<tr class=title>';
$pg .= '<td class=dl>User</td>';
$pg .= '<td class=dr>Diff Accepted</td>';
$pg .= '<td class=dr>%</td>';
$pg .= '<td class=dr>Base BTC</td>';
$pg .= "</tr>\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: <input type=text name=blk size=10 value=''>
$pg .= "<tr class=$row>";
$pg .= '<td class=dl>'.$ans['user'.$i].'</td>';
$pg .= '<td class=dr>'.$ans['diffacc_user'.$i].'</td>';
$pg .= "<td class=dr>$diffacc_user</td>";
$pg .= "<td class=dr>$diffacc_percent</td>";
$pg .= "<td class=dr>$diffacc_btc</td>";
$pg .= "</tr>\n";
}
$pg .= "</table>\n";

Loading…
Cancel
Save