예제 #1
0
function do_withdraw($amount_disp, $curr_type, &$voucher_code, &$reqid)
{
    global $is_logged_in;
    if (!ENABLE_LOCAL_VOUCHERS && isset($_POST['voucher'])) {
        throw Error('Vouchers are not enabled on this site', 'Withdrawing to a voucher code is disabled.');
    }
    $amount = numstr_to_internal($amount_disp);
    // dollar amounts should be truncated to cents, but Bitcoins are more divisible
    if ($curr_type == 'BTC') {
        $amount = truncate_num($amount, BTC_WITHDRAW_DECIMAL_PLACES);
    } else {
        $amount = truncate_num($amount, 2);
    }
    curr_supported_check($curr_type);
    order_worthwhile_check($amount, $amount_disp, $curr_type, MINIMUM_WITHDRAW);
    enough_money_check($amount, $curr_type);
    check_withdraw_limit($is_logged_in, $amount, $curr_type);
    if (!save_details($is_logged_in, $amount, $curr_type, $voucher_code, $reqid)) {
        throw Error('We had to admit it sometime...', 'Stop trading on thie site. Contact the admin FAST.');
    }
    // actually take the money now
    deduct_funds($amount, $curr_type);
    // request is submitted to the queue for the cron job to actually execute (unless it's a voucher)
}
예제 #2
0
 public function sendDonationReminderMailToAdmin($donation)
 {
     global $database;
     $From = EMAIL_FROM_ADDR;
     $templet = "editables/email/simplemail.html";
     require "editables/mailtext.php";
     $Subject = $lang['mailtext']['donation_information_sub'];
     $params['donation'] = number_format(truncate_num($donation, 2), 2, ".", "");
     $message = $this->formMessage($lang['mailtext']['donation_information_body'], $params);
     $reply = $this->mailSendingHtml($From, 'Admin', ADMIN_EMAIL_ADDR, $Subject, '', $message, 0, $templet, 3);
 }
예제 #3
0
    echo "</td></tr></table>";
}
if (isset($_GET['v'])) {
    $v = $_GET['v'];
    $error = $_SESSION['error_array']['cardRedeemError'];
    if ($v == 0) {
        echo "<font color='red'>" . $error . "</font><br/><br/>";
    }
    if ($v == 1) {
        echo "<font color='green'>A gift card of USD " . $_GET['amt'] . " has been credited to your lender account.</font><br/><br/>";
    }
}
if ($session->userlevel == LENDER_LEVEL) {
    $country = $database->getCountryCodeById($session->userid);
    $availAmt = $session->amountToUseForBid($userid);
    $availAmt = truncate_num(round($availAmt, 4), 2);
    $investAmtDisplay = $database->amountInActiveBidsDisplay($session->userid);
    $m = 0;
    if (isset($_GET["m"])) {
        $m = $_GET["m"];
    }
    if ($m == 1) {
        echo '<div class="clearfix" style="color:green">';
        echo $lang['withdraw']['withdraw_non_US'];
        echo "</div>";
    }
    if ($m == 2) {
        echo '<div class="clearfix" style="color:green">';
        echo $lang['withdraw']['withdraw_US'];
        echo "</div>";
    }
예제 #4
0
			
	});
</script>
<?php 
include_once "library/session.php";
include_once "./editables/order-tnc.php";
$path = getEditablePath('order-tnc.php');
include_once "editables/" . $path;
include_once "./editables/withdraw.php";
$path = getEditablePath('withdraw.php');
include_once "editables/" . $path;
if (isset($_SESSION['bidPaymentId']) && $session->userlevel == LENDER_LEVEL) {
    $paypalTranFeeOrg = $database->getAdminSetting('PaypalTransaction');
    $bidPaymentId = $_SESSION['bidPaymentId'];
    $order_amount = $database->getBidAmount($bidPaymentId, $session->userid);
    $availableAmt = truncate_num(round($session->amountToUseForBid($session->userid), 4), 2);
    $paypal_amount = bcsub($order_amount, $availableAmt, 4);
    if ($paypal_amount > 0) {
        $paypal_donation = bcmul($paypal_amount, 15 / 100, 4);
        $paypalTranFee = $paypalTranFeeOrg;
        $paypalTranAmount = bcmul($paypal_amount, $paypalTranFee, 4) / 100;
        $totalAmt2 = bcadd(bcadd($paypal_amount, $paypalTranAmount, 4), $paypal_donation, 4);
        $totalAmt2 = number_format($totalAmt2, 2, '.', '');
        $totalAmt1 = bcadd($paypal_amount, $paypal_donation, 4);
        $totalAmt1 = number_format($totalAmt1, 2, '.', '');
        $option = 1;
        ?>
<script type="text/javascript" src="includes/scripts/generic.js?q=<?php 
        echo RANDOM_NUMBER;
        ?>
"></script>
예제 #5
0
 public function sendRepaidGainMailToLender($loanid, $lemail, $borrowerid, $bname, $loan_amt, $repaid_amt, $gain_amt, $gain_percent, $purpose)
 {
     global $database, $form;
     $templet = "editables/email/hero.html";
     require "editables/mailtext.php";
     $loanprurl = getLoanprofileUrl($borrowerid, $loanid);
     $params['link'] = SITE_URL . $loanprurl;
     $params['bname'] = ucwords(strtolower($bname));
     $params['purpose'] = ucwords(strtolower($purpose));
     $params['loan_amt'] = number_format(truncate_num(round($loan_amt, 4), 2), 2, ".", ",");
     $params['repaid_amt'] = number_format(truncate_num(round($repaid_amt, 4), 2), 2, ".", ",");
     $params['gain_amt'] = number_format(truncate_num(round($gain_amt, 4), 2), 2, ".", ",");
     $params['gain_percent'] = number_format($gain_percent);
     $Subject = $this->formMessage($lang['mailtext']['RepaidGain-subject'], $params);
     $message = $this->formMessage($lang['mailtext']['RepaidGain-msg'], $params);
     $reply = $this->mailSendingHtml($From, '', $lemail, $Subject, '', $message, 0, $templet, 3, REPAID_GAIN_TAG, $params);
 }
예제 #6
0
    $CreditAvailable = $session->amountToUseForBid($session->userid);
    if (isset($_SESSION['auto_lend'])) {
        if (isset($_SESSION['AutoLendAcitavted'])) {
            $activated = 'Automated lending has been activated for your account.';
        } else {
            $activated = 'Automated lending has been deactivated for your account.';
        }
        if (isset($_SESSION['StatusNotchanged'])) {
            $text = 'Your preferences have been saved.';
        } else {
            if (isset($_SESSION['AutoLendCurrentCreditYes']) && isset($_SESSION['AutoLendAcitavted'])) {
                $CreditAvail = number_format(truncate_num(round($CreditAvailable, 4), 2), 2, '.', ',');
                $text = $activated . "<br/><br/>" . "Your credit available for automated lending is USD " . $CreditAvail . ". This balance will be automatically bid in \$10 increments once every 24 hours.";
            } else {
                if (isset($_SESSION['AutoLendAcitavted'])) {
                    $CreditAvail = number_format(truncate_num(round($CreditAvailable, 4), 2), 2, '.', ',');
                    $text = $activated . "<br/><br/>" . "Your automated lending preferences will be applied to loan repayments that are credited to your account in the future. Automated lending will not apply to your current credit balance of USD " . $CreditAvail . ".";
                } else {
                    if (empty($text)) {
                        $text = $activated;
                    }
                }
            }
        }
        ?>
							<script type="text/javascript">
							$(document).ready(function() {
								$('a[rel*=facebox]').facebox({

									loadingImage : '<?php 
        echo SITE_URL;
예제 #7
0
                <p><strong><span><?php 
        echo $lang['loginform']['total_avl_amt'];
        ?>
:</span> USD 
                <?php 
        $amtUseforbid = round($session->amountToUseForBid($userid), 4);
        $amtincart = $database->getAmtinLendingcart($userid);
        if (isset($_SESSION['Nodonationincart'])) {
            $creditavail = $amtUseforbid - $amtincart['amt'];
        } else {
            $creditavail = $amtUseforbid - $amtincart['amt'] - $amtincart['donation'];
        }
        if ($creditavail < 0) {
            $creditavail = 0;
        }
        echo number_format(truncate_num($creditavail, 4, 2), 2, '.', ',');
        ?>
</p>
                <p><?php 
        $creditincart = $amtUseforbid - $creditavail;
        if ($creditincart > 0) {
            ?>
<tr style="height:6px"><td></td></tr>
                                        <?php 
            echo "<td width='250px'>Credit In Lending Cart: </td><td>USD " . number_format($creditincart, 2, ".", ",") . "</td>";
        }
        ?>
</p>
                <p><span><?php 
        echo $lang['loginform']['amount_invested'];
        ?>
예제 #8
0
                                $rows['txn_desc'] = "Credit back: cancelled loan for " . $borrower_name;
                            } else {
                                $rows['txn_desc'] = "Credit back from bid on loan for " . $borrower_name;
                            }
                        }
                    }
                }
            }
            if ($rows['loanid'] == 0) {
                echo "<td>" . $rows['txn_desc'] . "</td>";
            } else {
                $loanprofileurl = getLoanprofileUrl($borrower_id, $rows['loanid']);
                echo "<td><a href='" . $loanprofileurl . "'>" . $rows['txn_desc'] . "</a></td>";
            }
            echo "<td>" . number_format(truncate_num(round($rows['amount'], 4), 2), 2, ".", ",") . "</td>";
            echo "<td>" . number_format(truncate_num(round($rows['bal'], 4), 2), 2, ".", ",") . "</td>";
            echo "</tr>";
        }
        ?>
				</tbody>
			</table>
			<div id="pageNavPosition" align='center'></div>
			<div align='right'><font color='blue'>Total Records  <?php 
        echo $count;
        ?>
</font></div>
			<p>&nbsp;</p>
			<script type="text/javascript">
				var pager = new Pager('transtable', 100);
				pager.init();
				pager.showPageNav('pager', 'pageNavPosition');
예제 #9
0
 function automaticLending()
 {
     global $session, $form;
     $_POST = sanitize_custom($_POST);
     $userid = $session->userid;
     $availableAmt = $session->amountToUseForBid($userid);
     $availableAmt = truncate_num($availableAmt, 2);
     $autoLend = $session->automaticLending($_POST['status'], $_POST['priority'], $_POST['interest_rate'], $_POST['interest_rate_other'], $_POST['max_interest_rate'], $_POST['max_interest_rate_other'], $_POST['confirm_criteria'], $userid, $availableAmt);
     if ($autoLend == 0) {
         $_SESSION['value_array'] = $_POST;
         $_SESSION['error_array'] = $form->getErrorArray();
     }
     header("Location: index.php?p=74");
     exit;
 }
예제 #10
0
						<td >Subtotal</td>
						<td >USD <?php 
        echo number_format($amtincart, 2, ".", ",");
        ?>
</td>
						<td> 
						</td>
				</tr> 
			<tbody>
		</table>
		<?php 
        $amount_to_use_for_bid = truncate_num(round($session->amountToUseForBid($session->userid), 4), 2);
        $lender_invite_credit = 0;
        $lender_invite_credit_to_use_for_bid = 0;
        if ($session->userid) {
            $lender_invite_credit = truncate_num(round($session->lenderInviteCredit($session->userid), 4), 2);
            $lender_invite_credit_to_use_for_bid = $session->lenderInviteCreditToUseForBid($session->userid);
        }
        $amountavail = $amount_to_use_for_bid + $lender_invite_credit_to_use_for_bid;
        if (isset($_SESSION['Nodonationincart'])) {
            $donation = $_SESSION['Nodonationincart'];
        } elseif (isset($lending_cart_values['paypal_donation'])) {
            $donation = number_format($lending_cart_values['paypal_donation'], 2, ".", "");
        } elseif ($lender_invite_credit_to_use_for_bid) {
            $donation = number_format(($donateamt - $lender_invite_credit_to_use_for_bid) * 15 / 100, 2, ".", "");
        } else {
            $donation = number_format($donateamt * 15 / 100, 2, ".", "");
        }
        $transfee = 0;
        $TotalpaymentOrg = 0;
        $Totalpayment = 0;