* $Author:: $ *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2013 by Mailer Developer Team *
+ * Copyright (c) 2009 - 2015 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
// Translate point into comma
$payoutPoints = getPayoutPoints(getMemberId());
+// Output amount
+displayMessage('{%message,MEMBER_TOTAL_PAYOUT_POINTS=' . $payoutPoints . '%}');
+
+// GET parameter set?
if (!isGetRequestElementSet('payout')) {
// Load payout types
- $result = sqlQueryEscaped("SELECT
+ $result = sqlQueryEscaped('SELECT
`id`,
`type`,
`rate`,
WHERE
%s >= `min_points`
ORDER BY
- `type` ASC",
+ `type` ASC',
array($payoutPoints), __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
- // Free memory
- sqlFreeResult($result);
+ // Some entries found?
+ if (!ifSqlHasZeroNumRows($result)) {
// Check for his payouts
$result_payouts = sqlQueryEscaped('SELECT
`p`.`id`,
ORDER BY
`p`.`payout_timestamp` DESC',
array(getMemberId()), __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result_payouts)) {
+ if (!ifSqlHasZeroNumRows($result_payouts)) {
// List all his requests
$OUT = '';
while ($content = sqlFetchArray($result_payouts)) {
outputPayoutList($payoutPoints);
} else {
// No payout types setup
- displayMessage('{--MEMBER_PAYOUT_SETUP_INCOMPLETE--}');
+ displayMessage('{--MEMBER_PAYOUT_SETUP_INCOMPLETE_LOW_POINTS--}');
}
+
+ // Free memory
+ sqlFreeResult($result);
} else {
// Chedk if he can get paid by selected type
- $result = sqlQueryEscaped("SELECT `type`, `rate`, `min_points`, `allow_url` FROM `{?_MYSQL_PREFIX?}_payout_types` WHERE `id`=%s LIMIT 1",
+ $result = sqlQueryEscaped('SELECT
+ `type`,
+ `rate`,
+ `min_points`,
+ `allow_url`
+FROM
+ `{?_MYSQL_PREFIX?}_payout_types`
+WHERE
+ `id`=%s
+LIMIT 1',
array(bigintval(getRequestElement('payout'))), __FILE__, __LINE__);
if (sqlNumRows($result) == 1) {
if (isPostRequestElementSet('payout')) {
$points = bigintval(postRequestElement('payout')) / $content['rate'];
$PAY_MAX = $max / $content['rate'];
- }
+ } // END - if
// Has enougth points to payout?
if ($payoutPoints >= $content['min_points']) {