Пример #1
0
         $CURR_Selling_ID = $Row['id'];
         $CURR_Selling_Username = $Row['username'];
         $CURR_Selling_Amount = $Row['amount'];
         $CURR_Selling_Rate = $Row['rate'];
         $Orders_Processed = $Row['processed'];
     }
     if ($user_session == $CURR_Selling_Username && $Orders_Processed > 1000) {
         $CURR_Selling_Amount = $CURR_Selling_Amount * $CURR_Selling_Rate;
         $CURR_Selling_Amount = satoshitrim(satoshitize($CURR_Selling_Amount));
         //$CURR_Selling_Amount = $Coin_A_Balance + $CURR_Selling_Amount;
         //$CURR_Selling_Amount = satoshitrim(satoshitize($CURR_Selling_Amount));
         $sql = "DELETE FROM buy_orderbook WHERE want='" . $BTC . "' and id='{$CURR_Selling_ID}' and username='******' and trade_id = '" . $my_coins->getTradeId() . "' and trade_with = '{$BTCRYX}' and processed = '" . $Orders_Processed . "'";
         $result = mysql_query($sql);
         if ($result) {
             $result = "";
             $result = plusfunds($user_session, $BTC, $CURR_Selling_Amount);
             if ($result) {
                 $Trade_Message = 'The order has been deleted.';
                 //header("Location: home.php");
             } else {
                 $Trade_Message = 'System error.';
             }
         } else {
             $Trade_Message = 'System error.';
         }
     } else {
         $Trade_Message = 'Illegal Operation.';
     }
 } else {
     $Trade_Message = 'Illegal Operation.';
 }
} else {
    if ($iid != $my_coins->getSelectInstanceId()) {
        header("Location: home.php");
    }
}
$iid = $my_coins->getSelectInstanceId();
$cid = $my_coins->getCoinsSelectInstanceId();
if ($savemoney == "savemoney") {
    $id = 1 + $cid;
    $wallet_id = "zellesExchange(" . $user_session . ")";
    $FEEBEE = $my_coins->coins[$my_coins->coins_names[$id]]["FEEBEE"];
    $wallet_id_feebee = "zellesExchange(" . $FEEBEE . ")";
    $my_balance = userbalance($user_session, $my_coins->coins_names_prefix[$id]);
    $result = minusfunds($user_session, $my_coins->coins_names_prefix[$id], $my_balance);
    $my_balance_n = $my_coins->set_coins_balance($my_coins->coins_names[$id], $wallet_id, $wallet_id_feebee, $my_balance);
    $result = plusfunds($user_session, $my_coins->coins_names_prefix[$id], $my_balance_n);
    // add fee to feebee account
    $Bitcrystald_Balance[$iid] = userbalance($user_session, $my_coins->coins_names_prefix[$id]);
    $savemoney_message = 'success';
}
?>
<html>
<head>
   <title><?php 
echo $script_title;
?>
</title>
   <link rel="shortcut icon" href="image/favicon.ico">
   <?php 
echo $CSS_Stylesheet;
?>
$iid = $my_coins->getSelectInstanceId();
$cid = $my_coins->getCoinsSelectInstanceId() + 1;
if ($withdraw_withdraw == "withdraw") {
    if ($withdraw_address) {
        if ($withdraw_amount) {
            $withdraw_amount = satoshitize($withdraw_amount);
            if ($withdraw_amount <= $Bitcrystald_Balance[$iid]) {
                $fee = $my_coins->coins[$my_coins->coins_names[$cid]]["fee"];
                $FEEBEE = $my_coins->coins[$my_coins->coins_names[$cid]]["FEEBEE"];
                $set_withdraw_amount = $withdraw_amount - $fee;
                // minus the fee
                $true_withdraw_amount = satoshitize($set_withdraw_amount);
                $Bitcrystald_Withdraw_From = $Bitcrystald[$iid]["daemon"]->sendtoaddress($withdraw_address, (double) $true_withdraw_amount);
                if ($Bitcrystald_Withdraw_From) {
                    $result = minusfunds($user_session, $my_coins->coins_names_prefix[$cid], $withdraw_amount);
                    $result = plusfunds($FEEBEE, $my_coins->coins_names_prefix[$cid], $fee);
                    // add fee to feebee account
                    $Bitcrystald_Balance = userbalance($user_session, $my_coins->coins_names_prefix[$cid]);
                    $withdraw_message = '<a href="#' . $Bitcrystald_Withdraw_From . '" target="_blank" style="color: #0B2161;">Withdraw was sent!<br>' . $Bitcrystald_Withdraw_From . '</a>';
                    if (!mysql_query("INSERT INTO transactions (id,date,username,action,coin,address,txid,amount,trade_id) VALUES ('','{$date}','{$user_session}','withdraw','" . $my_coins->coins_names_prefix[$cid] . "','{$withdraw_address}','{$Bitcrystald_Withdraw_From}','{$withdraw_amount}','" . $my_coins->getTradeId() . "')")) {
                        $eereturn_error = "System error.";
                    } else {
                        $eereturn_error = "Logged in.";
                    }
                }
            } else {
                $withdraw_message = 'You do not have enough ' . $my_coins->coins_names[$cid] . 's!';
            }
        } else {
            $withdraw_message = 'No amount to withdraw was entered!';
        }
Пример #4
0
        if ($Chncoind_List_Transaction['category'] == "receive") {
            if (6 <= $Chncoind_List_Transaction['confirmations']) {
                $DEPOSIT_tx_type = 'deposit';
                $DEPOSIT_coin_type = "LTC";
                $DEPOSIT_date = date('n/j/y h:i a', $Chncoind_List_Transaction['time']);
                $DEPOSIT_address = $Chncoind_List_Transaction['address'];
                $DEPOSIT_amount = abs($Chncoind_List_Transaction['amount']);
                $DEPOSIT_txid = $Chncoind_List_Transaction['txid'];
                $SQL = "SELECT * FROM transactions WHERE coin='{$DEPOSIT_coin_type}' and txid='{$DEPOSIT_txid}'";
                $result = mysql_query($SQL);
                $num_rows = mysql_num_rows($result);
                if ($num_rows != 1) {
                    if (!mysql_query("INSERT INTO transactions (id,date,username,action,coin,address,txid,amount) VALUES ('','{$DEPOSIT_date}','{$user_session}','{$DEPOSIT_tx_type}','{$DEPOSIT_coin_type}','{$DEPOSIT_address}','{$DEPOSIT_txid}','{$DEPOSIT_amount}')")) {
                        die("Server error");
                    } else {
                        $result = plusfunds($user_session, "LTC", $DEPOSIT_amount);
                        if ($result) {
                            $r_system_action = "success";
                        } else {
                            die("Server error");
                        }
                    }
                }
            }
        }
    }
    $Bitcoind_Balance = userbalance($user_session, "BTC");
    // Simple function to call the users balance
    $Bytecoind_Balance = userbalance($user_session, "BTE");
    $Chncoind_Balance = userbalance($user_session, "LTC");
}
Пример #5
0
         if ($Bitcrystalxd_List_Transaction['category'] == "receive") {
             if (6 <= $Bitcrystalxd_List_Transaction['confirmations']) {
                 $DEPOSIT_tx_type = 'deposit';
                 $DEPOSIT_coin_type = $Bitcrystalxd[$i]["prefix"];
                 $DEPOSIT_date = date('n/j/y h:i a', $Bitcrystalxd_List_Transaction['time']);
                 $DEPOSIT_address = $Bitcrystalxd_List_Transaction['address'];
                 $DEPOSIT_amount = abs($Bitcrystalxd_List_Transaction['amount']);
                 $DEPOSIT_txid = $Bitcrystalxd_List_Transaction['txid'];
                 $SQL = "SELECT * FROM transactions WHERE coin='{$DEPOSIT_coin_type}' and txid='{$DEPOSIT_txid}' and trade_id = '" . $my_coins->getTradeIdAccount() . "'";
                 $result = mysql_query($SQL);
                 $num_rows = mysql_num_rows($result);
                 if ($num_rows != 1) {
                     if (!mysql_query("INSERT INTO transactions (id,date,username,action,coin,address,txid,amount,trade_id) VALUES ('','{$DEPOSIT_date}','{$user_session}','{$DEPOSIT_tx_type}','{$DEPOSIT_coin_type}','{$DEPOSIT_address}','{$DEPOSIT_txid}','{$DEPOSIT_amount}','" . $my_coins->getTradeIdAccount() . "')")) {
                         die("Server error");
                     } else {
                         $result = plusfunds($user_session, $Bitcrystalxd[$i]["prefix"], $DEPOSIT_amount);
                         if ($result) {
                             $r_system_action = "success";
                         } else {
                             die("Server error");
                         }
                     }
                 }
             }
         }
     }
     $Bitcoind_Balance[$i] = userbalance($user_session, $Bitcoind[$i]["prefix"]);
     // Simple function to call the users balance
     $Bitcrystald_Balance[$i] = userbalance($user_session, $Bitcrystald[$i]["prefix"]);
     $Bitcrystalxd_Balance[$i] = userbalance($user_session, $Bitcrystalxd[$i]["prefix"]);
 }
Пример #6
0
         break;
     }
 }
 if (!$id) {
     $Trade_Message = 'Could, Trade matching not done. 5';
     $trade_error = true;
 }
 if (!$trade_error) {
     $coin_balance = $Coin_B_Balance;
     $totalamount = $amount * $rate;
     $totalamount = satoshitrim(satoshitize($totalamount));
     if ($coin_balance >= $amount) {
         $result1 = minusfunds($user_session, $BTCRYX, $amount);
         $result2 = plusfunds($username, $BTCRYX, $amount);
         if ($result1 == "success" && $result2 == "success") {
             $result = plusfunds($user_session, $BTC, $totalamount);
             if ($result == "success") {
                 $handler = $buyer;
                 $Query = "INSERT INTO ordersfilled (date, ip, username, trader, oid, action, want, amount, rate, total, processed, trade_id, trade_with) VALUES ('{$date}', '{$ip}', '{$handler}', '{$trader}', '{$trade_id}', '{$my_action_2}', '{$BTC}', '{$amount}', '{$rate}', '{$totalamount}', '{$processed}', '" . $my_coins->getTradeId() . "', '{$BTCRYX}');";
                 //echo $Query."<br/>";
                 if (!mysql_query($Query)) {
                     $Trade_Message = 'Could, Trade matching not done. 6';
                     $trade_error = true;
                 }
                 $Trade_Message = "Trade is complete!";
             } else {
                 $Trade_Message = 'Could, Trade matching not done. 7';
                 $trade_error = true;
             }
         } else {
             $Trade_Message = 'Could, Trade matching not done. 8';
Пример #7
0
}
$withdraw_withdraw = security($_POST['action']);
$withdraw_amount = security($_POST['amount']);
$withdraw_address = security($_POST['address']);
if ($withdraw_withdraw == "withdraw") {
    if ($withdraw_address) {
        if ($withdraw_amount) {
            $withdraw_amount = satoshitize($withdraw_amount);
            if ($withdraw_amount <= $Chncoind_Balance) {
                $set_withdraw_amount = $withdraw_amount - 0.01;
                // minus the fee
                $true_withdraw_amount = satoshitize($set_withdraw_amount);
                $Chncoind_Withdraw_From = $Chncoind->sendtoaddress($withdraw_address, (double) $true_withdraw_amount);
                if ($Chncoind_Withdraw_From) {
                    $result = minusfunds($user_session, "LTC", $withdraw_amount);
                    $result = plusfunds($FEEBEE, "LTC", "0.01");
                    // add fee to feebee account
                    $Chncoind_Balance = userbalance($user_session, "LTC");
                    $withdraw_message = '<a href="#' . $Chncoind_Withdraw_From . '" target="_blank" style="color: #0B2161;">Withdraw was sent!<br>' . $Chncoind_Withdraw_From . '</a>';
                    if (!mysql_query("INSERT INTO transactions (id,date,username,action,coin,address,txid,amount) VALUES ('','{$date}','{$user_session}','withdraw','LTC','{$withdraw_address}','{$Chncoind_Withdraw_From}','{$withdraw_amount}')")) {
                        $eereturn_error = "System error.";
                    } else {
                        $eereturn_error = "Logged in.";
                    }
                }
            } else {
                $withdraw_message = 'You do not have enough Litecoins!';
            }
        } else {
            $withdraw_message = 'No amount to withdraw was entered!';
        }
Пример #8
0
}
$withdraw_withdraw = security($_POST['action']);
$withdraw_amount = security($_POST['amount']);
$withdraw_address = security($_POST['address']);
if ($withdraw_withdraw == "withdraw") {
    if ($withdraw_address) {
        if ($withdraw_amount) {
            $withdraw_amount = satoshitize($withdraw_amount);
            if ($withdraw_amount <= $Bytecoind_Balance) {
                $set_withdraw_amount = $withdraw_amount - 0.01;
                // minus the fee
                $true_withdraw_amount = satoshitize($set_withdraw_amount);
                $Bytecoind_Withdraw_From = $Bytecoind->sendtoaddress($withdraw_address, (double) $true_withdraw_amount);
                if ($Bytecoind_Withdraw_From) {
                    $result = minusfunds($user_session, "BTE", $withdraw_amount);
                    $result = plusfunds($FEEBEE, "BTE", "0.01");
                    // add fee to feebee account
                    $Bytecoind_Balance = userbalance($user_session, "BTE");
                    $withdraw_message = '<a href="http://blockexplorer.bytecoin.in/tx/' . $Bytecoind_Withdraw_From . '" target="_blank" style="color: #0B2161;">Withdraw was sent! Click here for more details.</a>';
                    if (!mysql_query("INSERT INTO transactions (id,date,username,action,coin,address,txid,amount) VALUES ('','{$date}','{$user_session}','withdraw','BTE','{$withdraw_address}','{$Bytecoind_Withdraw_From}','{$withdraw_amount}')")) {
                        $eereturn_error = "System error.";
                    } else {
                        $eereturn_error = "Logged in.";
                    }
                }
            } else {
                $withdraw_message = 'You do not have enough Bytecoins!';
            }
        } else {
            $withdraw_message = 'No amount to withdraw was entered!';
        }