<?
Include("Includes/global.inc.php");
checkPermissions(1, 1800);
$strSQL = "SELECT userID, firstName, middleInit, lastName, id, securityLevel, lastLogin
FROM tblSecurity WHERE accountID=$accountID ORDER BY lastName";
$strSQL = determinePageNumber($strSQL);
$result = dbquery($strSQL);
writeHeader("View All Users");
echo "<table border='0' cellpadding='5' cellspacing='0'>";
echo "<tr class='title'><td> </td><td><b>Name</b></td><td><b>Type</b></td>";
echo "<td><b>Last Login</b></td><td><b>Action?</b></td></tr>\n";
$rowCount = 0;
while ($row = mysql_fetch_array($result)) {
$rowCount++;
$strUserID = $row[0];
$strFirstName = $row[1];
$strMiddleInit = $row[2];
$strLastName = $row[3];
$intUserID = $row[4];
$intLevel = $row[5];
$strLastLogin = $row[6];
If (!$strLastLogin) {
$strLastLogin = " ";
} Else {
$strLastLogin = displayDateTime($strLastLogin)." ";
}
echo "<tr class='".alternateRowColor()."'><td>$rowCount.</td>\n";
echo "<td>".buildName($strFirstName, $strMiddleInit, $strLastName, 0);
echo " </td>\n<td>".writeSecurityLevel($intLevel)." </td>\n<td>";
echo $strLastLogin."</td>\n<td>";
If (($userID == $intUserID) AND ($sessionSecurity < 2)) {
echo "<a href='userAccount.php'>Edit</a> \n";
} ElseIf (($intLevel == 3) OR ($sessionSecurity < 1)) {
echo "<a href='editUser.php?editID=$intUserID'>Edit</a> \n";
} Else {
echo "N/A";
}
If (($userID != $intUserID) AND ($sessionSecurity < 1)) {
echo "<a href='deleteUser.php?editID=$intUserID' onClick=\"return warn_on_submit('You are about to delete a user from the inventory! \\nThis will also delete *all inventory* associated with this user.');\">Delete</a></li>\n";
}
echo "</td></tr>\n";
}
echo "</table>";
createPaging();
writeFooter();
?>