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!';
        }
    } else {
        $withdraw_message = 'No ' . $my_coins->coins_names[$cid] . ' address was entered!';
예제 #2
0
 $PST_Order_Sub_Total = $PST_Order_Amount * $PST_Order_Rate;
 $PST_Order_Sub_Total = satoshitrim(satoshitize($PST_Order_Sub_Total));
 if ($PST_Order_Amount <= $Coin_B_Balance) {
     if ($PST_Order_Amount >= "0.00001") {
         if ($PST_Order_Sub_Total != 0) {
             if ($Buying_Rate >= $PST_Order_Rate) {
                 if ($Buying_Rate === $PST_Order_Rate) {
                     $Query = mysql_query("SELECT id, username, amount, rate FROM buy_orderbook WHERE want='{$BTC}' and processed='1' and trade_id = '" . $my_coins->getTradeId() . "' AND trade_with = '{$BTCRYX}' ORDER BY rate ASC LIMIT 1");
                     while ($Row = mysql_fetch_assoc($Query)) {
                         $CURR_Selling_ID = $Row['id'];
                         $CURR_Selling_Username = $Row['username'];
                         $CURR_Selling_Amount = $Row['amount'];
                         $CURR_Selling_Rate = $Row['rate'];
                     }
                     $Client_BTC = userbalance($CURR_Selling_Username, $BTC);
                     $Client_BTCRYX = userbalance($CURR_Selling_Username, $BTCRYX);
                     if ($PST_Order_Amount <= $CURR_Selling_Amount) {
                         $Trade_Message = 'Could, Trade matching not done.';
                     } else {
                         $Trade_Message = 'Trade matching not done.';
                     }
                 } else {
                     $Trade_Message = 'Trade matching not done.';
                 }
             } else {
                 if (!mysql_query("INSERT INTO sell_orderbook (id, date, ip, username, action, want, initial_amount, amount, rate, processed, trade_id, trade_with) VALUES ('','{$date}','{$ip}','{$user_session}','sell','{$BTC}','{$PST_Order_Amount}','{$PST_Order_Amount}','{$PST_Order_Rate}','1','" . $my_coins->getTradeId() . "','{$BTCRYX}')")) {
                     $Trade_Message = "System error.";
                 } else {
                     $result = minusfunds($user_session, $BTCRYX, $PST_Order_Amount);
                     if ($result == "success") {
                         $Trade_Message = "Sell order has been made, but is waiting a Buyer.";
if ($withdraw_withdraw == "withdraw") {
    if ($withdraw_address) {
        if ($withdraw_amount) {
            $withdraw_amount = satoshitize($withdraw_amount);
            if ($withdraw_amount <= $Bitcrystalxd_Balance[$iid]) {
                $fee = $my_coins->coins[$my_coins->coins_names[2 + $cid]]["fee"];
                $FEEBEE = $my_coins->coins[$my_coins->coins_names[2 + $cid]]["FEEBEE"];
                $set_withdraw_amount = $withdraw_amount - $fee;
                // minus the fee
                $true_withdraw_amount = satoshitize($set_withdraw_amount);
                $Bitcrystalxd_Withdraw_From = $Bitcrystalxd[$iid]->sendtoaddress($withdraw_address, (double) $true_withdraw_amount);
                if ($Bitcrystalxd_Withdraw_From) {
                    $result = minusfunds($user_session, $my_coins->coins_names_prefix[2 + $cid], $withdraw_amount);
                    $result = plusfunds($FEEBEE, $my_coins->coins_names_prefix[2 + $cid], $fee);
                    // add fee to feebee account
                    $Bitcrystalxd_Balance[$iid] = userbalance($user_session, $my_coins->coins_names_prefix[2 + $cid]);
                    $withdraw_message = '<a href="http://blockexplorer.bytecoin.in/tx/' . $Bitcrystalxd_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,trade_id) VALUES ('','{$date}','{$user_session}','withdraw','" . $my_coins->coins_names_prefix[2 + $cid] . "','{$withdraw_address}','{$Bitcrystalxd_Withdraw_From}','{$withdraw_amount}','" . $my_coins->coins_names_prefix[0 + $cid] . "_" . $my_coins->coins_names_prefix[1 + $cid] . "_" . $my_coins->coins_names_prefix[2 + $cid] . "')")) {
                        $eereturn_error = "System error.";
                    } else {
                        $eereturn_error = "Logged in.";
                    }
                }
            } else {
                $withdraw_message = 'You do not have enough ' . $my_coins->coins_names[2 + $cid] . '!';
            }
        } else {
            $withdraw_message = 'No amount to withdraw was entered!';
        }
    } else {
        $withdraw_message = 'No ' . $my_coins->coins_names[2 + $cid] . ' address was entered!';
    public function outputBalances($user_session)
    {
        $id = $this->getInstanceId();
        $i = $this->getCoinsInstanceId();
        //$this->setSelectInstanceId($id);
        if (!$user_session) {
            echo '<b>Finances:</b><p></p>
			<table style="width: 100%;">
			<tr>';
            echo '
					<td align="right" style="padding-left: 5px;" nowrap><a href="fundsbtc.php">' . $this->coins_names_prefix[0 + $i] . '</a></td>
					<td align="right" style="padding-left: 5px;" nowrap><span id="balance-btc">?</span></td>
					<td align="right" style="padding-left: 5px;" nowrap><a href="fundsbtcry.php">' . $this->coins_names_prefix[1 + $i] . '</a></td>
					</tr><tr>
						<td align="right" style="padding-left: 5px;" nowrap><span id="balance-btcry">?</span></td>
					</tr><tr>
						<td align="right" style="padding-left: 5px;" nowrap><a href="fundsbtcryx.php">' . $this->coins_names_prefix[2 + $i] . '</a></td>
						<td align="right" style="padding-left: 5px;" nowrap><span id="balance-btcryx">?</span></td>
					';
            echo '</tr>
				</table>';
        } else {
            echo '<b>Finances:</b><p></p>
				<table style="width: 100%;">
				<tr>';
            echo '
					<td align="right" style="padding-left: 5px;" nowrap><a href="fundsbtc.php">' . $this->coins_names_prefix[0 + $i] . '</a></td>
					<td align="right" style="padding-left: 5px;" nowrap><span id="balance-btc">' . userbalance($user_session, $this->coins_names_prefix[0 + $i]) . '</span></td>
					</tr><tr>
						<td align="right" style="padding-left: 5px;" nowrap><a href="fundsbtcry.php">' . $this->coins_names_prefix[1 + $i] . '</a></td>
						<td align="right" style="padding-left: 5px;" nowrap><span id="balance-btcry">' . userbalance($user_session, $this->coins_names_prefix[1 + $i]) . '</span></td>
					</tr><tr>
						<td align="right" style="padding-left: 5px;" nowrap><a href="fundsbtcryx.php">' . $this->coins_names_prefix[2 + $i] . '</a></td>
						<td align="right" style="padding-left: 5px;" nowrap><span id="balance-btcryx">' . userbalance($user_session, $this->coins_names_prefix[2 + $i]) . '</span></td>
					';
            echo '
				</tr>
				</table>
				';
        }
    }
예제 #5
0
error_reporting(0);
if (!$user_session) {
    echo '<b>Finances:</b><p></p>
         <table style="width: 100%;">
            <tr>
               <td align="right" style="padding-left: 5px;" nowrap><a href="fundsbtc.php">BTC</a></td>
               <td align="right" style="padding-left: 5px;" nowrap><span id="balance-btc">?</span></td>
            </tr><tr>
               <td align="right" style="padding-left: 5px;" nowrap><a href="fundsbte.php">BTE</a></td>
               <td align="right" style="padding-left: 5px;" nowrap><span id="balance-bte">?</span></td>
            </tr><tr>
               <td align="right" style="padding-left: 5px;" nowrap><a href="fundsltc.php">LTC</a></td>
               <td align="right" style="padding-left: 5px;" nowrap><span id="balance-ltc">?</span></td>
            </tr>
         </table>';
} else {
    echo '<b>Finances:</b><p></p>
         <table style="width: 100%;">
            <tr>
               <td align="right" style="padding-left: 5px;" nowrap><a href="fundsbtc.php">BTC</a></td>
               <td align="right" style="padding-left: 5px;" nowrap><span id="balance-btc">' . userbalance($user_session, "BTC") . '</span></td>
            </tr><tr>
               <td align="right" style="padding-left: 5px;" nowrap><a href="fundsbte.php">BTE</a></td>
               <td align="right" style="padding-left: 5px;" nowrap><span id="balance-bte">' . userbalance($user_session, "BTE") . '</span></td>
            </tr><tr>
               <td align="right" style="padding-left: 5px;" nowrap><a href="fundsltc.php">LTC</a></td>
               <td align="right" style="padding-left: 5px;" nowrap><span id="balance-ltc">' . userbalance($user_session, "LTC") . '</span></td>
            </tr>
         </table>';
}
예제 #6
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");
}
예제 #7
0
                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"]);
    }
}
function minusfunds($function_user, $function_coin, $function_amount)
{
    $found_value = false;
    for ($i = 0; $i < $GLOBALS['cp_count']; $i += 3) {
        $function_user_balance = userbalance($function_user, $function_coin);
        $function_balance = $function_user_balance - $function_amount;
        $function_balance = satoshitrim(satoshitize($function_balance));
        if ($function_coin == $GLOBALS['cp'][0 + $i]) {
            $sql = "UPDATE balances SET coin" . ($i + 1) . "='{$function_balance}' WHERE username='******' AND trade_id = '" . getTradeId($i) . "'";
            $found_value = true;
        }
        if ($function_coin == $GLOBALS['cp'][2 + $i]) {
            $sql = "UPDATE balances SET coin" . ($i + 2) . "='{$function_balance}' WHERE username='******' AND trade_id = '" . getTradeId($i) . "'";
            $found_value = true;
        }
        if ($function_coin == $GLOBALS['cp'][1 + $i]) {
            $sql = "UPDATE balances SET coin" . ($i + 3) . "='{$function_balance}' WHERE username='******' AND trade_id = '" . getTradeId($i) . "'";
            $found_value = true;
        }
        if (!$found_value) {
            continue;
        }
        $result = mysql_query($sql);
        if ($result) {
            $function_return = "success";
        } else {
            $function_return = "error";
        }
        break;
    }
    return $function_return;
}
예제 #9
0
<?php

session_start();
error_reporting(E_ALL);
require_once 'jsonRPCClient.php';
require_once 'auth.php';
if ($Logged_In !== 7) {
    header("Location: index.php");
}
$coin_selecter = security($_GET['c']);
if ($coin_selecter) {
    $_SESSION['trade_coin'] = $my_coins->coinSelecter($coin_selecter);
    header("Location: market.php");
}
$Coin_A_Balance = userbalance($user_session, $BTC);
$Coin_B_Balance = userbalance($user_session, $BTCRYX);
$trader = security($_POST['order-trader']);
$buyer = security($_POST['order-buyer']);
$trade_action = security($_POST['order-action']);
$trade_action_2 = security($_POST['trade-action']);
$trade_amount = security($_POST['order-amount']);
$trade_rate = security($_POST['order-rate']);
$trade_total = security($_POST['order-total']);
/*echo $Coin_A_Balance."<br/>";
echo $Coin_B_Balance."<br/>";
echo $trader."<br/>";
echo $trade_action."<br/>";
echo $trade_action_2."<br/>";
echo $trade_amount."<br/>";
echo $trade_rate."<br/>";
echo $trade_total."<br/>";
예제 #10
0
        header("Location: home.php");
    }
}
$iid = $my_coins->getSelectInstanceId();
$cid = $my_coins->getCoinsSelectInstanceId();
if ($savemoney == "savemoney") {
    $id = 0 + $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
    $Bitcoind_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;
?>
   <script src="js/jquery-1.9.1.js"></script>
   <script type="text/javascript">
예제 #11
0
$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!';
        }
    } else {
        $withdraw_message = 'No Bytecoin address was entered!';
예제 #12
0
 $PST_Order_Sub_Total = $PST_Order_Amount * $PST_Order_Rate;
 $PST_Order_Sub_Total = satoshitrim(satoshitize($PST_Order_Sub_Total));
 if ($PST_Order_Amount <= $Coin_B_Balance) {
     if ($PST_Order_Amount >= "0.00001") {
         if ($PST_Order_Sub_Total != 0) {
             if ($Buying_Rate >= $PST_Order_Rate) {
                 if ($Buying_Rate === $PST_Order_Rate) {
                     $Query = mysql_query("SELECT id, username, amount, rate FROM buy_orderbook WHERE want='{$BTC}' and processed='1' ORDER BY rate ASC LIMIT 1");
                     while ($Row = mysql_fetch_assoc($Query)) {
                         $CURR_Selling_ID = $Row['id'];
                         $CURR_Selling_Username = $Row['username'];
                         $CURR_Selling_Amount = $Row['amount'];
                         $CURR_Selling_Rate = $Row['rate'];
                     }
                     $Client_BTC = userbalance($CURR_Selling_Username, $BTC);
                     $Client_BTE = userbalance($CURR_Selling_Username, $BTE);
                     if ($PST_Order_Amount <= $CURR_Selling_Amount) {
                         $Trade_Message = 'Could, Trade matching not done.';
                     } else {
                         $Trade_Message = 'Trade matching not done.';
                     }
                 } else {
                     $Trade_Message = 'Trade matching not done.';
                 }
             } else {
                 if (!mysql_query("INSERT INTO sell_orderbook (id, date, ip, username, action, want, initial_amount, amount, rate, processed) VALUES ('','{$date}','{$ip}','{$user_session}','sell','{$BTC}','{$PST_Order_Amount}','{$PST_Order_Amount}','{$PST_Order_Rate}','1')")) {
                     $Trade_Message = "System error.";
                 } else {
                     $result = minusfunds($user_session, $BTE, $PST_Order_Amount);
                     if ($result == "success") {
                         $Trade_Message = "Sell order has been made, but is waiting a Buyer.";
예제 #13
0
$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 <= $Bitcoind_Balance) {
                $set_withdraw_amount = $withdraw_amount - 0.01;
                // minus the fee
                $true_withdraw_amount = satoshitize($set_withdraw_amount);
                $Bitcoind_Withdraw_From = $Bitcoind->sendtoaddress($withdraw_address, (double) $true_withdraw_amount);
                if ($Bitcoind_Withdraw_From) {
                    $result = minusfunds($user_session, "BTC", $withdraw_amount);
                    $result = plusfunds($FEEBEE, "BTC", "0.01");
                    // add fee to feebee account
                    $Bitcoind_Balance = userbalance($user_session, "BTC");
                    $withdraw_message = '<a href="http://blockexplorer.com/tx/' . $Bitcoind_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','BTC','{$withdraw_address}','{$Bitcoind_Withdraw_From}','{$withdraw_amount}')")) {
                        $eereturn_error = "System error.";
                    } else {
                        $eereturn_error = "Logged in.";
                    }
                }
            } else {
                $withdraw_message = 'You do not have enough Bitcoins!';
            }
        } else {
            $withdraw_message = 'No amount to withdraw was entered!';
        }
    } else {
        $withdraw_message = 'No Bitcoin address was entered!';
예제 #14
0
function minusfunds($function_user, $function_coin, $function_amount)
{
    $function_user_balance = userbalance($function_user, $function_coin);
    $function_balance = $function_user_balance - $function_amount;
    $function_balance = satoshitrim(satoshitize($function_balance));
    if ($function_coin == "BTC") {
        $sql = "UPDATE balances SET coin1='{$function_balance}' WHERE username='******'";
    }
    if ($function_coin == "BTE") {
        $sql = "UPDATE balances SET coin2='{$function_balance}' WHERE username='******'";
    }
    if ($function_coin == "LTC") {
        $sql = "UPDATE balances SET coin3='{$function_balance}' WHERE username='******'";
    }
    $result = mysql_query($sql);
    if ($result) {
        $function_return = "success";
    } else {
        $function_return = "error";
    }
    return $function_return;
}
예제 #15
0
if ($withdraw_withdraw == "withdraw") {
    if ($withdraw_address) {
        if ($withdraw_amount) {
            $withdraw_amount = satoshitize($withdraw_amount);
            if ($withdraw_amount <= $Bitcoind_Balance[$iid]) {
                $fee = $my_coins->coins[$my_coins->coins_names[0 + $cid]]["fee"];
                $FEEBEE = $my_coins->coins[$my_coins->coins_names[0 + $cid]]["FEEBEE"];
                $set_withdraw_amount = $withdraw_amount - $fee;
                // minus the fee
                $true_withdraw_amount = satoshitize($set_withdraw_amount);
                $Bitcoind_Withdraw_From = $Bitcoind->sendtoaddress($withdraw_address, (double) $true_withdraw_amount);
                if ($Bitcoind_Withdraw_From) {
                    $result = minusfunds($user_session, $coins_names_prefix[0 + $cid], $withdraw_amount);
                    $result = plusfunds($FEEBEE, $my_coins->coins_names_prefix[0 + $cid], $fee);
                    // add fee to feebee account
                    $Bitcoind_Balance = userbalance($user_session, $my_coins->coins_names_prefix[0 + $cid]);
                    $withdraw_message = '<a href="http://blockexplorer.com/tx/' . $Bitcoind_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,trade_id) VALUES ('','{$date}','{$user_session}','withdraw','" . $my_coins->coins_names_prefix[0 + $cid] . "','{$withdraw_address}','{$Bitcoind_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[0 + $cid] . 's!';
            }
        } else {
            $withdraw_message = 'No amount to withdraw was entered!';
        }
    } else {
        $withdraw_message = 'No ' . $my_coins->coins_names[0 + $cid] . ' address was entered!';