* $Author:: $ *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
$rows = '';
foreach (postRequestElement('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",
+ $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'; $id = '0';
$OUT .= '>{--ADMIN_ADMINS_TO_USER_EVENTS--}</option>';
} // END - if
- $OUT .= generateOptionList('admins', 'id', 'login', $content['admin_id'], 'email');
+ $OUT .= generateOptions('admins', 'id', 'login', $content['admin_id'], 'email');
$OUT .= '</select>';
// Transfer ids
// Prepare content
$content['id'] = $id;
$content['mail_template'] = $template;
- $content['admins'] = generateOptionList('admins', 'id', 'login', '', 'email');;
+ $content['admins'] = generateOptions('admins', 'id', 'login', '', 'email');;
- if ($adminId2 > 0) {
+ if (isValidUserId($adminId2)) {
// Add form for an additional admin
- $OUT .= loadTemplate('admin_admins_mails_edit_form', true, $content);
+ $OUT .= loadTemplate('admin_admins_mails_edit_form', TRUE, $content);
} // END - if
// Save full rendered content
$content['content'] = $OUT;
// Start outputing line
- $rows .= loadTemplate('admin_admins_mails_edit_row', true, $content);
+ $rows .= loadTemplate('admin_admins_mails_edit_row', TRUE, $content);
} // END - foreach
// Edit checked entries
- loadTemplate('admin_admins_mails_edit', false, $rows);
+ loadTemplate('admin_admins_mails_edit', FALSE, $rows);
} else {
// Nothing selected
displayMessage('{--ADMINS_NO_MAIL_CHECKED--}');
// Update entry
addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins_mails` SET `admin_id`=%s WHERE `id`=%s ORDER BY `id` LIMIT 1",
- array($content['admin_id'], $id), __FILE__, __LINE__, false));
+ array($content['admin_id'], $id), __FILE__, __LINE__, FALSE));
- if (($content['admin_id'] < 1) && (isPostRequestElementSet('template', $id))) {
+ if ((!isValidUserId($content['admin_id'])) && (isPostRequestElementSet('template', $id))) {
// Remove any other admin entries
addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admins_mails` WHERE mail_template='%s' AND id != '%s'",
- array(postRequestElement('template', $id), $id), __FILE__, __LINE__, false));
+ array(postRequestElement('template', $id), $id), __FILE__, __LINE__, FALSE));
} // END - if
if (postRequestElement('admin_new', postRequestElement('template', $id)) > 0) {
// Add new admin
addSql(SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_admins_mails` (admin_id, mail_template) VALUES ('%s','%s')",
- array($content['admin_id'], postRequestElement('template', $id)), __FILE__, __LINE__, false));
+ array($content['admin_id'], postRequestElement('template', $id)), __FILE__, __LINE__, FALSE));
} // END - if
} // END - foreach
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// Load row template
- $OUT .= loadTemplate('admin_admins_mails_list_row', true, $content);
+ $OUT .= loadTemplate('admin_admins_mails_list_row', TRUE, $content);
} // END - while
// Free result
SQL_FREERESULT($result);
// Load template
- loadTemplate('admin_admins_mails_list', false, $OUT);
+ loadTemplate('admin_admins_mails_list', FALSE, $OUT);
} else {
// No entries found
displayMessage('{--ADMIN_ADMINS_MAILS_NO_ENTRIES--}');