Location: PHPKode > projects > Online Resource Management system > storms/user/user_book_add2req.php
<?php

/***************************************************
 *   File name: user_book_add2req.php
 *   Function: Shopping cart" for user book requests
 *   Maintained by: Raymond Lai
 *   Last update: 3 May 2001
 *   Input : bookID
 *   Output: bookID entry at the user's session
 *   Purpose: To add a user selected book to the
 *            "shopping cart"
 ***************************************************/

include("../includes/session_mysql.inc");
include("../includes/global-vars.inc");

session_start();
session_register("book_request_items");
session_register("username");

mysql_connect($dbhost, $dbuser, $dbpasswd);


$book_quota_query = "select user_bkloan_quota from users where user_acct = '$username'";
$book_quota_result = mysql_db_query($dbname, $book_quota_query);
$row = mysql_fetch_array($book_quota_result);
$book_quota = $row["user_bkloan_quota"];

if(!isset($book_request_items))
    $book_request_items = array();
    
reset($book_request_items);

if(count($book_request_items) >= $book_quota)
{
?>
<html>
<link rel="stylesheet" href="../style.css" type="text/css">
<body>
<p>Your book loan quota is full.</p>
<p>You can, however, <a href="user_browse_books.php" class="textlink">go back to the book catalogue</a>.<br>
<?php
	if($book_request_items)
	{
?>
Or, you can<a href="user_view_book_requesttray.php" class="textlink">review your book request list</a>,<br>
or <a href="user_book_checkout.php" class="textlink">check out your book hold requests now</a>.</p>
<?php
	}
?>
</p>
</body>
</html>
<?php
	exit;
}
else
{
	$book_request_items["$bookid"] = $bookid;

	header("Location: $HTTP_REFERER");
	exit;
}
?>
Return current item: Online Resource Management system