Advertisement
Guest User

Untitled

a guest
Jul 27th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. <?php
  2. require_once("config.php");
  3. $ip = $_SERVER["REMOTE_ADDR"];
  4. // pegar valores [money e profit]
  5. $pegar_valor = $conexao->prepare("SELECT * FROM usuarios WHERE ip=$ip");
  6. $pegar_valor->bindValue('$ip', $ip);
  7. $pegar_valor->execute();
  8. $linha = $pegar_valor->fetch();
  9. /* função dos miners */
  10. // pegar valores [miners]
  11. $pegar_m = $conexao->prepare("SELECT * FROM miner_shop WHERE ip=$ip");
  12. $pegar_m->bindValue('$ip', $ip);
  13. $pegar_m->execute();
  14. $linha_m = $pegar_m->fetch();
  15. // fazer cliques dos referidos quando servidor resetar
  16. $server_reset = date("H:i:s");
  17. // comparar datas de expiração
  18. $date_compa = date("d/m/Y");
  19. if($date_compa != $linha_m["date_expire"]){
  20. function miners($clicks, $val_click, $conn){
  21. $mi_clicks = $linha_m["miners"] * $clicks;
  22. $mi_profit = $mi_clicks * $val_click;
  23. $saldo_miner = $linha_m["miners_earned"];
  24. $soma_miner = $mi_profit + $saldo_miner;
  25. // mudar e acrescentar lucros
  26. $select_min = $conn->prepare("update miner_shop set miners_earned=:miners_p,date=:date WHERE ip=$ip");
  27. $select_min->bindValue(":miners_p", protect($soma_miner));
  28. $select_min->bindValue(":date", protect($date_compa));
  29. $select_min->bindValue("$ip", protect($ip));
  30. $select_min->execute();
  31. // adicionar no saldo da conta
  32. $saldo_da_conta = $linha["money"];
  33. $soma_saldo = $saldo_da_conta + $mi_profit;
  34. $select_min2 = $conn->prepare("update usuarios set money=:money WHERE ip=$ip");
  35. $select_min2->bindValue(":money", protect($soma_saldo));
  36. $select_min2->execute();
  37. }
  38. switch($linha["acctype"]){
  39. case "Standard":
  40. echo miners(4, 0.002, $conexao);
  41. break;
  42. case "Golden":
  43. echo miners(4, 0.0025, $conexao);
  44. break;
  45. case "Ultimate":
  46. echo miners(4, 0.003, $conexao);
  47. break;
  48. }
  49. } else if($date_compa == $linha_m["date_expire"]){
  50. $select_min = $conexao->prepare("update miner_shop set miners=:miners,date=:date, date_expire=:expire WHERE ip=$ip");
  51. $select_min->bindValue(":miners", protect(0));
  52. $select_min->bindValue(":date", protect(0));
  53. $select_min->bindValue(":expire", protect(0));
  54. $select_min->execute();
  55. }
  56. /* fim da funçao miner */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement