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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
<?
$page["title"] = "Users";
$page["file"] = "users.html";
include "include/config.inc";
show_header($page["title"],0,0);
?>
<?
if(isset($register))
{
if($register=="add")
{
if($password1==$password2)
{
$result=add_user($groupid,$name,$surname,$alias,$password1);
show_messages($result, "User added", "Cannot add user");
}
else
{
show_error_message("Cannot add user. Both passwords must be equal.");
}
}
if($register=="delete")
{
$result=delete_user($userid);
show_messages($result, "User successfully deleted", "Cannot delete user");
unset($userid);
}
if($register=="update")
{
if($password1==$password2)
{
$result=update_user($userid,$groupid,$name,$surname,$alias,$password1);
show_messages($result, "Information successfully updated", "Cannot update information");
}
else
{
show_error_message("Cannot update user. Both passwords must be equal.");
}
}
}
?>
<?
show_table_header("CONFIGURATION OF USERS");
echo "<br>";
?>
<?
show_table_header("USERS");
echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>";
echo "<TR><TD WIDTH=\"10%\"><B>Group</B></TD>";
echo "<TD WIDTH=\"10%\"><B>Alias</B></TD>";
echo "<TD WIDTH=\"10%\" NOSAVE><B>Name</B></TD>";
echo "<TD WIDTH=\"10%\" NOSAVE><B>Surname</B></TD>";
echo "<TD WIDTH=\"10%\" NOSAVE><B>Actions</B></TD>";
echo "</TR>";
$result=DBselect("select u.userid,u.alias,u.name,u.surname,g.name from users u,groups g where u.groupid=g.groupid order by g.name,u.alias");
echo "<CENTER>";
$col=0;
for($i=0;$i<DBnum_rows($result);$i++)
{
if($col==1)
{
echo "<TR BGCOLOR=#EEEEEE>";
$col=0;
} else
{
echo "<TR BGCOLOR=#DDDDDD>";
$col=1;
}
$alias=DBget_field($result,$i,1);
$name=DBget_field($result,$i,2);
$surname=DBget_field($result,$i,3);
$group=DBget_field($result,$i,4);
$userid_=DBget_field($result,$i,0);
echo "<TD>$group</TD>";
echo "<TD>$alias</TD>";
echo "<TD>$name</TD>";
echo "<TD>$surname</TD>";
echo "<TD><A HREF=\"users.html?register=change&userid=$userid_\">Change</A> - <A HREF=\"media.html?userid=$userid_\">Media</A>";
echo "</TD>";
echo "</TR>";
}
echo "</TABLE>";
?>
<?
echo "<br>";
@insert_user_form($userid);
?>
<?
show_footer();
?>
|