<?php

	$dbserver = 'libitdb.lang.uc.edu';
	$dbuser = 'phpadmin';
	$dbpass = '25or624';
	// Create our database connection
	$sqlConn = mysql_connect($dbserver, $dbuser, $dbpass) or die("Couldn't connect to database");
	$dbConn = mysql_select_db("menu", $sqlConn) or die("Couldn't select database");
	
	$sql = "select * from nodes where parentId = 0 order by title asc";
	$nodeResult = mysql_query($sql) or die("SELECT query failed");
	$counter = 0;
	
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html lang="en">
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<head>
<title>Add a Computer</title>


<!-- DO NOT REMOVE THE FOLLOWING STYLE SHEET INFORMATION -->
<link rel="stylesheet" type="text/css" href="../../web.css">
<!-- END OF STYLE SHEET INFORMATION -->

<!-- BEGIN META TAGS -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="UC Library Information Technology Department.">
<meta name="keywords" content="create help call, create help ticket">
<!-- END META TAGS -->
<script language="JavaScript">

	function ToggleNode(nodeObject, imgObject)
		{
			if(nodeObject.style.display == '' || nodeObject.style.display == 'inline')
				{
					nodeObject.style.display = 'none';
					imgObject.src = '../../images/plus.gif';					
				}
			else
				{
					nodeObject.style.display = 'inline';
					imgObject.src = '../../images/minus.gif';
				}
		}

</script>
</head>

<body BGCOLOR="#FFFFFF" TOPMARGIN="0" LEFTMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0" link="#FF0000" vlink="#FF0000" alink="#FF0000">

<table border="0" width="645" cellspacing="0" cellpadding="0" align="left">
  <!-- begin first row for logo and headline -->
  <tr>
    <td width="125" height="64" align="right" valign="bottom"><a href="http://www.uc.edu"><img src="../../images/uc_logo_web3.gif" width="90%" border="0" alt="University of Cincinnati logo and link" align="top"></a></td>
	<td width="30" height="64">&nbsp;</td>
    <td width="490" height="64" align="left" valign="bottom">
      <p class="headline"><a href="http://libitdb.lang.uc.edu/uclit/"><img src="../../images/lit_title.gif" alt="library information technology headline and link" align="left" border="0"></a></p>
	</td>
  </tr>
<!-- begin blank row to provide exact spacing between first and second rows -->
  <tr>
    <td width="125" height="15"><img src="../../images/spacer1.gif" alt="spacer"></td>
    <td width="30" height="15"><img src="../../images/spacer1.gif" alt="spacer"></td>
    <td width="490" height="15"><img src="../../images/spacer1.gif" alt="spacer"></td>
  </tr>
<!-- begin third row for links and content -->
  <tr>
    <td valign="top">
      <table width="125" border="0" cellspacing="0" cellpadding="0" background="../../images/curvylines.jpg">
	<?php
	
		while($node = mysql_fetch_array($nodeResult))
			{	
	?>
		<tr>
			<td class="root_td">
				<img id="img_root_<?php echo $counter; ?>" onClick="ToggleNode(td_root_<?php echo $counter; ?>, img_root_<?php echo $counter; ?>)" border="0" src="../../images/minus.gif" style="cursor:hand">
				&nbsp;<?php echo $node[1]; ?>
			</td>
		</tr>
		<tr>
			<td id="td_root_<?php echo $counter++; ?>" class="child_td">
				<table width="100%">
					<?php
					
						$sql = "select * from nodes where parentId = {$node[0]} order by title asc";
						@$childResult = mysql_query($sql);
						
						while($child = mysql_fetch_row($childResult))
							{
						?>
					<tr>
						<td class="child_td">
							<a href="<?php echo $child[2]; ?>"><?php echo $child[1]; ?></a>
						</td>
					</tr>
					
					<?php
						}
					?>
					
				</table>
			</td>
		</tr>
	
	<?php
		}
	?>
	
	</table>
    </td>
    <td width="30" valign="top">&nbsp;</td>
    <td width="490" valign="top"> 
     <!--<h2>Add a computer</h2>-->
     <p><img src="../../images/small_ingot.gif" width="25" height="7" alt="UC ingot"><a name="content"></a></p>
     <?php include ('sel_by_tech.inc.php'); ?>
	</td>
   </tr>
  </table>
  </body>
</html>
