egroupware_official/admin/groups.php

76 lines
3.0 KiB
PHP
Raw Normal View History

2000-08-18 05:24:22 +02:00
<?php
/**************************************************************************\
* phpGroupWare - administration *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$phpgw_info["flags"]["currentapp"] = "admin";
2000-08-18 05:24:22 +02:00
include("../header.inc.php");
if (! $start)
$start = 0;
if ($order)
$ordermethod = "order by $order $sort";
else
$ordermethod = "order by group_name asc";
if (! $sort)
$sort = "asc";
if ($query) {
$querymethod = " where group_name like '%$query%'";
}
$phpgw->db->query("select count(*) from groups $querymethod");
$phpgw->db->next_record();
$total = $phpgw->db->f(0);
$limit = $phpgw->nextmatchs->sql_limit($start);
echo '<p><table border="0" width="45%" align="center"><tr bgcolor="'
. $phpgw_info["theme"][bg_color] . '">'
. '<td align="left">' . $phpgw->nextmatchs->left("groups.php",$start,$total) . '</td>'
2000-09-07 22:49:55 +02:00
. '<td align="center">' . lang("user groups") . '</td>'
. '<td align="right">' . $phpgw->nextmatchs->right("groups.php",$start,$total) . '</td>'
. '</tr></table>';
echo "<table border=0 width=45% align=center>"
. "<tr bgcolor=" . $phpgw_info["theme"]["th_bg"] . "><td>"
. $phpgw->nextmatchs->show_sort_order($sort,"group_name",$order,"groups.php",
2000-09-07 22:49:55 +02:00
lang("name")) . "</td>"
. "<td> " . lang("Edit") . " </td> <td> " . lang("Delete")
2000-08-18 05:24:22 +02:00
. " </td> </tr>";
$phpgw->db->query("select * from groups $querymethod $ordermethod limit $limit");
2000-08-18 05:24:22 +02:00
while ($phpgw->db->next_record()) {
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
$group_name = $phpgw->db->f("group_name");
if (! $group_name) $group_name = '&nbsp;';
echo "<tr bgcolor=$tr_color><td>$group_name</td>"
. "<td width=5%><a href=\"" . $phpgw->link("editgroup.php","group_id=" . $phpgw->db->f("group_id"))
2000-09-07 22:49:55 +02:00
. "\"> " . lang("Edit") . " </a></td>" . "<td width=5%><a href=\""
2000-08-18 05:24:22 +02:00
. $phpgw->link("deletegroup.php","group_id=" . $phpgw->db->f("group_id"))
2000-09-07 22:49:55 +02:00
. "\"> " . lang("Delete") . " </a></td>";
2000-08-18 05:24:22 +02:00
}
2000-09-03 22:25:31 +02:00
echo "\n<form method=POST action=\"".$phpgw->link("newgroup.php")."\">"
. "</table></center>"
. "<table border=0 width=45% align=center><tr><td align=left><input type=\"submit\" "
2000-09-07 22:49:55 +02:00
. "value=\"" . lang("Add") . "\"></form><form action=\"".$phpgw->link("groups.php")."\"></td>"
. "<td align=right>" . lang("search") . "&nbsp;"
. "<input name=\"query\"></td></tr></form></table>";
2000-08-18 05:24:22 +02:00
include($phpgw_info["server"]["api_dir"] . "/footer.inc.php");