From: Roland Häder Date: Fri, 30 Oct 2009 06:54:50 +0000 (+0000) Subject: Now with more feedback if no payout types are found X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=13047636247c7957173255a7a77010b7cc104898;p=mailer.git Now with more feedback if no payout types are found --- diff --git a/inc/modules/member/what-payout.php b/inc/modules/member/what-payout.php index 120c40a650..26edc53532 100644 --- a/inc/modules/member/what-payout.php +++ b/inc/modules/member/what-payout.php @@ -53,7 +53,7 @@ if ((!isExtensionActive('payout')) && (!isAdmin())) { return; } // END - if -$result_depths = SQL_QUERY("SELECT level, percents FROM `{?_MYSQL_PREFIX?}_refdepths` ORDER BY level", __FILE__, __LINE__); +$result_depths = SQL_QUERY("SELECT `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` ORDER BY level", __FILE__, __LINE__); $totalPoints = 0; while ($content = SQL_FETCHARRAY($result_depths)) { // Load referal points @@ -71,7 +71,7 @@ while ($content = SQL_FETCHARRAY($result_depths)) { // Free result SQL_FREERESULT($result_points); -} +} // END - while // Free memory SQL_FREERESULT($result_depths); @@ -87,10 +87,14 @@ if (empty($totalPoints)) $totalPoints = '0.00000'; if (!isGetRequestElementSet('payout')) { // Load payout types - $result = SQL_QUERY_ESC("SELECT id, type, rate, min_points, allow_url -FROM `{?_MYSQL_PREFIX?}_payout_types` -WHERE %s >= min_points -ORDER BY type ASC", + $result = SQL_QUERY_ESC("SELECT + `id`, `type`, `rate`, `min_points`, `allow_url` +FROM + `{?_MYSQL_PREFIX?}_payout_types` +WHERE + %s >= `min_points` +ORDER BY + `type` ASC", array($totalPoints), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Free memory @@ -160,6 +164,9 @@ ORDER BY // Output payout list outputPayoutList($totalPoints); + } else { + // No payout types setup + loadTemplate('admin_settings_saved', false, geMessage('PAYOUT_NO_PAYOUT_TYPES')); } } else { // Chedk if he can get paid by selected type