Advertisement
Guest User

Untitled

a guest
Aug 21st, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. <div style="width:550px; height:28px; overflow:off; border:0px solid #840; box-shadow:1px 1px 6px #292929;">
  2.  
  3. <form action="<?php $_PHP_SELF ?>" method="POST">
  4. Worker: <input type="text" name='worker' value="<?php echo $_POST['worker']; ?>"/>
  5. <input type="submit" />
  6. </form>
  7. </div><br>
  8. <div style="width:550px; height:90px; overflow:auto; border:0px solid #840; box-shadow:1px 1px 6px #292929;">
  9. <?php
  10. $uaddress=$_POST['worker'];
  11. $state = json_decode(file_get_contents ("http://stratum.teamdoge.com:9191/api/stats"),true);
  12. $wrk=$state['pools']["dogecoin"]["workers"];
  13. $poolhash=intval(($state['algos']['scrypt']['hashrate'])/100000);
  14. $ha=0;
  15. if ($wrk[$uaddress]!=null ){
  16. //Sum up all shares
  17. foreach($wrk as $wrk1){ $ha=$ha+intval($wrk1['shares']/5); }
  18. //get users shares and calculate percent
  19. $shares=intval($wrk[$uaddress]['shares']/5);
  20. $spercent=(round(($shares/$ha),6)*100);
  21. //calulate hashrate for the address
  22. $workerkhash = intval($spercent*($poolhash));
  23. //calculate Payout based on the last 5 minutes (full round)
  24. $pppayout=(round(625*$spercent,0));
  25. //
  26. echo "Worker: $uaddress<br> \n"
  27. ."Percent: $spercent % <br> \n"
  28. ."Est.payout: $pppayout Doge(full round )<br> \n "
  29. ."Speed: $workerkhash kh/s.<br>\n";
  30. }
  31. else if ($uaddress!="") echo "Sorry , i cant find your Worker ( $uaddress ) in the Database. <br>\n Make sure your worker name is a valid Dogecoin address.\n";
  32. ?>
  33. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement