fetch_all_by_groupid($_GET['delete']);
foreach($query as $g) {
$gids[] = $g['groupid'];
}
if($gids) {
C::t('common_usergroup')->delete($gids);
C::t('common_usergroup_field')->delete($gids);
C::t('common_admingroup')->delete($gids);
$newgroupid = C::t('common_usergroup')->fetch_new_groupid();
C::t('common_member')->update_by_groupid($gids, array('groupid' => $newgroupid, 'adminid' => '0'), 'UNBUFFERED');
deletegroupcache($gids);
}
}
$grouplist = C::t('common_admingroup')->fetch_all_merge_usergroup();
if(!submitcheck('groupsubmit')) {
shownav('user', 'nav_admingroups');
showsubmenu('nav_admingroups');
showtips('admingroup_tips');
showformheader('admingroup');
showtableheader('', 'fixpadding');
showsubtitle(array('', 'usergroups_title', '', 'type', 'admingroup_level', 'usergroups_stars', 'usergroups_color',
' '.$lang['multiedit'].'',
' '.$lang['multiedit'].'',
));
foreach($grouplist as $gid => $group) {
$adminidselect = '';
showtablerow('', array('', '', 'class="td23 lightfont"', 'class="td25"', '', 'class="td25"'), array(
$group['type'] == 'system' ? '' : "",
''.$group['grouptitle'].'',
"(groupid:$group[groupid])",
$group['type'] == 'system' ? cplang('inbuilt') : cplang('custom'),
$group['type'] == 'system' ? $lang['usergroups_system_'.$group['radminid']] : $adminidselect,
"",
"",
"$lang[admingroup_setting_user]",
"$lang[admingroup_setting_admin]"
));
}
showtablerow('', array('class="td25"', '', '', '', 'colspan="6"'), array(
cplang('add_new'),
'',
'',
cplang('custom'),
"