if ($dss_userId == 0) {
    header("Location: /index.php");
    exit;
}
if (trim($_REQUEST["workgroupId"]) != "") {
    $dss_currentWorkgroup = $_REQUEST["workgroupId"];
    db_query("UPDATE session SET currentWorkgroup=" . escapeValue($dss_currentWorkgroup) . " WHERE id=" . escapeQuote($dss_sessionCookie));
}
$workgroupResult = db_fetch(db_query("SELECT name FROM workgroup WHERE id={$dss_currentWorkgroup}"));
/* Keep track of the char & page number the user is viewing. */
if (trim($_REQUEST["char"]) != "") {
    superstore_save("{$dss_currentWorkgroup}", $dss_sessionCookie, "char", $_REQUEST["char"]);
    superstore_save("{$dss_currentWorkgroup}", $dss_sessionCookie, "currentPage", 0);
}
if (trim($_REQUEST["currentPage"]) != "") {
    superstore_save("{$dss_currentWorkgroup}", $dss_sessionCookie, "currentPage", $_REQUEST["currentPage"]);
}
$char = superstore_fetch("{$dss_currentWorkgroup}", $dss_sessionCookie, "char");
$currentPage = escapeValue(superstore_fetch("{$dss_currentWorkgroup}", $dss_sessionCookie, "currentPage"));
require "resources/header.php";
?>
				<h2>Projects for <?php 
echo $workgroupResult["name"];
?>
</h2>
				<?php 
displayMessages($_REQUEST["infoMessage"], $_REQUEST["errorMessage"], $required);
if ($dss_numWorkgroups > 1 || $dss_accessLevel > 0) {
    ?>
				<a href="workgroup_list.php"><img src="/resources/cancel.png" border="0" alt="Return to workgroup list" title="Return to workgroup list"></a>
<?php 
		http://www.apache.org/licenses/LICENSE-2.0

	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
*/
if ($dss_userId == 0) {
    header("Location: /index.php");
    exit;
}
/* Keep track of the char the user is viewing. */
if (trim($_REQUEST["char"]) != "") {
    superstore_save("workgroup_list", $dss_sessionCookie, "char", $_REQUEST["char"]);
}
$char = superstore_fetch("workgroup_list", $dss_sessionCookie, "char");
require "resources/header.php";
?>
				<h2>Workgroups</h2>
				<?php 
displayMessages($_REQUEST["infoMessage"], $_REQUEST["errorMessage"], $required);
if ($dss_accessLevel > 0) {
    ?>
				<a href="workgroup_edit.php"><img src="/resources/add.png" border="0" alt="Add new workgroup" title="Add new workgroup"></a>
<?php 
    $char = displayAlphaBar("workgroup", "name", "", $char, $dss_displayListSize);
} else {
    $char = displayAlphaBar("workgroup a, workgroupUser b", "a.name", "WHERE b.userId={$dss_userId} AND b.workgroupId=a.id", $char, $dss_displayListSize);
}
$currentPage = escapeValue(superstore_fetch("SEARCH", $dss_sessionCookie, "currentPage"));
for ($i = 0; $i < 5; $i++) {
    $thisField = "field" . $i;
    $thisCondition = "condition" . $i;
    $thisValue = "value" . $i;
    if ($_POST["resetButton"] != "") {
        superstore_save("SEARCH", $dss_sessionCookie, $thisField, '');
        superstore_save("SEARCH", $dss_sessionCookie, $thisCondition, '');
        superstore_save("SEARCH", $dss_sessionCookie, $thisValue, '');
        superstore_save("SEARCH", $dss_sessionCookie, "currentPage", 0);
        $currentPage = 0;
    } elseif ($_POST["searchButton"] != "") {
        superstore_save("SEARCH", $dss_sessionCookie, $thisField, $_POST[$thisField]);
        superstore_save("SEARCH", $dss_sessionCookie, $thisCondition, $_POST[$thisCondition]);
        superstore_save("SEARCH", $dss_sessionCookie, $thisValue, $_POST[$thisValue]);
        superstore_save("SEARCH", $dss_sessionCookie, "currentPage", 0);
        $currentPage = 0;
    }
    $fieldArray[$i] = superstore_fetch("SEARCH", $dss_sessionCookie, $thisField);
    $conditionArray[$i] = superstore_fetch("SEARCH", $dss_sessionCookie, $thisCondition);
    $valueArray[$i] = superstore_fetch("SEARCH", $dss_sessionCookie, $thisValue);
}
$dss_onLoad = "document.main.value0.focus()";
require "resources/header.php";
?>
				<h2>Search</h2>
				<form action="search.php" method="post" name="main">
<?php 
for ($i = 0; $i < 5; $i++) {
    ?>
					<div id="row<?php 
		http://www.apache.org/licenses/LICENSE-2.0

	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
*/
if ($dss_userId == 0 || $dss_accessLevel < 2) {
    header("Location: /index.php");
    exit;
}
/* Keep track of the char the user is viewing. */
if (trim($_REQUEST["char"]) != "") {
    superstore_save("user_list.php", $dss_sessionCookie, "char", $_REQUEST["char"]);
}
$char = superstore_fetch("user_list.php", $dss_sessionCookie, "char");
require "resources/header.php";
?>
				<h2>Users</h2>
				<?php 
displayMessages($_REQUEST["infoMessage"], $_REQUEST["errorMessage"], $required);
?>
				<a href="admin.php"><img src="/resources/cancel.png" border="0" alt="Return to admin tools" title="Return to admin tools"></a>
				<a href="user_edit.php"><img src="/resources/add.png" border="0" alt="Add new user" title="Add new user"></a>
				<?php 
$char = displayAlphaBar("user", "lastName", "", $char, $dss_displayListSize);
?>
				<table class="listing">
					<tr><th>Name</th><th>Access Level</th><th>Last Login</th></tr>
	limitations under the License.
*/
if ($dss_userId == 0 || $dss_accessLevel == 0) {
    header("Location: /index.php");
    exit;
}
if (trim($_REQUEST["submit_button"]) != "") {
    superstore_save("report_audit_list", $dss_sessionCookie, "action", $_REQUEST["action"]);
    superstore_save("report_audit_list", $dss_sessionCookie, "actionByUserId", $_REQUEST["actionByUserId"]);
    superstore_save("report_audit_list", $dss_sessionCookie, "workgroupName", $_REQUEST["workgroupName"]);
    superstore_save("report_audit_list", $dss_sessionCookie, "projectName", $_REQUEST["projectName"]);
} elseif (trim($_REQUEST["reset_button"]) != "") {
    superstore_save("report_audit_list", $dss_sessionCookie, "action", "");
    superstore_save("report_audit_list", $dss_sessionCookie, "actionByUserId", "");
    superstore_save("report_audit_list", $dss_sessionCookie, "workgroupName", "");
    superstore_save("report_audit_list", $dss_sessionCookie, "projectName", "");
}
$action = superstore_fetch("report_audit_list", $dss_sessionCookie, "action");
$actionByUserId = superstore_fetch("report_audit_list", $dss_sessionCookie, "actionByUserId");
$workgroupName = superstore_fetch("report_audit_list", $dss_sessionCookie, "workgroupName");
$projectName = superstore_fetch("report_audit_list", $dss_sessionCookie, "projectName");
require "resources/header.php";
?>
				<h2>Audit Log Review</h2>
				<a href="report_list.php"><img src="/resources/cancel.png" border="0" alt="Return to the report list" title="Return to the report list"></a>
				<form action="report_audit_list.php" method="post" style="padding: 10px 0 10px 0">
					Limit to
					<select name="action">
						<option value="">Any</option>
<?php 
$query = db_query("SELECT action FROM auditlog GROUP BY action ORDER BY action");