<?
	#---------------------------------------------------------------------#
	# This source code is (c)2000 Dave Belfer-Shevett - shevett@pobox.com #
	# see http://www.stonekeep.com/license.html for licensing information #
	#---------------------------------------------------------------------#

	#--------------------------------------------------------------------
	# $Id: maintenance.php3,v 1.28 2000/12/19 14:06:08 shevett Exp $
	#--------------------------------------------------------------------

	Function RowPick($target,$ltext,$dtext) {
		global $sys_graphics ;
		echo "<tr bgcolor=#202020 valign=top>";
		echo "<td bgcolor=#808080 nowrap>";
		echo "<a href=\"$target\">";
		echo "<img src=\"${sys_graphics}/circle.gif\" border=0>$ltext</a>";
		echo "</td>";
		echo "<td bgcolor=#808080>";
		echo "$dtext.";
		echo "</td>";
		echo "</tr>";
	}


	if (Member("$curruser","admin")) {
		if (IsSet($table)) {
			LogIt("DEBUG","maintenance.php3","Table is set to $table.  Loading mbrowse.");
			include "./mbrowse.php3";
		} else {
?>

<tr>
	<td bgcolor=#bbbbbb colspan=2 align=center>
		<h3>Maintenance
	</td>
</tr>
<tr valign=top>
	<td width=50%>
		<table width=100% bgcolor=#000000>
			<tr bgcolor=#bbbbbb>
				<td colspan=2 align=center>
					<h4>General Purpose Tables
				</td>
			</tr>
			<? RowPick("nbrowse.php3?table=people&f_func=mbrowse","People","Users within the Keystone system"); ?>
			<? RowPick("nbrowse.php3?table=groups&f_func=mbrowse","Groups","Group Definitions"); ?>
			<? RowPick("nbrowse.php3?table=status&f_func=mbrowse","Status Codes","Status codes that can be assigned to slips."); ?>
			<? RowPick("nbrowse.php3?table=eschema&f_func=mbrowse","Eschema","Extended Data Schema"); ?>
			<? RowPick("nbrowse.php3?table=state&f_func=mbrowse","State","State Table"); ?>
			<? RowPick("nbrowse.php3?table=policy&f_func=mbrowse","Policy","Policies"); ?>
			<? RowPick("nbrowse.php3?table=policy_login&f_func=mbrowse","Policy Login", "Policy User ACL"); ?>
			<? RowPick("nbrowse.php3?table=policy_grp&f_func=mbrowse","Policy Group", "Policy Group ACL"); ?>
			<? RowPick("nbrowse.php3?table=classes&f_func=mbrowse","Classes","Resource Classes"); ?>
			<? RowPick("nbrowse.php3?table=resstatus&f_func=mbrowse","Resource Status","Resource Status Codes"); ?>
			<? RowPick("nbrowse.php3?table=contactlabel&f_func=mbrowse","Contact Labels","Labels for Contact Addresses and Phone Numbers"); ?>
			<tr bgcolor=#000000> <td colspan=2>&nbsp</td> </tr>
			<tr bgcolor=#bbbbbb>
				<td colspan=2 align=center>
					<h4>WARNING - Data Loss may occur<br>
					editing these tables via Maintenance
				</td>
			</tr>
			<? RowPick("nbrowse.php3?table=followups&f_func=mbrowse","Followups","Followups data"); ?>
			<? RowPick("nbrowse.php3?table=slips&f_func=mbrowse","Slips","Slips"); ?>
			<? RowPick("nbrowse.php3?table=resources&f_func=mbrowse","Resources","Resources"); ?>
			<? RowPick("nbrowse.php3?table=contacts&f_func=mbrowse","Contacts","Contacts"); ?>
			<? RowPick("nbrowse.php3?table=addresses&f_func=mbrowse","Addresses","Addresses"); ?>
			<? RowPick("nbrowse.php3?table=phones&f_func=mbrowse","Phones","Phones"); ?>
			<? RowPick("nbrowse.php3?table=ebulk&f_func=mbrowse","Ebulk","Eschema Bulk data"); ?>
			<? RowPick("nbrowse.php3?table=dictionary&f_func=mbrowse","Dictionary","Data Dictionary"); ?>
			<? RowPick("nbrowse.php3?table=slipver&f_func=mbrowse","Slipver","Slip <-> Version relationships"); ?>
		</table>
	</td>
	
	<td width=50%>
		<table bgcolor=#000000 width=100%>
		<tr bgcolor=#bbbbbb>
			<td colspan=2 align=center>
				<h4>System Functions
			</td>
		</tr>
		<? RowPick("nbrowse.php3?f_func=update","Update","Update all system counters."); ?>
		<? RowPick("nbrowse.php3?f_func=info","Info","Show PHP Information."); ?>
		<? RowPick("schecker.php3\" target=new","S-Check","Perform a system structure check."); ?>
		<tr bgcolor=#000000> <td colspan=2>&nbsp</td> </tr>
		<tr bgcolor=#bbbbbb>
			<td colspan=2 align=center>
				<h4>Group Lists
			</td>
		</tr>
		<? RowPick("nbrowse.php3?f_func=memedit&m_group=quickslips&m_table=slips&m_column=sid&m_definition=problem","QuickSlips","Which slips show up in the Quickslips pulldown."); ?>
		<? RowPick("nbrowse.php3?f_func=memedit&m_group=tech&m_table=people&m_column=login&m_definition=fullname","Tech","What users are considered 'technicians', and can have slips assigned to them."); ?>
		<? RowPick("nbrowse.php3?f_func=memedit&m_group=admin&m_table=people&m_column=login&m_definition=fullname","Admin","Which users are 'Administrators' and may do system maintenance."); ?>
		<tr bgcolor=#000000> <td colspan=2>&nbsp</td> </tr>
		<tr bgcolor=#bbbbbb>
			<td colspan=2 align=center>
				<h4>Tables used for Version Control and Bugtracking
			</td>
		</tr>
		<? RowPick("nbrowse.php3?table=platforms&f_func=mbrowse","platforms","Platforms."); ?>
		<? RowPick("nbrowse.php3?table=modules&f_func=mbrowse","modules","Modules."); ?>
		<? RowPick("nbrowse.php3?table=products&f_func=mbrowse","products","Products."); ?>
		<? RowPick("nbrowse.php3?table=versions&f_func=mbrowse","versions","Product versions."); ?>
		<? RowPick("nbrowse.php3?table=rescodes&f_func=mbrowse","rescodes","Resolution codes."); ?>
		</table>
	</td>
</tr>
		
<?  } } ?>	
