Esempio n. 1
0
?>
</td>
               </tr><tr>
                  <td align="right" nowrap><b>Sub-total</b></td>
                  <td align="right" nowrap><font id="sell-subtotal"><?php 
$ssubtotal = 0 * $Buying_Rate;
echo satoshitize($ssubtotal);
?>
</font></td>
                  <td align="left" nowrap><?php 
echo $BTC;
?>
</td>
               <?php 
$sfee = $ssubtotal / 100 / 5;
$sfee = satoshitize($sfee);
if ($my_coins->coins[$BTCS]["sell_fee"] == true) {
    echo '
			   </tr><tr>
                  <td align="right" nowrap><b>Fee</b></td>
                  <td align="right" nowrap><font id="sell-fee">' . $sfee . '</font></td>
                  <td align="left" nowrap>' . $BTC . '</td>
			   ';
} else {
    echo '<input id="sell-fee" type="hidden" value="0">';
}
?>
               </tr><tr>
                  <td colspan="3" style="height: 10px;"></td>
               </tr><tr>
                  <td colspan="3" align="right" nowrap><input type="submit" value="Sell" onmouseenter="sellcalculator();" class="sellbutton"></td>
Esempio n. 2
0
               </tr><tr>
                  <td align="right" nowrap><b>Sub-total</b></td>
                  <td align="right" nowrap><font id="sell-subtotal"><?php 
$bsubtotal = 0 * $Buying_Rate;
echo satoshitize($bsubtotal);
?>
</font></td>
                  <td align="left" nowrap><?php 
echo $BTC;
?>
</td>
               </tr><tr>
                  <td align="right" nowrap><b>Fee</b></td>
                  <td align="right" nowrap><font id="sell-fee"><?php 
$sfee = $ssubtotal / 100 / 5;
echo satoshitize($sfee);
?>
</font></td>
                  <td align="left" nowrap><?php 
echo $BTC;
?>
</td>
               </tr><tr>
                  <td colspan="3" style="height: 10px;"></td>
               </tr><tr>
                  <td colspan="3" align="right" nowrap><input type="submit" value="Sell" onmouseenter="sellcalculator();" class="sellbutton"></td>
               </tr>
            </table>
         </td>
      </tr><tr>
         <td align="left" valign="top" style="padding: 5px;" nowrap>
        $Orders_Sells_Rate = $Row['rate'];
        $Orders_Sells_Total = $Orders_Sells_Amount * $Orders_Sells_Rate;
        $Orders_Sells_Total = satoshitrim(satoshitize($Orders_Sells_Total));
        $Sells_td .= '<tr>
                       <td align="right" style="padding: 1px;" nowrap><a href="#" onclick="setbuyamounts(' . $Orders_Sells_Amount . ');">' . $Orders_Sells_Amount . '</a></td>
                       <td align="right" style="padding: 1px; padding-left: 10px;" nowrap><a href="#" onclick="setbuyrates(' . $Orders_Sells_Rate . ');">' . $Orders_Sells_Rate . '</a></td>
                       <td align="right" style="padding: 1px; padding-left: 10px;" nowrap>' . $Orders_Sells_Total . '</td>
                    </tr>';
    }
    $buy_subtotal = "0";
    $Query = mysql_query("SELECT amount FROM sell_orderbook WHERE want='" . $my_coins->coins_names_prefix[2] . "' and trade_id='" . $my_coins->getTradeId() . "' and processed='1' ORDER BY rate ASC");
    while ($Row = mysql_fetch_assoc($Query)) {
        $buy_amount = $Row['amount'];
        $buy_subtotal += $buy_amount;
    }
    $cncvalue = satoshitrim(satoshitize($buy_subtotal));
    echo '<table>
               <tr>
                  <td colspan="4" align="left" style="font-weight: bold; padding: 2px;" nowrap>Sell Orders</td>
               </tr><tr>
                  <td colspan="4" align="right" style="padding: 2px;" nowrap>Total ' . $my_coins->coins_names_prefix[1] . ': ' . $cncvalue . '</td>
               </tr><tr>
                  <td align="left" style="font-weight: bold; padding: 1px;" nowrap>Amount (' . $my_coins->coins_names_prefix[1] . ')</td>
                  <td align="left" style="font-weight: bold; padding: 1px; padding-left: 10px;" nowrap>Rate (' . $my_coins->coins_names_prefix[2] . ')</td>
                  <td align="left" style="font-weight: bold; padding: 1px; padding-left: 10px;" nowrap>Total (' . $my_coins->coins_names_prefix[2] . ')</td>
               </tr>' . $Sells_td . '</table>';
} else {
    echo '<table style="width: 260px;">
            <tr>
               <td align="left" style="font-weight: bold; padding: 2px;" nowrap>Sell Orders</td>
            </tr><tr>
    if ($iid != $my_coins->getSelectInstanceId()) {
        header("Location: home.php");
    }
}
$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!';
Esempio n. 5
0
<?php

