⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 request_checkout.php

📁 一个用php+mysql做的图书馆管理系统
💻 PHP
字号:
<?php
/**************************************************************************************

    Simple Library System
    Copyright (C) 2002 John Mark Matthews

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

    For further information, contact:
    	John Matthews
    	jmatthews@exostrategy.com

***************************************************************************************/

include("mainfile.inc");
include("header.inc");
include("footer.inc");
include("auth.inc");

reg('GET','item_id');

if($item_id && $global_login_id) {

	$r = mysql_query("select * from tbl_item_request where item_id=$item_id and login_id=$global_login_id");
	if(mysql_num_rows($r)==0) {
		$sql = "insert into tbl_item_request(item_id, login_id, request) values(";
		$sql.= "$item_id, $global_login_id, 1)";
		mysql_query($sql);
		$request_id = mysql_insert_id();
		head();
		menu();

		OpenTable(0,3,3);
		OpenLine();
		echo "<p><b>You have requested to checkout:</b></p>";
		CloseLine();
		OpenLine();
		PrintItem($item_id);
		CloseLine();
		OpenLine();
		echo "
			<code>
			   The replacement charges are:<br>
			   Book (B), Pamphlet (P) or Audiocassette (A) $20,<br>
			   Binder (BI) or Audiocassette w/ workbook (A/W) $40,<br>
			   Four to six audiocassettes w/ workbook (A/W) $120, <br>
			   Video (V) $150, and Video w/ workbook (V/W) $200.<br>
			</code>
		";
		CloseLine();
		CloseTable();

		$r = mysql_query("select email from tbl_login where admin_flag=1");
		while($line = mysql_fetch_array($r)) {
			mail($line["email"],
			"Library: Checkout Request",
			"There is a checkout request.\n http://" . $SERVER_NAME . "/library/checkout.php=?request_id=$request_id\n\n",
			"From: jmatthews@exostrategy.com\nReply-To: jmatthews@exostrategy.com\n");
		}

		foot();
	}else{
		head();
		menu();
		OpenTable(0,3,3);
		OpenLine();
		echo "<b>You have already requested to checkout:</b>";
		CloseLine();
		OpenLine();
		PrintItem($item_id);
		CloseLine();
		OpenLine();
		echo "
			<code>
			   The replacement charges are:<br>
			   Book (B), Pamphlet (P) or Audiocassette (A) $20,<br>
			   Binder (BI) or Audiocassette w/ workbook (A/W) $40,<br>
			   Four to six audiocassettes w/ workbook (A/W) $120, <br>
			   Video (V) $150, and Video w/ workbook (V/W) $200.<br>
			</code>
		";
		CloseLine();
		CloseTable();
		foot();
	}
}else{
	header("Location: ./index.php");
}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -