Example #1
0
function total_fiat_balance($uid)
{
    $balances = fetch_balances($uid);
    $committed_balances = fetch_committed_balances($uid);
    $total_fiat_balance = gmp_add($balances[CURRENCY], $committed_balances[CURRENCY]);
    return $total_fiat_balance;
}
Example #2
0
<?php 
            }
        }
        ?>
    </div>
<?php 
    }
    ?>

    <div class='content_box'>
    <h3><?php 
    echo _("Withdraw BTC to Bitcoin Address");
    ?>
</h3>
<?php 
    $balances = fetch_balances($is_logged_in);
    $btc = $balances['BTC'];
    $withdrawn = btc_withdrawn_today($is_logged_in);
    $limit = numstr_to_internal(MAXIMUM_DAILY_BTC_WITHDRAW);
    $available = gmp_sub($limit, $withdrawn);
    if (gmp_cmp($btc, $available) > 0) {
        echo "    <p>" . sprintf(_("You can withdraw up to %s BTC each day"), internal_to_numstr($limit)) . " (", day_time_range_string(), ").</p>\n";
        if ($withdrawn) {
            echo "    <p>" . sprintf(_("You have withdrawn %s BTC today"), internal_to_numstr($withdrawn)) . "\n";
            if (gmp_cmp($available, '0') > 0) {
                echo "    " . sprintf(_("and so can withdraw up to %s BTC more."), internal_to_numstr($available));
            } else {
                echo "    " . _("and so cannot withdraw any more until tomorrow.");
            }
            echo "</p>\n";
        }
Example #3
0
function show_content_header_balances($uid)
{
    $balances = fetch_balances($uid);
    $fiat = internal_to_numstr($balances[CURRENCY], FIAT_PRECISION, false);
    $btc = internal_to_numstr($balances['BTC'], BTC_PRECISION, false);
    $c_balances = fetch_committed_balances($uid);
    $c_fiat = internal_to_numstr($c_balances[CURRENCY], FIAT_PRECISION);
    $c_btc = internal_to_numstr($c_balances['BTC'], BTC_PRECISION);
    echo "    <div class='content_header_box'>\n";
    echo "        ", SPACE, _("balances"), ":", SPACE, "{$fiat} ";
    if ($c_fiat > 0) {
        echo "(+{$c_fiat}) ";
    }
    echo CURRENCY, SPACE, "{$btc} ";
    if ($c_btc > 0) {
        echo "(+{$c_btc}) ";
    }
    echo "BTC\n";
    echo "    </div>\n";
}
Example #4
0
function info()
{
    global $is_logged_in;
    $balances = fetch_balances($is_logged_in);
    return array("status" => "OK", "uid" => $is_logged_in, "BTC" => internal_to_numstr($balances['BTC']), CURRENCY => internal_to_numstr($balances[CURRENCY]));
}
Example #5
0
    echo "</tr>\n";
}
if (!$first) {
    echo "    <tr>\n";
    echo "        <td></td><td class='right'>--------</td><td class='right'>--------</td><td class='right'>--------</td><td class='right'>--------</td>\n";
    echo "    </tr>\n";
    echo "    <tr>\n";
    echo "        <td></td>";
    echo "        <td>", internal_to_numstr($amount_fiat_total, FIAT_PRECISION), "</td>";
    echo "        <td>", internal_to_numstr($commission_fiat_total, FIAT_PRECISION), "</td>";
    echo "        <td>", internal_to_numstr($amount_btc_total, BTC_PRECISION), "</td>";
    echo "        <td>", internal_to_numstr($commission_btc_total, BTC_PRECISION), "</td>";
    echo "    </tr>\n";
    echo "</table>\n";
}
$commissions = fetch_balances('1');
printf("<p>" . _("In the commission purse, there is %s %s and %s %s.") . "\n", internal_to_numstr($commissions[CURRENCY], FIAT_PRECISION), CURRENCY, internal_to_numstr($commissions['BTC'], BTC_PRECISION), "BTC");
echo _("Hopefully that matches with the totals shown above.") . "</p>\n";
?>
<script type="text/javascript">
var tx = [];
<?php 
foreach ($cells as $orderid => $array) {
    echo "tx['{$orderid}'] = [";
    echo implode($array, ',');
    echo "];\n";
}
?>

function Color(oid, color)
{