if ($SEL > 0)
{
// Add option for userlog
- $ADMINS = ADD_OPTION_LINES("admins", "id", "login", "", "email");
- $SW = 2; $ROWS = "";
- foreach ($_POST['sel'] as $template=>$sel)
+ $cacheArray['admins'] = ADD_OPTION_LINES("admins", "id", "login", "", "email");
+ $SW = 2; $rowNameS = "";
+ foreach ($_POST['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",
array($template), __FILE__, __LINE__);
- $OUT = ""; $aid = "0"; $aid2 = "0";
+ $OUT = ""; $aid = 0; $aid2 = 0;
while (list($aid, $id) = SQL_FETCHROW($result))
{
$OUT .= "<SELECT name=\"admin_id[".$id."]\" size=\"1\" class=\"admin_select\">
$OUT .= ">".ADMINS_TO_USERLOG."</OPTION>\n";
}
$OUT .= ADD_OPTION_LINES("admins", "id", "login", $aid, "email");
- $OUT .= "</SELECT><BR>\n";
+ $OUT .= "</SELECT><br />\n";
$aid2 = $aid; $id2 = $id;
}
'id' => $id,
'id2' => $id2,
'tpl' => $template,
- 'admins' => $ADMINS
+ 'admins' => $cacheArray['admins']
);
if ($aid2 > 0)
$content['content'] = $OUT;
// Start outputing line
- $ROWS .= LOAD_TEMPLATE("admin_admins_mails_edit_row", true, $content);
+ $rowNameS .= LOAD_TEMPLATE("admin_admins_mails_edit_row", true, $content);
$SW = 3 - $SW;
}
- define('__ADMINS_ROWS', $ROWS);
+ define('__ADMINS_ROWS', $rowNameS);
// Edit checked entries
LOAD_TEMPLATE("admin_admins_mails_edit");
if (isset($_POST['change']))
{
// Ok, update database
- foreach ($_POST['admin_id'] as $id=>$aid)
+ foreach ($_POST['admin_id'] as $id => $aid)
{
// Secure IDs
$id = bigintval($id);
$aid = bigintval($aid);
// Update entry
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admins_mails SET admin_id=%d WHERE id=%d ORDER BY id LIMIT 1",
+ $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admins_mails SET admin_id=%s WHERE id=%s ORDER BY id LIMIT 1",
array($aid, $id), __FILE__, __LINE__);
if (($aid < 1) && (!empty($_POST['template'][$id])))