]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_sponsor_pay.php
Removed comment introduced by Profi-Concept, this comment should fine (in a much...
[mailer.git] / inc / modules / admin / what-list_sponsor_pay.php
index b4636b937b3d8aa6e3cd204060f4efcb5bd72187..70d261837529304589104514aa09df823ebbbf83 100644 (file)
@@ -14,8 +14,6 @@
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
@@ -57,12 +55,12 @@ if (isFormSent('add')) {
        if ((postRequestParameter('pay_min_count') == '0') || (!isPostRequestParameterSet('pay_min_count'))) unsetPostRequestParameter('add');
        if (!isPostRequestParameterSet('pay_currency')) unsetPostRequestParameter('add');
 
-} elseif ((isFormSent('edit')) || (isFormSent('del')) || (isFormSent('change')) || (isFormSent('remove'))) {
+} elseif ((isFormSent('edit')) || (isFormSent('delete')) || (isFormSent('change')) || (isFormSent('remove'))) {
        // Check if at least one entry was selected
        if (!isPostRequestParameterSet('id')) {
                // Nothing selected for editing / deleting???
                unsetPostRequestParameter('edit');
-               unsetPostRequestParameter('del');
+               unsetPostRequestParameter('delete');
                unsetPostRequestParameter('change');
                unsetPostRequestParameter('remove');
        } elseif (isFormSent('change')) {
@@ -80,7 +78,7 @@ SET
        `pay_min_count`='%s',
        `pay_currency`='%s'
 WHERE
-       `id`='%s'
+       `id`=%s
 LIMIT 1",
                        array(
                                postRequestParameter('name', $id),
@@ -97,7 +95,7 @@ LIMIT 1",
                // Remove entries here...
                foreach (postRequestParameter('id') as $id => $sel) {
                        // Remove entry
-                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `id`='%s' LIMIT 1",
+                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `id`=%s LIMIT 1",
                                array(bigintval($id)), __FILE__, __LINE__);
                }
 
@@ -137,27 +135,16 @@ if (isFormSent('add')) {
 
        // Output message
        loadTemplate('admin_settings_saved', false, $message);
-} elseif ((isFormSent('edit')) || (isFormSent('del'))) {
+} elseif ((isFormSent('edit')) || (isFormSent('delete'))) {
        // Load all data
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        foreach (postRequestParameter('id') as $id => $sel) {
                // Load entry
-               $result = SQL_QUERY_ESC("SELECT `pay_name`, `pay_rate`, `pay_min_count`, `pay_currency` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `id`='%s' LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT `id`, `pay_name`, `pay_rate`, `pay_min_count`, `pay_currency` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `id`=%s LIMIT 1",
                        array(bigintval($id)), __FILE__, __LINE__);
                if (SQL_NUMROWS($result) == 1) {
                        // Load data
-                       list($name, $rate, $min, $curr) = SQL_FETCHROW($result);
-                       SQL_FREERESULT($result);
-
-                       // Transfer data to array
-                       $content = array(
-                               'id'   => bigintval($id),
-                               'sw'   => bigintval($SW),
-                               'name' => htmlspecialchars($name),
-                               'rate' => translateComma($rate),
-                               'min'  => bigintval($min),
-                               'curr' => htmlspecialchars($curr)
-                       );
+                       $content = SQL_FETCHARRAY($result);
 
                        if (isFormSent('edit')) {
                                // Edit entry
@@ -171,8 +158,8 @@ if (isFormSent('add')) {
                        $OUT .= loadTemplate('admin_list_sponsor_pay_404', true, $id);
                }
 
-               // Switch colors
-               $SW = 3 - $SW;
+               // Free result
+               SQL_FREERESULT($result);
        } // END - foreach
 
        // Load main template depending on mode (edit/delete)
@@ -194,27 +181,14 @@ ORDER BY
                __FILE__, __LINE__);
 
        // Do we have some paytypes setup?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Prepare variables for listing
-               $OUT = ''; $SW = 2;
+               $OUT = '';
 
                // List alle found payment types
                while ($content = SQL_FETCHARRAY($result)) {
-                       // Remember data in array
-                       $content = array(
-                               'sw'       => $SW,
-                               'id'       => $content['id'],
-                               'name'     => $content['pay_name'],
-                               'rate'     => translateComma($content['pay_rate']),
-                               'min'      => $content['pay_min_count'],
-                               'currency' => $content['pay_currency']
-                       );
-
                        // Add row
                        $OUT .= loadTemplate('admin_list_sponsor_pay_row', true, $content);
-
-                       // Switch colors
-                       $SW = 3 - $SW;
                } // END - while
 
                // Load list template