query("delete from {chatgroup} where groupid = ?", array($groupid)); $db->query("delete from {chatgroupoperator} where groupid = ?", array($groupid)); $db->query("update {chatthread} set groupid = 0 where groupid = ?",array($groupid)); header("Location: $webimroot/operator/groups.php"); exit; } } function is_online($group) { return $group['ilastseen'] !== NULL && $group['ilastseen'] < Settings::get('online_timeout') ? "1" : ""; } function is_away($group) { return $group['ilastseenaway'] !== NULL && $group['ilastseenaway'] < Settings::get('online_timeout') ? "1" : ""; } $page = array(); $sort['by'] = verifyparam("sortby", "/^(name|lastseen|weight)$/", "name"); $sort['desc'] = (verifyparam("sortdirection", "/^(desc|asc)$/", "desc") == "desc"); $page['groups'] = get_sorted_groups($sort); $page['formsortby'] = $sort['by']; $page['formsortdirection'] = $sort['desc']?'desc':'asc'; $page['canmodify'] = is_capable($can_administrate, $operator); $page['availableOrders'] = array( array('id' => 'name', 'name' => getlocal('form.field.groupname')), array('id' => 'lastseen', 'name' => getlocal('page_agents.status')), array('id' => 'weight', 'name' => getlocal('page.groups.weight')) ); $page['availableDirections'] = array( array('id' => 'desc', 'name' => getlocal('page.groups.sortdirection.desc')), array('id' => 'asc', 'name' => getlocal('page.groups.sortdirection.asc')), ); prepare_menu($operator); start_html_output(); require('../view/groups.php'); ?>