<?php
/**************************************************
* File name: user_view_hardware_requesttray.php
* Function: Hardware request tray view page
* Maintained by: Raymond Lai
* Updated: 3 May 2001
* Input: Nil
* Output: Nil
* Purpose: To list all user selected hardware
* in user's request tray
**************************************************/
include("../includes/session_mysql.inc");
include("../includes/global-vars.inc");
session_start();
session_register("user_class");
session_register("username");
session_register("name");
session_register("lang");
session_register("hardware_request_items");
include("$lang.inc");
mysql_connect($dbhost, $dbuser, $dbpasswd);
reset($hardware_request_items);
$query = "select hardwareID, hardware_name from hardware where hardwareID = '" . $hardware_request_items[0] . "'";
while($array_prop = each($hardware_request_items))
{
$query .= " or hardwareID = '" . $array_prop["value"] . "'";
}
$result = mysql_db_query($dbname, $query);
?>
<html>
<head>
<title><?php print $msg_tray_hardware_title; ?></title>
<?php print $doc_encoding; ?>
<link rel="stylesheet" href="../style.css" type="text/css">
</head>
<script language="JavaScript" type="text/javascript" src="../js/details_window.js"></script>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" bottommargin="0" rightmargin="0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="160" bgcolor="#FFFFFF" valign="top">
<?php include("menu.inc"); ?>
</td>
<td valign="top">
<table width="90%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td colspan="4">
<h3 class="heading"><?php print $msg_tray_hardware_title; ?></h3>
</td>
</tr>
<tr>
<td colspan="4" height="20"><span class="text12px"><?php print $msg_user;?></span><span class="text12pxbold"><?php print $name; ?></span></td>
</tr>
<tr>
<td height="50" valign="middle" width="25%"><?php print $msg_browse_hardware_search; ?></td>
<form action="user_search_hardware.php">
<td width="25%">
<input type="text" name="hardwarename">
</td>
<td width="50%" colspan="2">
<input type="submit" name="Submit" value="Search">
</td>
</form>
</tr>
<tr>
<td colspan="4"><?php printf($msg_tray_hardware_total, count($hardware_request_items)); ?></td>
</tr>
<?php
$rowcolor = $major_color;
while($row = mysql_fetch_array($result))
{
if($rowcolor == $minor_color)
$rowcolor = $major_color;
else
$rowcolor = $minor_color;
print "\t\t\t\t<tr bgcolor=\"$rowcolor\">\n\t\t\t\t\t<td width=\"80%\" colspan=\"3\"><a href=\"#\" onClick=\"showDetails('hardware', '" . $row["hardwareID"] . "', 601, 550)\" class=\"textlink\">". $row["hardware_name"] . "</a></td><td><a href=\"user_remove_hardware_from_tray.php?hardwareid=" . $row["hardwareID"] . "\" class=\"textlink\">Remove from list</a></td></tr>\n";
}
?>
<tr>
<td colspan="4" height="30"><hr></td>
</tr>
<tr>
<td colspan="2"><a href="user_browse_hardware.php" class="textlink"><?php print $msg_option_hardware_list; ?></a></td>
<?php
if($hardware_request_items)
{
?>
<td colspan="2" align="center"><a href="user_hardware_checkout.php" class="textlink"><?php print $msg_tray_hardware_checkout; ?></a></td>
<?php
}
else
{
?>
<td colspan="2"> </td>
<?php
}
?>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>