require_once 'auth.php';
if ($Logged_In !== 7) {
    header("Location: index.php");
}
$new_address = addslashes(strip_tags($_GET['newaddr']));
if ($new_address == "go") {
    $Bytecoind_accountaddress = $Bytecoind->getnewaddress($wallet_id);
    header("Location: index.php");
}
$withdraw_amount = addslashes(strip_tags($_POST['amount']));
$withdraw_address = addslashes(strip_tags($_POST['address']));
if ($withdraw_address) {
    if ($withdraw_amount) {
        $withdraw_amount = satoshitize($withdraw_amount);
        if ($withdraw_amount < $Bytecoind_Balance) {
            $Bytecoind_Withdraw_From = $Bytecoind->sendfrom($wallet_id, $withdraw_address, (double) $withdraw_amount, 6);
            $withdraw_message = $Bytecoind_Withdraw_From;
            $Bytecoind_Balance = $Bytecoind->getbalance($wallet_id, 6);
        } else {
            $withdraw_message = 'You do not have enough Bytecoins!';
        }
    } else {
        $withdraw_message = 'No amount to withdraw was entered!';
    }
}
?>
<html>
<head>
   <title>Bytecoin Wallet</title>
Esempio n. 6
0
<?php

error_reporting(0);
$buy_subtotal = "0";
$buy_amounttotal = "0";
$Query = mysql_query("SELECT amount, rate FROM buy_orderbook WHERE want='" . $BTC . "' and trade_id='" . $my_coins->getTradeId() . "' and trade_with = '" . $BTCRYX . "' and processed='1' ORDER BY rate ASC");
while ($Row = mysql_fetch_assoc($Query)) {
    $buy_amount = $Row['amount'];
    $buy_rate = $Row['rate'];
    $buy_subtotal += $buy_amount * $buy_rate;
}
$btevalue = satoshitrim(satoshitize($buy_subtotal));
$buy_amounttotal = "0";
$Query = mysql_query("SELECT amount FROM sell_orderbook WHERE want='" . $BTC . "' and trade_id='" . $my_coins->getTradeId() . "' and trade_with = '" . $BTCRYX . "' and processed='1' ORDER BY rate ASC");
while ($Row = mysql_fetch_assoc($Query)) {
    $buy_amount = $Row['amount'];
    $buy_amounttotal += $buy_amount;
}
$btevolume = satoshitrim(satoshitize($buy_amounttotal));
echo '<table>
         <tr>
            <td nowrap>' . $BTCRYX . '/' . $BTC . '</td>
            <td style="padding-left: 10px;" nowrap>Volume ' . $btevolume . ' / ' . $btevalue . ' ' . $BTC . '</td>
         </tr>
      </table>';
Esempio n. 7
0
</strong>! <?php 
if ($admin) {
    ?>
<strong><font color="red">[Admin]</font><?php 
}
?>
</strong>
<form action="index.php" method="POST">
<form>
        <input type="hidden" name="action" value="logout" />
        <button type="submit" class="btn btn-default"><strong>LOGOUT</strong></button>
