<?php
/**************************************************
* File name: user_view_book_requesttray.php
* Function: Book request tray view page
* Maintained by: Raymond Lai
* Updated: 3 May 2001
* Input: Nil
* Output: Nil
* Purpose: To list all user selected book
* 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("book_request_items");
include("$lang.inc");
mysql_connect($dbhost, $dbuser, $dbpasswd);
reset($book_request_items);
$query = "select bookID, book_name from books where bookID = '" . $book_request_items[0] . "'";
while($array_prop = each($book_request_items))
{
$query .= " or bookID = '" . $array_prop["value"] . "'";
}
$result = mysql_db_query($dbname, $query);
?>
<html>
<head>
<title><?php print $msg_tray_book_title; ?></title>
<?php print $doc_encoding; ?>
<link rel="stylesheet" href="../style_<?php print $lang; ?>.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_book_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" width="25%">Search by:</td>
<form action="user_search_books.php">
<td width="25%" align="center">
<input type="text" name="qs">
</td>
<td width="25%" align="center">
<select name="qstype">
<option value="book_name"><?php print $msg_browse_book_search_bookname; ?></option>
<option value="book_keyword"><?php print $msg_browse_book_search_keyword; ?></option>
</select>
</td>
<td width="25%">
<input type="submit" name="Submit" value="Search">
</td>
</form>
</tr>
<tr>
<td colspan="4"><?php printf($msg_tray_book_total, count($book_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('book', '" . $row["bookID"] . "', 601, 550)\" class=\"textlink\">". $row["book_name"] . "</a></td><td><a href=\"user_remove_book_from_tray.php?bookid=" . $row["bookID"] . "\" class=\"textlink\">$msg_tray_special</a></td></tr>\n";
}
?>
<tr>
<td colspan="4" height="30"><hr></td>
</tr>
<tr>
<td colspan="2"><a href="user_browse_books.php" class="textlink"><?php print $msg_option_book_list; ?></a></td>
<?php
if($book_request_items)
{
?>
<td colspan="2" align="center"><a href="user_book_checkout.php" class="textlink"><?php print $msg_tray_book_checkout; ?></a></td>
<?php
}
else
{
?>
<td colspan="2"> </td>
<?php
}
?>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>