showbook.asp

来自「采用ASP。NET做的网上游戏交易平台」· ASP 代码 · 共 134 行

ASP
134
字号
<!--#include file="isValidUser.asp"-->
<!--#include file="dbconn.asp"-->
<html>
<LINK href="wgcs.css" rel=stylesheet>
<script language="JavaScript">
function goto(){
	window.location="showBook.asp?bookid="+frmbook.tmpid.value+"&&curpage="+frmbook.txtpage.value;
}
function delbook(timestring){
	window.location="action.asp?actionstr=delbook&bookstr=" + frmbook.tmpid.value + "&timestr="+timestring;
}
</script>
<head>
<%
const pernum=10
dim mybookid,bookNum,mybookstr,totalnum,mycurpage,totalpage
mybookid=request.querystring("bookid")
mycurpage=request.querystring("curpage")
if mycurpage="" or not isnumeric(mycurpage) then 
mycurpage=1
end if
if not isnumeric(mybookid) then
Response.Write "<script language=javascript>" &vbCrLf&_
"alert('参数无效,本窗口即将关闭!!!');" &vbCrLf&_
" window.close();" &vbCrLf&_
"</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
sql="select * from ziliao where ID="&clng(mybookid)
rs.open sql,conn,3,1
mybookstr=rs("recommed")
rs.close
set rs=nothing
bookArr=split(mybookstr,"#")
totalnum=ubound(bookArr)
if totalnum mod pernum=0 then
totalpage=totalnum/pernum
else
totalpage=fix(totalnum/pernum)+1
end if
%>
<title>查看留言...</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<LINK href="2v.css" rel=stylesheet>
<body style="background-color: #FFFFFF">
<center>
<table border="0" width="770" cellspacing="0" cellpadding="0" >
		<tr>
			<td height=5 bgcolor="#767676" width="770" colspan="4"></td>
		</tr>
		<tr>
			<td  bgcolor="#666666" width="355" height="25">
			 <font color="#FFFFFF"><b>查看留言 </b></font>
</td>
			<td  bgcolor="#666666" width="162" height="25">
			 </td>
			<td  bgcolor="#666666" width="199" height="25">
			 </td>
			<td  bgcolor="#666666" width="54" height="25">
			 </td>
		</tr>
</table>
<table border="0" width="770" cellspacing="0" cellpadding="0" bgcolor="#333333">
	<tr>
		<td height=3 bgcolor="#606060"></td>
	</tr>
</table>
<table cellSpacing="1" width="770" border="1" style="border-collapse: collapse" bordercolor="#666666" height="320">
  <form name="frmbook" method="post" action="action.asp">
    <tr valign=top> 
      <td align="center" width="757"><input type="hidden"  name="tmpid" value="<%=mybookid%>">
	  <%
	  for i=0 to ubound(bookArr)-1
	  if i>=pernum*(mycurpage-1) and i<pernum*mycurpage then
	  tmpbookarr=split(bookArr(i),"*")
	  %>
          <table cellSpacing="3" width="759" border="0">
            <tr> 
              <td width="95"> <font color="#800000"> 留言人姓名:</font>&nbsp; </td>
              
            <td width="203"> <%=tmpbookarr(1)&"&nbsp;&nbsp;(time:"&tmpbookarr(0)&")"%></td>
              <td width="116"> <font color="#800000"> 留言人联系方式:</font></td>
              
            <td width="209"> <%=tmpbookarr(2)%></td>
              <td width="108"> <input class="M"  type="button" value="删除此条留言" name="<%="delbook"&i%>" onclick="delbook('<%=tmpbookarr(0)%>');"></td>
            </tr>
            <tr> 
              <td width="95"> <font color="#800000">留言内容:</font></td>
              
            <td colspan="4"> <%=tmpbookarr(3)%></td>
            </tr>
            <tr> 
              <td colspan="5"> <hr noshade size="1">
                 </td>
            </tr>
          </table>
		  <%
		  end if
		  next
		  %>
                <table cellSpacing="3" width="759" border="0">
                  <tr> 
                    
              <td> <p align="right">共&nbsp;<font color="#FF0000"><%=totalnum%></font>&nbsp;条留言,每页显示&nbsp;<font color="#FF0000"><%=pernum%></font>&nbsp;条,当前第&nbsp;<font color="#FF0000"><%=mycurpage%></font>页/共<font color="#FF0000"><%=totalpage%></font>&nbsp;页 
                  <select  name="txtpage" onchange="goto();">
				  <%
				  if totalpage=1 then
				  %>
                    <option value="1" selected>共&nbsp;1&nbsp;页</option>
					<%
					else
					for j=1 to totalpage
					if j=mycurpage then
					response.write "<option value="&mycurpage&" selected>到第&nbsp;"&mycurpage&"&nbsp;页</option>"
					else
					response.write "<option value="&j&">到第&nbsp;"&j&"&nbsp;页</option>"
					end if
					next
					end if
					%>
                  </select>
                  页 </td>
                  </tr>
                </table>
        </td>
    </tr>
  </form>
</table>
</center>
</body>
</html>

⌨️ 快捷键说明

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