Ejemplo n.º 1
0
function check_btc_withdraw_limit($uid, $amount)
{
    $withdrawn = btc_withdrawn_today($uid);
    $limit = numstr_to_internal(MAXIMUM_DAILY_BTC_WITHDRAW);
    $available = gmp_sub($limit, $withdrawn);
    if (gmp_cmp($amount, $available) > 0) {
        throw new Problem(_('Daily limit exceeded'), sprintf(_('You can only withdraw %s per day.'), internal_to_numstr($limit) . ' BTC'));
    }
}
Ejemplo n.º 2
0
        }
        ?>
    </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";
        }
    }
    if (gmp_cmp($btc, '0') <= 0) {