File: setup-groups-members.php3

package info (click to toggle)
irm 1.0.3-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 816 kB
  • ctags: 753
  • sloc: php: 3,440; sh: 346; makefile: 40
file content (63 lines) | stat: -rw-r--r-- 2,568 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?
#    IRM - The Information Resource Manager
#    Copyright (C) 1999 Yann Ramin
#
#    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.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License (in file COPYING) for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#    $Id: setup-groups-members.php3,v 1.2 2000/03/17 05:48:34 atrus Exp $
#
################################################################################
#                                  CHANGELOG                                   #
################################################################################
#  12/30/1999 Yann Ramin:	Added to allow editting of group members       #
################################################################################
include("../irm.inc");

AuthCheck("admin");
$db = new DB;

commonHeader("IRM Group Members");
?>
Welcome to the IRM Group Setup utility.  Here you can edit members of a specified group.
You may also <a href="#add">add computers to a group.</a>
<hr noshade>
<?
$query = "SELECT * FROM groups WHERE ID = $id";
$result = $db->query($query);
$name = $db->result($result, 0, "name");
PRINT "Group: <b>$name</b> ($id)<br>\n";

$query = "SELECT * FROM comp_group where group_id = $id";
$result = $db->query($query);
$i = 0; 
$number = $db->numrows($result);
PRINT "<table border=0 width=100%>";
while ($i < $number)
{
  $comp_id = $db->result($result, $i, "comp_id");
  $q2 = "SELECT ID,name FROM computers WHERE (ID = $comp_id)";
  $r2 = $db->query($q2);
  $cname = $db->result($r2, 0, "name");
  PRINT "<tr><td width=50%>$cname ($comp_id)</td><td><a href=setup-groups-members-del.php3?group_id=$id&comp_id=$comp_id>[Delete]</a></td></tr>\n"; 		
  $i++;
}
PRINT "</table>";
PRINT "<a name=\"add\"></a><hr noshade><h4>Add a Computer to Group</h4>";
PRINT "<form method=post action=setup-groups-members-add.php3><input type=hidden name=group_id value=$id>";
PRINT "Computer ID: <input type=text name=comp_id size=4> <input type=submit value=Add></form>";
?>
<?
commonFooter();
?>