]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-payout.php
Filters for configurable userid exclusion added:
[mailer.git] / inc / modules / member / what-payout.php
index f3357acd3a871ed60fd9856744373f4f21382264..731a00f42c421d303bbf780ed7e2040ebd6c23b0 100644 (file)
@@ -58,7 +58,11 @@ $payoutPoints = getPayoutPoints(getMemberId());
 if (!isGetRequestElementSet('payout')) {
        // Load payout types
        $result = SQL_QUERY_ESC("SELECT
-       `id`,`type`,`rate`,`min_points`,`allow_url`
+       `id`,
+       `type`,
+       `rate`,
+       `min_points`,
+       `allow_url`
 FROM
        `{?_MYSQL_PREFIX?}_payout_types`
 WHERE
@@ -72,17 +76,27 @@ ORDER BY
 
                // Check for his payouts
                $result_payouts = SQL_QUERY_ESC("SELECT
-       p.id, p.payout_total, p.target_account, p.target_bank, t.type, p.payout_timestamp, p.status, t.allow_url AS allow, p.target_url AS url, p.link_text, p.banner_url AS banner
+       `p`.`id`,
+       `p`.`payout_total`,
+       `p`.`target_account`,
+       `p`.`target_bank`,
+       `t`.`type`,
+       `p`.`payout_timestamp`,
+       `p`.`status`,
+       `t`.`allow_url` AS `allow`,
+       `p`.`target_url` AS `url`,
+       `p`.`link_text`,
+       `p`.`banner_url` AS `banner`
 FROM
-       `{?_MYSQL_PREFIX?}_user_payouts` AS p
+       `{?_MYSQL_PREFIX?}_user_payouts` AS `p`
 LEFT JOIN
-       `{?_MYSQL_PREFIX?}_payout_types` AS t
+       `{?_MYSQL_PREFIX?}_payout_types` AS `t`
 ON
-       p.payout_id = t.id
+       `p`.`payout_id`=`t`.`id`
 WHERE
-       p.userid = %s
+       `p`.`userid`=%s
 ORDER BY
-       p.payout_timestamp DESC",
+       `p`.`payout_timestamp` DESC",
                        array(getMemberId()), __FILE__, __LINE__);
                if (!SQL_HASZERONUMS($result_payouts)) {
                        // List all his requests
@@ -98,18 +112,18 @@ ORDER BY
                                                // Textlink
                                                $content['target_account'] = $content['link_text'];
                                        }
-                                       $content['target_bank'] = '<a href="' . generateDerefererUrl($content['url']) . '" target="_blank">{--CLICK_HERE--}</a>';
+                                       $content['target_bank'] = '<a href="{%pipe,generateDereferrerUrl=' . $content['url'] . '%}" target="_blank">{--CLICK_HERE--}</a>';
                                } // END - if
 
                                // Prepare data for the template
                                $content['payout_timestamp'] = generateDateTime($content['payout_timestamp'], 2);
 
                                // Load row template and switch colors
-                               $OUT .= loadTemplate('member_payout_row', true, $content);
+                               $OUT .= loadTemplate('member_payout_row', TRUE, $content);
                        } // END - while
 
                        // Load template
-                       loadTemplate('member_payout', false, $OUT);
+                       loadTemplate('member_payout', FALSE, $OUT);
                } // END - if
 
                // Free memory
@@ -123,7 +137,7 @@ ORDER BY
        }
 } else {
        // Chedk if he can get paid by selected type
-       $result = SQL_QUERY_ESC("SELECT `type`,`rate`,`min_points`,`allow_url` AS allow FROM `{?_MYSQL_PREFIX?}_payout_types` WHERE `id`=%s LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT `type`, `rate`, `min_points`, `allow_url` AS `allow` FROM `{?_MYSQL_PREFIX?}_payout_types` WHERE `id`=%s LIMIT 1",
                array(bigintval(getRequestElement('payout'))), __FILE__, __LINE__);
 
        if (SQL_NUMROWS($result) == 1) {
@@ -155,7 +169,7 @@ ORDER BY
                                // Add entry to his tranfer history
                                if ($content['allow'] == 'Y') {
                                        // Banner/textlink ordered
-                                       SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_payouts` (`userid`,`payout_total`,`payout_id`,`payout_timestamp`,`status`,`target_url`,`link_text`,`banner_url`)
+                                       SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_payouts` (`userid`, `payout_total`, `payout_id`, `payout_timestamp`, `status`, `target_url`, `link_text`, `banner_url`)
 VALUES (%s,%s,%s, UNIX_TIMESTAMP(), 'NEW','%s','%s','%s')",
                                        array(
                                                getMemberId(),
@@ -175,7 +189,7 @@ VALUES (%s,%s,%s, UNIX_TIMESTAMP(), 'NEW','%s','%s','%s')",
                                        }
                                } else {
                                        // e-currency payout requested
-                                       SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_payouts` (`userid`,`payout_total`,`target_account`,`target_bank`,`payout_id`,`payout_timestamp`,`status`,`password`)
+                                       SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_payouts` (`userid`, `payout_total`, `target_account`, `target_bank`, `payout_id`, `payout_timestamp`, `status`, `password`)
 VALUES (%s,%s,%s,'%s',%s, UNIX_TIMESTAMP(), 'NEW','%s')",
                                        array(
                                                getMemberId(),
@@ -217,7 +231,7 @@ VALUES (%s,%s,%s,'%s',%s, UNIX_TIMESTAMP(), 'NEW','%s')",
                                );
 
                                // Generate banner order form
-                               loadTemplate('member_payout_form_banner', false, $content);
+                               loadTemplate('member_payout_form_banner', FALSE, $content);
                        } else {
                                // Prepare content
                                $content = array(
@@ -227,7 +241,7 @@ VALUES (%s,%s,%s,'%s',%s, UNIX_TIMESTAMP(), 'NEW','%s')",
                                );
 
                                // Generate normal form
-                               loadTemplate('member_payout_form', false, $content);
+                               loadTemplate('member_payout_form', FALSE, $content);
                        }
                } else {
                        // Not enougth points