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

📄 make_review.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');
reg('POST','isubmit','item_id','grade','review');

if($item_id && isset($grade)) {
	mysql_query("insert into tbl_review(item_id,login_id,grade,review)values($item_id,$global_login_id,$grade,'$review')");
	mysql_query("delete from tbl_review_summary where item_id=$item_id");
	mysql_query("insert into tbl_review_summary(item_id,avg_grade,total_review) select item_id,truncate(avg(grade),0),count(*) from tbl_review where item_id=$item_id group by item_id");
	echo " <html> <head> <title>edit window</title> </head> <body onload='javascript:self.close()'> </body> </html> ";
}else{
	$t="";
	$t = MakeSelectArray("select grade, grade_desc from tbl_grade order by grade");

	head();
	OpenForm();
	OpenTable(0,3,3);
	OpenLine();
		OpenTable();
		echo Row(Cell(Bold("Grade:")).Cell(MakeSelect("grade",5,$t)));
		echo Row(Cell(Bold("Review:")).Cell("<textarea wrap='virtual' cols='80' rows='10' name='review'></textarea>"));
		echo Row(Cell("<input type=hidden value=$item_id name=item_id>"));
		echo Row(Cell("<input align='center' name='y' type='submit' value = 'Submit Review'>","colspan=2 align=center"));
		CloseTable();
	CloseLine();
	OpenLine();
		OpenTable();
		OpenLine();
		PrintItem($item_id);
		CloseLine();
		CloseTable();
	CloseLine();
	CloseTable();
	CloseForm();
	foot();


}
?>

⌨️ 快捷键说明

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