-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistAccounts.php
66 lines (53 loc) · 1.88 KB
/
listAccounts.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
<?
require("sessionCheck.php");
require("config.php");
?>
<html>
<?
print $pageStyle;
?>
<?
require("config.php");
$Connect = mysqli_connect($DB_SERVER, $user, $password) or die ("Cant connect to MySQL at $DB_SERVER");
mysqli_select_db($DATABASE,$Connect) or die ("Cant connect to $DATABASE database");
$toggle=0;
$order=$_GET["order"];
$sql_query="SELECT * FROM access";
if($order!=""){
$sql_query=$sql_query . " ORDER BY $order";
}
$result=mysqli_query ($sql_query);
if(!$result) {
print "sq: $sql_q <br>\n";
print "Mysql Problems: " . mysqli_error() . "<br>\n";
}
if(mysqli_num_rows($result)>0) {
print "<table border=0>";
print "<th><b><a href=\"listAccounts.php?SID=$sid&order=uname\">Uname</a></b></th>";
print "<th><b><a href=\"listAccounts.php?SID=$sid&order=passwd\">Passwd</a></b></th>";
print "<th><b><a href=\"listAccounts.php?SID=$sid&order=status\">Status</a></b></th>";
print "<th><b><a href=\"listAccounts.php?SID=$sid&order=comment\">Comment</b></th>";
print "<th><b><a href=\"listAccounts.php?SID=$sid&order=time\">Date/Time</a></b></th>";
print "<th><b><a href=\"listAccounts.php?SID=$sid&order=name\">Name</b></th>";
print "<th><b><a href=\"listAccounts.php?SID=$sid&order=email\">Date/E-Mail</a></b></th>";
print "<th></b>EDIT</b></th></tr>\n";
while($row = mysqli_fetch_array($result)) {
$noEthers=0;
if($toggle==0) {
$color="CCCCCC";
$toggle=1;
} else {
$color="DDDDDD";
$toggle=0;
}
print "<tr bgcolor='$color' ><td>". $row["uname"] . "</td><td>". $row["passwd"] . "</td><td>". $row["status"] ."</td>";
print "<td>". $row["comment"] . "</td><td>". $row["time"] . "</td><td>". $row["Name"] . "</td><td>". $row["Email"];
print "</td><td><a href=\"editUser.php?SID=$sid&ID=" . $row["id"] ." \">EDIT</a></td></tr>\n";
}
print "</table>";
} else {
print "No entries in the access table, How the hell did you get here!?!?!? ";
exit;
}
?>
</body></html>