1 |
<HTML> |
2 |
<HEAD> |
3 |
<TITLE>Stock Administration: Edit a user</TITLE> |
4 |
</HEAD> |
5 |
<BODY bgcolor="white"> |
6 |
<?php include("../inc/util.inc");?> |
7 |
<FORM method=post> |
8 |
User to edit <SELECT name=id><OPTION value="">Choose one<?php echo MakeOptions(GetUsers())?></SELECT><BR> |
9 |
<INPUT type=submit name=submit value="Edit User"> |
10 |
</FORM> |
11 |
<?php if (!empty($id) && (!isset($username) || !isset($password))) { |
12 |
$usersdetails = getUserDetails($id); |
13 |
if ($usersdetails != 0) {?> |
14 |
<FORM method=post> |
15 |
Username <INPUT type=text name=username size=16 maxlength=16 value="<?php echo $usersdetails['username']?>"><BR> |
16 |
Password <INPUT type=text name=password size=16 maxlength=16 value="<?php echo $usersdetails['password']?>"><BR> |
17 |
<INPUT type=hidden name=id value=<?php echo $id?>> |
18 |
<INPUT type=submit name=edit value="Update User"> |
19 |
</FORM> |
20 |
<?php } |
21 |
} else if (isset($username) && isset($password)) { |
22 |
if (EditUser($id, $username, $password)) { |
23 |
echo "User updated"; |
24 |
} else { |
25 |
echo "User not updated"; |
26 |
} |
27 |
}?> |
28 |
</BODY> |
29 |
</HTML> |