Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once("config.php");
- $ip = $_SERVER["REMOTE_ADDR"];
- // pegar valores [money e profit]
- $pegar_valor = $conexao->prepare("SELECT * FROM usuarios WHERE ip=$ip");
- $pegar_valor->bindValue('$ip', $ip);
- $pegar_valor->execute();
- $linha = $pegar_valor->fetch();
- /* função dos miners */
- // pegar valores [miners]
- $pegar_m = $conexao->prepare("SELECT * FROM miner_shop WHERE ip=$ip");
- $pegar_m->bindValue('$ip', $ip);
- $pegar_m->execute();
- $linha_m = $pegar_m->fetch();
- // fazer cliques dos referidos quando servidor resetar
- $server_reset = date("H:i:s");
- // comparar datas de expiração
- $date_compa = date("d/m/Y");
- if($date_compa != $linha_m["date_expire"]){
- function miners($clicks, $val_click, $conn){
- $mi_clicks = $linha_m["miners"] * $clicks;
- $mi_profit = $mi_clicks * $val_click;
- $saldo_miner = $linha_m["miners_earned"];
- $soma_miner = $mi_profit + $saldo_miner;
- // mudar e acrescentar lucros
- $select_min = $conn->prepare("update miner_shop set miners_earned=:miners_p,date=:date WHERE ip=$ip");
- $select_min->bindValue(":miners_p", protect($soma_miner));
- $select_min->bindValue(":date", protect($date_compa));
- $select_min->bindValue("$ip", protect($ip));
- $select_min->execute();
- // adicionar no saldo da conta
- $saldo_da_conta = $linha["money"];
- $soma_saldo = $saldo_da_conta + $mi_profit;
- $select_min2 = $conn->prepare("update usuarios set money=:money WHERE ip=$ip");
- $select_min2->bindValue(":money", protect($soma_saldo));
- $select_min2->execute();
- }
- switch($linha["acctype"]){
- case "Standard":
- echo miners(4, 0.002, $conexao);
- break;
- case "Golden":
- echo miners(4, 0.0025, $conexao);
- break;
- case "Ultimate":
- echo miners(4, 0.003, $conexao);
- break;
- }
- } else if($date_compa == $linha_m["date_expire"]){
- $select_min = $conexao->prepare("update miner_shop set miners=:miners,date=:date, date_expire=:expire WHERE ip=$ip");
- $select_min->bindValue(":miners", protect(0));
- $select_min->bindValue(":date", protect(0));
- $select_min->bindValue(":expire", protect(0));
- $select_min->execute();
- }
- /* fim da funçao miner */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement