X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-payout.php;h=731a00f42c421d303bbf780ed7e2040ebd6c23b0;hp=366aa4fffb942812e6ab438db0b4b39c9ccd2d0e;hb=4f7df133f736da124e6f7bd02008b9093f736451;hpb=20741b93fd58620af677a7f1039ffd16ea6ec689 diff --git a/inc/modules/member/what-payout.php b/inc/modules/member/what-payout.php index 366aa4fffb..731a00f42c 100644 --- a/inc/modules/member/what-payout.php +++ b/inc/modules/member/what-payout.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * + * Copyright (c) 2009 - 2012 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -38,7 +38,7 @@ // Some security stuff... if (!defined('__SECURITY')) { // Don't call this directly! - die(); + exit(); } elseif (!isMember()) { // Not logged in redirectToIndexMemberOnlyModule(); @@ -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'] = '{--CLICK_HERE--}'; + $content['target_bank'] = '{--CLICK_HERE--}'; } // 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