set_filenames(array('group_list' => 'admin/group_list.tpl')); $template->assign_vars( array( 'F_ADD_ACTION' => add_session_id(PHPWG_ROOT_PATH.'admin.php?page=group_list') ) ); // +-----------------------------------------------------------------------+ // | group list | // +-----------------------------------------------------------------------+ $query = ' SELECT id, name FROM '.GROUPS_TABLE.' ORDER BY id ASC ;'; $result = pwg_query($query); $admin_url = PHPWG_ROOT_PATH.'admin.php?page='; $perm_url = $admin_url.'group_perm&group_id='; $del_url = $admin_url.'group_list&delete='; $members_url = $admin_url.'user_list&group='; $num = 0; while ($row = mysql_fetch_array($result)) { $query = ' SELECT COUNT(*) FROM '.USER_GROUP_TABLE.' WHERE group_id = '.$row['id'].' ;'; list($counter) = mysql_fetch_row(pwg_query($query)); $template->assign_block_vars( 'group', array( 'CLASS' => ($num++ % 2 == 1) ? 'row2' : 'row1', 'NAME' => $row['name'], 'MEMBERS' => sprintf(l10n('%d members'), $counter), 'U_MEMBERS' => $members_url.$row['id'], 'U_DELETE' => add_session_id($del_url.$row['id']), 'U_PERM' => add_session_id($perm_url.$row['id']) ) ); } // +-----------------------------------------------------------------------+ // | sending html code | // +-----------------------------------------------------------------------+ $template->assign_var_from_handle('ADMIN_CONTENT', 'group_list'); ?>