A lot code rewritten:
[mailer.git] / inc / modules / admin / what-payments.php
index f61bf694f1684af704e189857c67cb7e3f6625f0..e5bf264a68f9f42945c946dd504861bb26b72afb 100644 (file)
@@ -91,7 +91,7 @@ if (isFormSent()) {
        loadTemplate('admin_settings_saved', false, $content);
 } elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
        // Delete entries here
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        foreach (postRequestParameter('sel') as $id => $value) {
                $result = SQL_QUERY_ESC("SELECT time, mail_title FROM `{?_MYSQL_PREFIX?}_payments` WHERE `id`=%s LIMIT 1",
                array(bigintval($id)), __FILE__, __LINE__);
@@ -100,7 +100,6 @@ if (isFormSent()) {
 
                // Prepare array for the row template
                $content = array(
-                       'sw'    => $SW,
                        'id'    => $id,
                        'time'  => $time,
                        'title' => $title,
@@ -108,14 +107,13 @@ if (isFormSent()) {
 
                // Load row template and switch colors
                $OUT .= loadTemplate('admin_del_payments_row', true, $content);
-               $SW = 3 - $SW;
-       }
+       } // END - foreach
 
        // Load main template
        loadTemplate('admin_del_payments', false, $OUT);
 } elseif ((isFormSent('edit')) && (countPostSelection() > 0)) {
        // Edit entries
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        foreach (postRequestParameter('sel') as $id => $value) {
                $result = SQL_QUERY_ESC("SELECT time, payment, mail_title, price FROM `{?_MYSQL_PREFIX?}_payments` WHERE `id`=%s LIMIT 1",
                array(bigintval($id)), __FILE__, __LINE__);
@@ -124,7 +122,6 @@ if (isFormSent()) {
 
                // Prepare array for the row template
                $content = array(
-                       'sw'    => $SW,
                        'id'    => $id,
                        'time'  => $time,
                        'title' => $title,
@@ -134,8 +131,7 @@ if (isFormSent()) {
 
                // Load row template and switch colors
                $OUT .= loadTemplate('admin_edit_payments_row', true, $content);
-               $SW = 3 - $SW;
-       }
+       } // END - foreach
 
        // Load main template
        loadTemplate('admin_edit_payments', false, $OUT);
@@ -144,14 +140,13 @@ if (isFormSent()) {
        $result = SQL_QUERY("SELECT `id`, `time`, `payment`, `mail_title`, `price` FROM `{?_MYSQL_PREFIX?}_payments` ORDER BY `time` ASC", __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0) {
                // Make referal levels editable and deletable
-               $OUT = ''; $SW = 2;
+               $OUT = '';
 
                // List already existing categories for editing
                while ($content = SQL_FETCHARRAY($result)) {
                        // Prepare array for the row template
                        // @TODO Rewritings: title->mail_title in template
                        $content = array(
-                               'sw'      => $SW,
                                'id'      => $content['id'],
                                'time'    => $content['time'],
                                'title'   => $content['mail_title'],
@@ -161,7 +156,6 @@ if (isFormSent()) {
 
                        // Load row template and switch colors
                        $OUT .= loadTemplate('admin_payments_list_row', true, $content);
-                       $SW = 3 - $SW;
                } // END - switch
 
                // Free memory