X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-admins_mails.php;h=bc6ff230aac9e850ffc669985e5a52a78f1d999c;hb=ff9e8f739bd4b6e184b2a6bf427334196e501da8;hp=753cf83265543dfc205822623dde27ff731d399c;hpb=7f5ffcc103a856b8867ac5739dcf0a3b6710413a;p=mailer.git diff --git a/inc/modules/admin/what-admins_mails.php b/inc/modules/admin/what-admins_mails.php index 753cf83265..bc6ff230aa 100644 --- a/inc/modules/admin/what-admins_mails.php +++ b/inc/modules/admin/what-admins_mails.php @@ -47,10 +47,10 @@ addMenuDescription('admin', __FILE__); if (isFormSent('edit')) { // Check if entires are checked - if (countPostSelection() > 0) { + if (ifPostContainsSelections()) { // Add option for events $adminsList = generateOptionList('admins', 'id', 'login', '', 'email'); - $SW = 2; $rows = ''; + $rows = ''; foreach (postRequestParameter('sel') as $template => $sel) { // First of all load data from DB $result = SQL_QUERY_ESC("SELECT `admin_id`, `id` FROM `{?_MYSQL_PREFIX?}_admins_mails` WHERE `mail_template`='%s' ORDER BY `id` ASC", @@ -81,7 +81,6 @@ if (isFormSent('edit')) { // Prepare content $content['id'] = $id; - $content['sw'] = $SW; $content['mail_template'] = $template; $content['admins'] = $adminsList; @@ -95,8 +94,7 @@ if (isFormSent('edit')) { // Start outputing line $rows .= loadTemplate('admin_admins_mails_edit_row', true, $content); - $SW = 3 - $SW; - } + } // END - foreach // Edit checked entries loadTemplate('admin_admins_mails_edit', false, $rows); @@ -120,7 +118,7 @@ ORDER BY m.admin_id ASC, m.mail_template ASC", __FILE__, __LINE__); - if (SQL_NUMROWS($result) > 0) { + if (!SQL_HASZERONUMS($result)) { // Shall I change entries? if (isFormSent('change')) { // Init SQLs @@ -169,14 +167,10 @@ ORDER BY } // END - if // List found entries - $OUT = ''; $SW = 2; + $OUT = ''; while ($content = SQL_FETCHARRAY($result)) { - // Prepare content - $content['sw'] = $SW; - // Load row template $OUT .= loadTemplate('admin_admins_mails_list_row', true, $content); - $SW = 3 - $SW; } // END - while // Free result