]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-admins_mails.php
More HTML rewrites
[mailer.git] / inc / modules / admin / what-admins_mails.php
index 21ad2e4bdb11bfe6324953b55dcc4cd2be902cfe..995060ba3ae40523e4f47e7469b455474efb6204 100644 (file)
@@ -39,7 +39,7 @@
 // Some security stuff...
 if ((!defined('__SECURITY')) || (!isAdmin())) {
        die();
-}
+} // END - if
 
 // Add description as navigation point
 addMenuDescription('admin', __FILE__);
@@ -49,13 +49,13 @@ if (isPostRequestElementSet('edit')) {
        if (countPostSelection() > 0) {
                // Add option for events
                $adminsList = generateOptionList('admins', 'id', 'login', '', 'email');
-               $SW = 2; $rowNameS = '';
+               $SW = 2; $rows = '';
                foreach (postRequestElement('sel') as $template => $sel) {
                        // First of all load data from DB
-                       $result = SQL_QUERY_ESC("SELECT `admin_id`, `id`, `mail_template` FROM `{?_MYSQL_PREFIX?}_admins_mails` WHERE `mail_template`='%s' ORDER BY `id` ASC",
+                       $result = SQL_QUERY_ESC("SELECT `admin_id`, `id` FROM `{?_MYSQL_PREFIX?}_admins_mails` WHERE `mail_template`='%s' ORDER BY `id` ASC",
                                array($template), __FILE__, __LINE__);
                        $OUT = '';
-                       $adminId2 = '0';
+                       $adminId2 = '0'; $id = '0';
                        while ($content = SQL_FETCHARRAY($result)) {
                                // @TODO Can this be rewritten???
                                $OUT .= "<select name=\"admin_id[".$content['id']."]\" size=\"1\" class=\"admin_select\">
@@ -72,15 +72,17 @@ if (isPostRequestElementSet('edit')) {
 
                                // Transfer ids
                                $adminId2 = $content['admin_id'];
-                               $id2 = $content['id'];
+                               $id = $content['id'];
                        } // END - while
 
                        // Free memory
                        SQL_FREERESULT($result);
 
                        // Prepare content
-                       $content['sw']     = $SW;
-                       $content['admins'] = $adminsList;
+                       $content['id']            = $id;
+                       $content['sw']            = $SW;
+                       $content['mail_template'] = $template;
+                       $content['admins']        = $adminsList;
 
                        if ($adminId2 > 0) {
                                // Add form for an additional admin
@@ -91,12 +93,12 @@ if (isPostRequestElementSet('edit')) {
                        $content['content'] = $OUT;
 
                        // Start outputing line
-                       $rowNameS .= loadTemplate('admin_admins_mails_edit_row', true, $content);
+                       $rows .= loadTemplate('admin_admins_mails_edit_row', true, $content);
                        $SW = 3 - $SW;
                }
 
                // Edit checked entries
-               loadTemplate('admin_admins_mails_edit', false, $rowNameS);
+               loadTemplate('admin_admins_mails_edit', false, $rows);
        } else {
                // Nothing selected
                loadTemplate('admin_settings_saved', false, getMessage('ADMINS_NO_MAIL_CHECKED'));