bookcomment1.asp
资源名称:图书管理系统.rar [点击查看]
上传用户:llrg7406
上传日期:2007-03-02
资源大小:654k
文件大小:3k
源码类别:
教育系统应用
开发平台:
Delphi
- <%@ Language=VBScript %>
- <!--#include file ="identify.asp"-->
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <link rel="stylesheet" type="text/css" href="xcss.css">
- <meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
- <script LANGUAGE="javascript">
- <!--
- function show_cm(commentid)
- {
- window.open("show_comment.asp?commentid=" + commentid,"_blank","height=450,width=350,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,top=0,left=0");
- }
- //-->
- </script>
- </head>
- <body background="images/zapsmbknd.gif">
- <h3>书评:</h3>
- <%
- b_bookid = Request.QueryString("bookid")
- if len(b_bookid)=0 then
- Response.Write "您没有打开任何一本书!"
- Response.End
- end if
- set conn = server.CreateObject("adodb.connection")
- conn.Open Application("dsn")
- sql = "select bookid,name,author from BookDetail where bookid=" & b_bookid
- set rs = server.CreateObject("adodb.recordset")
- rs.Open sql,conn
- if rs.EOF then
- rs.Close
- set rs = nothing
- conn.Close
- set conn = nothing
- Response.Write "找不到您要的文件!"
- Response.End
- end if
- b_name = rs("name")
- author = rs("author")
- rs.Close
- set rs = nothing
- %>
- <p><b>书名:</b><%=b_name%></p>
- <p><b>作者:</b><%=author%></p>
- <%
- sql = "select count(*) from grade where bookid=" & b_bookid
- set rs = server.CreateObject("adodb.recordset")
- rs.Open sql,conn
- grade_count = rs(0)
- rs.Close
- set rs = nothing
- %>
- <p><b>共<font color="red"><%=grade_count%></font>人对本书打了分。</b></p>
- <%
- if grade_count>0 then
- sql = "select avg(grade) from grade where bookid=" & b_bookid
- set rs = server.CreateObject("adodb.recordset")
- rs.Open sql,conn
- grade_avg = rs(0)
- rs.Close
- set rs = nothing
- %>
- <p><b>本书的评分为<font color="red"><%=formatnumber(grade_avg,3)%></font></b></p>
- <%
- end if
- %>
- <hr>
- <%
- sql = "select commentid,username,imgname,title,settime from bookcomment where bookid=" & b_bookid
- set rs = server.CreateObject("adodb.recordset")
- rs.Open sql,conn
- if rs.EOF then
- rs.Close
- set rs = nothing
- conn.Close
- set conn = nothing
- Response.Write "本书暂时没有人发表评论。"
- %>
- <br>
- <TABLE WIDTH=75% BORDER=0 CELLSPACING=1 CELLPADDING=1>
- <TR>
- <TD align=center><INPUT type="button" value="返回" language="javascript" onclick="window.history.back();" id=button1 name=button1></TD>
- </TR>
- </TABLE>
- </body>
- </html>
- <%
- Response.End
- end if
- while not rs.EOF
- %>
- <nobr><img SRC="images/<%=rs("imgname")%>.gif" border="0"> <a href="#" onclick="show_cm(<%=rs("commentid")%>);"><%=rs("title")%> (作者:<%=rs("username")%>,发表于<%=rs("settime")%>)</a><br></nobr>
- <%
- rs.MoveNext
- wend
- rs.Close
- set rs = nothing
- conn.Close
- set conn = nothing
- %>
- <br>
- <TABLE WIDTH=75% BORDER=0 CELLSPACING=1 CELLPADDING=1>
- <TR>
- <TD align=center><INPUT type="button" value="返回" language="javascript" onclick="window.history.back();"></TD>
- </TR>
- </TABLE>
- </body>
- </html>