Now with more feedback if no payout types are found
authorRoland Häder <roland@mxchange.org>
Fri, 30 Oct 2009 06:54:50 +0000 (06:54 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 30 Oct 2009 06:54:50 +0000 (06:54 +0000)
inc/modules/member/what-payout.php

index 120c40a..26edc53 100644 (file)
@@ -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