"admin", "enable_nextmatchs_class" => True); include("../header.inc.php"); function account_total($query) { global $phpgw; if ($query) { $querymethod = " AND account_firstname LIKE '%$query%' OR account_lastname LIKE " . "'%$query%' OR account_lid LIKE '%$query%' "; } $phpgw->db->query("SELECT COUNT(*) FROM phpgw_accounts WHERE account_type='g'".$querymethod,__LINE__,__FILE__); $phpgw->db->next_record(); return $phpgw->db->f(0); } $p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin')); $p->set_file(array( 'list' => 'groups.tpl', 'row' => 'groups_row.tpl', 'empty_row' => 'accounts_row_empty.tpl' )); $account_info = $phpgw->accounts->get_list('groups',$start,$sort, $order, $query, $total); $total = account_total($query); $p->set_var("th_bg",$phpgw_info["theme"]["th_bg"]); $p->set_var("left_nextmatchs",$phpgw->nextmatchs->left("/admin/groups.php",$start,$total)); $p->set_var("right_nextmatchs",$phpgw->nextmatchs->right("/admin/groups.php",$start,$total)); $p->set_var("lang_groups",lang("user groups")); $p->set_var("sort_name",$phpgw->nextmatchs->show_sort_order($sort,"account_lid",$order,"groups.php",lang("name"))); $p->set_var("header_edit",lang("Edit")); $p->set_var("header_delete",lang("Delete")); $account_info = $phpgw->accounts->get_list('groups',$start,$sort, $order, $query, $total); if (! count($account_info)) { $p->set_var('message',lang('No matchs found')); $p->parse('rows','empty_row',True); } else { while (list($null,$account) = each($account_info)) { $account_id = $account['account_id']; $group_name = $account['account_lid']; $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); $p->set_var("tr_color",$tr_color); if (! $group_name) $group_name = ' '; $p->set_var("group_name",$group_name); $p->set_var("edit_link",' ' . lang("Edit") . ' '); $p->set_var("delete_link",' ' . lang("Delete") . ' '); $p->parse("rows","row",True); } } $p->set_var("new_action",$phpgw->link("/admin/newgroup.php")); $p->set_var("lang_add",lang("add")); $p->set_var("search_action",$phpgw->link("/admin/groups.php")); $p->set_var("lang_search",lang("search")); $p->pparse("out","list"); $phpgw->common->phpgw_footer(); ?>