Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div style="width:550px; height:28px; overflow:off; border:0px solid #840; box-shadow:1px 1px 6px #292929;">
- <form action="<?php $_PHP_SELF ?>" method="POST">
- Worker: <input type="text" name='worker' value="<?php echo $_POST['worker']; ?>"/>
- <input type="submit" />
- </form>
- </div><br>
- <div style="width:550px; height:90px; overflow:auto; border:0px solid #840; box-shadow:1px 1px 6px #292929;">
- <?php
- $uaddress=$_POST['worker'];
- $state = json_decode(file_get_contents ("http://stratum.teamdoge.com:9191/api/stats"),true);
- $wrk=$state['pools']["dogecoin"]["workers"];
- $poolhash=intval(($state['algos']['scrypt']['hashrate'])/100000);
- $ha=0;
- if ($wrk[$uaddress]!=null ){
- //Sum up all shares
- foreach($wrk as $wrk1){ $ha=$ha+intval($wrk1['shares']/5); }
- //get users shares and calculate percent
- $shares=intval($wrk[$uaddress]['shares']/5);
- $spercent=(round(($shares/$ha),6)*100);
- //calulate hashrate for the address
- $workerkhash = intval($spercent*($poolhash));
- //calculate Payout based on the last 5 minutes (full round)
- $pppayout=(round(625*$spercent,0));
- //
- echo "Worker: $uaddress<br> \n"
- ."Percent: $spercent % <br> \n"
- ."Est.payout: $pppayout Doge(full round )<br> \n "
- ."Speed: $workerkhash kh/s.<br>\n";
- }
- 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";
- ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement