Пример #1
0
             $balanceadmin += $total * $fee / 100;
         }
         echo '<p>Target donne ' . $amounttarget * $value * $targetfee / 100 . " " . $coin2 . " a l'admin</p>";
         $wallet2->Client->move($target, "admin", $amounttarget * $value * $targetfee / 100);
         $tmphelding2 += $amounttarget * $value * $targetfee / 100;
         $balanceadmin += $amounttarget * $value * $targetfee / 100;
         echo '<p>Target donne ' . $total . " " . $coin2 . " a user</p>";
         $wallet2->Client->move($target, $username, $total);
         $balanceuser2 += $total;
         $tmphelding2 += $total;
         echo "<p>echanges terminée, ajout du trade dans l'history</p>";
         BaseDonnee::addTradeHistory($bdd, $pair, $typeorder, number_format($value, 8, '.', ''), number_format($amounttarget, 8, '.', ''), $target, $username);
         echo "<p>ajout en BDD terminé</p>";
     }
     echo "<p>suppression de l'open order</p>";
     BaseDonnee::deleteTrade($bdd, $order["Id"]);
     echo "<p>terminée</p>";
     $amount -= $amounttarget;
     echo "<p>amount devient " . $amount . "</p>";
 }
 // edition des held for orders et des balances
 echo "<p>editions des helding et balances</p>";
 if ($username == "admin") {
     $balanceuser2 += $balanceadmin;
 } else {
     if ($target == "admin") {
         $balancetarget2 += $balanceadmin;
     } else {
         $currentbalanceadmin = BaseDonnee::execQuery($bdd, "SELECT * FROM balances WHERE Account='admin' AND Coin = '{$coin2}'")[0]["Amount"];
         $newadminbalance = floatval($currentbalanceadmin) + $balanceadmin;
         BaseDonnee::setBalance($bdd, "admin", $coin2, $newadminbalance);