</form>
</form>
</div>
<h2>Balance:<br/> <span class="counter" style="font-weight: bold; color:#0896FE;"><b><?php 
echo satoshitize($balance);
?>
</b></span> <?php 
echo $short;
?>
</h2>
<div class="sexytabs">
  <ul>
   <li><a href="#Withdraw">
      <span><b>Send </b></span></a></li>
    <li><a href="#Receive">
      <span><b>Receive</b></span></a></li>
    <li><a href="#Transactions">
      <span><b>Transactions</b></span></a></li>
     <li><a href="#Settings">
      <span><b>Settings</b></span></a></li>
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;
}
    }
} else {
    echo '<option value="7">' . $buy_orderbook["message"] . '</option>';
}
?>
</select></td>
                  <td align="left" nowrap><?php 
echo $BTC;
?>
</td>
               </tr><tr>
                  <td align="right" nowrap><b>Sub-total</b></td>
                  <td align="right" nowrap><select id="sell-subtotal" name="order-total" size="1" onchange="changeIndexBuy('sell-subtotal');"><?php 
if ($count_buy_orderbook > 0) {
    for ($i = 0; $i < $count_buy_orderbook; $i++) {
        $value = satoshitrim(satoshitize($buy_orderbook["amount"][$i] * $buy_orderbook["rate"][$i]));
        echo '<option value="' . $value . '">' . $value . '</option>';
    }
} else {
    echo '<option value="8">' . $buy_orderbook["message"] . '</option>';
}
?>
</select></td>
                  <td align="left" nowrap><?php 
echo $BTC;
?>
</td>
               </tr><tr>
                  <td colspan="3" style="height: 10px;"></td>
               </tr><tr>
                  <td colspan="3" align="right" nowrap><input type="submit" value="Sell" class="sellbutton"></td>
        $Orders_Sells_Rate = $Row['rate'];
        $Orders_Sells_Total = $Orders_Sells_Amount * $Orders_Sells_Rate;
        $Orders_Sells_Total = satoshitrim(satoshitize($Orders_Sells_Total));
        $Sells_td .= '<tr>
                       <td align="right" style="padding: 1px;" nowrap><a href="#" onclick="setbuyamounts(' . $Orders_Sells_Amount . ');">' . $Orders_Sells_Amount . '</a></td>
                       <td align="right" style="padding: 1px; padding-left: 10px;" nowrap><a href="#" onclick="setbuyrates(' . $Orders_Sells_Rate . ');">' . $Orders_Sells_Rate . '</a></td>
                       <td align="right" style="padding: 1px; padding-left: 10px;" nowrap>' . $Orders_Sells_Total . '</td>
                    </tr>';
    }
    $buy_subtotal = "0";
    $Query = mysql_query("SELECT amount FROM sell_orderbook WHERE want='" . $BTC . "' and trade_id='" . $my_coins->getTradeId() . "' and trade_with = '" . $BTCRYX . "' and processed='1' ORDER BY rate ASC");
    while ($Row = mysql_fetch_assoc($Query)) {
        $buy_amount = $Row['amount'];
        $buy_subtotal += $buy_amount;
    }
    $btevolume = satoshitrim(satoshitize($buy_subtotal));
    echo '<table>
               <tr>
                  <td colspan="3" align="left" style="font-weight: bold; padding: 2px;" nowrap>Sell Orders</td>
               </tr><tr>
                  <td colspan="3" align="right" style="padding: 2px;" nowrap>Total ' . $BTCRYX . ': ' . $btevolume . '</td>
               </tr><tr>
                  <td align="left" style="font-weight: bold; padding: 1px;" nowrap>Amount (' . $BTCRYX . ')</td>
                  <td align="left" style="font-weight: bold; padding: 1px; padding-left: 10px;" nowrap>Rate (' . $BTC . ')</td>
                  <td align="left" style="font-weight: bold; padding: 1px; padding-left: 10px;" nowrap>Total (' . $BTC . ')</td>
               </tr>' . $Sells_td . '</table>';
} else {
    echo '<table style="width: 260px;">
            <tr>
               <td align="left" style="font-weight: bold; padding: 2px;" nowrap>Sell Orders</td>
            </tr><tr>
Esempio n. 11
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;
}