- $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;
- while (list($aid, $id) = SQL_FETCHROW($result)) {
- // @TODO Can this be rewritten???
- $OUT .= "<select name=\"admin_id[".$id."]\" size=\"1\" class=\"admin_select\">
-<option value=\"0\"";
- if ($aid == "0") $OUT .= " selected=\"selected\"";
- $OUT .=">{--ADMINS_ALL_ADMINS--}</option>\n";
- if (EXT_IS_ACTIVE("events")) {
- $OUT .= "<option value=\"-1\"";
- if ($aid == "-1") $OUT .= " selected=\"selected\"";
- $OUT .= ">{--ADMINS_TO_USERLOG--}</option>\n";
+ $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';
+ while ($content = SQL_FETCHARRAY($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"';
+ if ($content['admin_id'] == '0') $OUT .= ' selected="selected"';
+ $OUT .= '>{--ADMIN_TO_ALL_ADMINS--}</option>';
+ if (isExtensionActive('events')) {
+ $OUT .= '<option value="-1"';
+ if ($content['admin_id'] == '-1') $OUT .= ' selected="selected"';
+ $OUT .= '>{--ADMIN_ADMINS_TO_USER_EVENTS--}</option>';