-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin-usrview.php
executable file
·82 lines (65 loc) · 1.58 KB
/
admin-usrview.php
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
<?
#This program is copyright by Andre Coetzee email: ac@main.me
#and is licensed under the GPL v3
#
#
#
#
#Please add yourself to: http://www.accounting-123.com
#Developers, Software Vendors, Support, Accountants, Users
#
#
#The full software license can be found here:
#http://www.accounting-123.com/a.php?a=153/GPLv3
#
#
#
#
#
#
#
#
#
#
#
require ("settings.php");
//dont know why this is here ... just causes quick links not to work ...
i_am_the_true_xml();
$OUTPUT = printUsers ();
require ("template.php");
function printUsers ()
{
$OUTPUT = "
<h3>View current users</h3>
<table ".TMPL_tblDflts.">
<tr>
<th>Username</th>
<th>Employee</th>
<th>Branch</th>
<th colspan='2'>Options</th>
</tr>";
$sql = "SELECT username, div, empnum FROM cubit.users";
$user_rslt = db_exec($sql) or errDie("Unable to retrieve employee.");
while ($row = pg_fetch_array($user_rslt)) {
$sql = "SELECT enum, sname, fnames FROM cubit.employees
WHERE empnum='$row[empnum]'";
$emp_rslt = db_exec($sql) or errDie("Unable to retrieve employee.");
$emp_data = pg_fetch_array($emp_rslt);
$employee = "$emp_data[sname] $emp_data[fnames] - $emp_data[enum]";
$bran = qryBranch($row["div"]);
$OUTPUT .= "
<tr class='".bg_class()."'>
<td>$row[username]</td>
<td>$employee</td>
<td>$bran[branname]</td>
<td><a href='admin-usredit.php?username=$row[username]'>Edit</a></td>
<td><a href='admin-usrrem.php?username=$row[username]'>Remove</a></td>
</tr>";
}
$OUTPUT .= "</table>";
// $OUTPUT .= mkQuickLinks(
// ql ("","Add User")
// );
return $OUTPUT;
}
?>