* $Author:: $ *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team *
+ * Copyright (c) 2009 - 2013 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 = sqlQueryEscaped("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';
- while ($content = SQL_FETCHARRAY($result)) {
+ while ($content = sqlFetchArray($result)) {
// @TODO Can this be rewritten to an API function?
$OUT .= '<select name="admin_id[' . $content['id'] . ']" size="1" class="form_select">
<option value="0"';
} // END - while
// Free memory
- SQL_FREERESULT($result);
+ sqlFreeResult($result);
// Prepare content
$content['id'] = $id;
$content['mail_template'] = $template;
- $content['admins'] = generateOptions('admins', 'id', 'login', '', 'email');;
+ $content['admins'] = generateOptions('admins', 'id', 'login', '', 'email');
if (isValidId($adminId2)) {
// Add form for an additional admin
}
} else {
// Load all assigned mails
- $result = SQL_QUERY("SELECT
+ $result = sqlQuery("SELECT
`m`.`id`,
`m`.`admin_id`,
`a`.`login`,
`m`.`admin_id` ASC,
`m`.`mail_template` ASC", __FILE__, __LINE__);
- if (!SQL_HASZERONUMS($result)) {
+ if (!ifSqlHasZeroNums($result)) {
// Shall I change entries?
if (isFormSent('do_edit')) {
// Init SQLs
$content['admin_id'] = bigintval($content['admin_id']);
// Update entry
- addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins_mails` SET `admin_id`=%s WHERE `id`=%s ORDER BY `id` LIMIT 1",
+ addSql(sqlQueryEscaped("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));
if ((!isValidId($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'",
+ addSql(sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admins_mails` WHERE mail_template='%s' AND id != '%s'",
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')",
+ addSql(sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_admins_mails` (admin_id, mail_template) VALUES ('%s','%s')",
array($content['admin_id'], postRequestElement('template', $id)), __FILE__, __LINE__, FALSE));
} // END - if
} // END - foreach
runFilterChain('run_sqls');
// Query again...
- $result = SQL_QUERY("SELECT
+ $result = sqlQuery("SELECT
`m`.`id`,
`m`.`admin_id`,
`a`.`login`,
// List found entries
$OUT = '';
- while ($content = SQL_FETCHARRAY($result)) {
+ while ($content = sqlFetchArray($result)) {
// Load row template
$OUT .= loadTemplate('admin_admins_mails_list_row', TRUE, $content);
} // END - while
// Free result
- SQL_FREERESULT($result);
+ sqlFreeResult($result);
// Load template
loadTemplate('admin_admins_mails_list', FALSE, $OUT);