function gs_group_members_purge_by_type($type, $member_ids) { $db_slave = gs_db_slave_connect(); if (!$db_slave) { return new GsError('Could not connect to database.'); } if (!in_array($type, gs_group_types_get())) { return new GsError('Invalid group type.'); } $sql_query = 'SELECT `id` FROM `groups` WHERE `type` = \'' . $db_slave->escape($type) . '\''; $rs = $db_slave->execute($sql_query); $group_ids = array(); if ($rs) { while ($r = $rs->fetchRow()) { $group_ids[] = $r['id']; } } if ($group_ids) { $ret = gs_group_members_purge($group_ids, $member_ids); } return $ret; }
echo '</td>', "\n"; echo '</tr>', "\n"; $i = 0; echo '<form method="post" action="' . GS_URL_PATH . '">', "\n"; echo gs_form_hidden($SECTION, $MODULE); echo '<input type="hidden" name="action" value="add" />', "\n"; echo '<tr class="', $i % 2 === 0 ? 'odd' : 'even', '">', "\n"; echo '<td class="l nobr">', "\n"; echo '<input type="text" name="name" value="" size="20" maxlength="20" />', "\n"; echo '</td>', "\n"; echo '<td class="l nobr">', "\n"; echo '<input type="text" name="title" value="" size="25" maxlength="50" style="width:96%;" />', "\n"; echo '</td>', "\n"; echo '<td>', "\n"; echo '<select name="type">', "\n"; foreach (gs_group_types_get() as $group_type) { echo '<option value="', $group_type, '">', $group_type, '</option>', "\n"; } echo '</select>', "\n"; echo '</td>', "\n"; echo '<td class="r" colspan="3"> <br />', "\n"; echo '<button type="submit" class="plain" title="', __('Speichern'), '"><img alt="', __('Speichern'), '" src="', GS_URL_PATH, 'crystal-svg/16/act/filesave.png" /></button>'; echo '</td>', "\n"; echo '</tr>', "\n"; echo '</form>', "\n"; ++$i; } ?> </tbody> </table>