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

📄 result.asp

📁 学生评教系统,可以实现学生评教,教师查分功能.
💻 ASP
字号:

<!--#include file="conn.asp"-->
<!--#include file="inc/char.asp" -->
<!--#include file="inc/const.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查询结果</title>
<link rel="stylesheet" type="text/css" href="forum.css">
</head>
<body bgcolor="#ffffff" alink="#333333" vlink="#333333" link="#333333" topmargin="0" background="../IMAGE/BCG_127.gif">
<br>
<%
	'on error resume next
	dim timelimited
	dim bid
	dim topic
	dim strcompare
	dim rs,sql
	dim itype
	dim announceid
	dim currentpage
	dim searchname
	dim totalrec
	itype=request("type")
	strCompare=request("selCompare")
	topic=trim(request("txtTopic"))
	announceid=trim(request("aid"))
	if isempty(request("page")) or isNull(request("page")) or (request("page")="")  then
		currentPage=1
	else
		if isInteger(request("page")) then
			currentPage=cint(request("page"))
        	else
			currentPage=1
        	end if
        	if err.number<>0 then 
			err.clear
            		currentPage=1
        	end if
	end if
	if request("selBoard")<>"" then bID=request("selBoard")
	
	if bID<>"" then
		call chkIntRequest()
	end if

	sub chkIntRequest()
		if not isInteger(bid)  then
			Response.Write "版面ID必须是整数"
			call endConnection()
			Response.End 
		end if
	end sub
	set rs=server.createobject("adodb.recordset")

	select case itype
	case 1
	if request("txtTopic")<>"" then sql="select locktopic,boardid,rootid,announceid,Expression,topic,username,child,hits,dateandtime from bbs1 where (" & translate(topic,"topic") & ") and boardID="&cstr(bid)&" ORDER BY announceID desc"
	searchname="按主题查询"
	case 2
	if request("txtuser")<>"" then sql="select locktopic,boardid,rootid,announceid,Expression,topic,username,child,hits,dateandtime from bbs1 where username like '%"&trim(request("txtuser"))&"%' and boardID="&cstr(bid)&" ORDER BY announceID desc"
	searchname="按用户名查询"
	case 3
	if request("txtCon")<>"" then sql="select locktopic,boardid,rootid,announceid,Expression,topic,username,child,hits,dateandtime from bbs1 where body like '%"&trim(request("txtCon"))&"%' and boardID="&cstr(bid)&" ORDER BY announceID desc"
	searchname="按内容查询"
	case 4
	if request("aid")<>"" then sql="select locktopic,boardid,rootid,announceid,Expression,topic,username,child,hits,dateandtime from bbs1 where announceID "&request("selCompare")&cstr(request("aid"))&" and boardID="&cstr(bid)&" ORDER BY announceID desc"
	searchname="按贴子ID查询"
	case 5
					dim tl
					tl=1
					timeLimited=request("selTimeLimit")
					if timeLimited="一天" then tl=1
					if timeLimited="一周" then tl=7
					if timeLimited="一月" then tl=30
					if timeLimited="一年" then tl=365
	sql="select locktopic,boardid,rootid,announceid,Expression,topic,username,child,hits,dateandtime from bbs1 where dateandtime>=#"&cdate(now()-tl)&"# and boardid="&cstr(bid)&" order by announceid desc"
	searchname="按日期查询"
	case 6
		select case cstr(strcompare)
			case "1"
		sql="select top 10 locktopic,boardid,rootid,announceid,Expression,topic,username,child,hits,dateandtime from bbs1 order by hits desc"
		searchname="按点击查询"
			case "2"
		sql="select top 50 locktopic,boardid,rootid,announceid,Expression,topic,username,child,hits,dateandtime from bbs1 order by announceid desc"
		searchname="最新贴子查询"
		end select
	case 7
	if request("name")<>"" then sql="select locktopic,boardid,rootid,announceid,Expression,topic,username,child,hits,dateandtime from bbs1 where username like '%"&trim(request("name"))&"%' ORDER BY announceID desc"
	searchname="用户发表文章查询"
	end select
	if sql="" then
		Errmsg=Errmsg+"<br>"+"<li>请指定查询条件。"
		call error()
		response.end
	end if
%>
<% 
	rs.open sql,conn,1,1

	if err.number<>0 then 
		Errmsg=Errmsg+"<br>"+"<li>数据库出错,查询失败。"
		call error()
		err.clear
	else
		if rs.eof and rs.bof then
		Errmsg=Errmsg+"<br>"+"<li>没有找到您要查询的内容。"
		call error()
		else
	      		totalrec=rs.recordcount 
      			if currentpage<1 then 
          			currentpage=1 
      			end if 

      			if (currentpage-1)*MaxAnnouncePerPage>totalrec then 
	   			if (totalrec mod MaxAnnouncePerPage)=0 then 
	     				currentpage= totalrec \ MaxAnnouncePerPage 
	   			else 
	      				currentpage= totalrec \ MaxAnnouncePerPage + 1 
	   			end if 
      			end if 
       			if currentPage=1 then 
            			call searchinfo()
       			else 
          			if (currentPage-1)*MaxAnnouncePerPage<totalrec then 
            				rs.move  (currentPage-1)*MaxAnnouncePerPage 
            				call searchinfo()
        			else 
	        			currentPage=1 
           				call searchinfo()
	      			end if 
	   		end if 
			call listPages3()
		end if
	end if
	set rs=nothing
	call endConnection()

	sub searchinfo()
%>
<span id=forum>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td width="25%"><font color="#003399">主题总数:<b><%=totalrec%>&nbsp; <FONT color=#003399></b>当前显示:<B><%=currentpage*25-24%>-<%=currentpage*25%></B></FONT><b>&nbsp;</b></font></td>
    <td width="75%"> 
      <p align="right"><a href="#"onClick="window.open('announce.asp?boardid=1&skin=1','caikuang','scrollbars=yes,resizable=yes,top=100,left=100,width=500,height=420')">[发表新贴]</a>  <a href="list.asp?boardid=1&skin=0">[BBS风格]</a>   <a href="#"onClick="window.open('reg.asp','caikuang','scrollbars=yes,resizable=yes,top=100,left=100,width=400,height=400')">[注册]</a>   <a href="Query.asp">[搜索帖子]</a> 
页码选择:   
 <%
    if currentpage=1 then
    %>首页 上页<%else    
    %><a href="javascript:viewPage1(1)" language="javascript">首页</a> <a href="javascript:viewPage1(<%=currentpage-1%>)" language="javascript">上页</a><%end if%>&nbsp;<%    
    if currentpage=n then
    %>下页 尾页<%else    
    %><a href="javascript:viewPage1(<%=currentpage+1%>)">下页</a> <a href="javascript:viewPage1(<%=n%>)">尾页</a><%end if %>  
    (第<strong><%=currentPage%></strong>页/共<strong><%=n%></strong>页) 
    </p>
 </td>
  </tr>
</table>
<table border="1" cellpadding="0" cellspacing="0" width="100%" bordercolorlight="#800000" bordercolordark="#800000">
<tr><td width="100%"><p align="center">
<table border=0 cellpadding=3 cellspacing=2 width="100%" class="table">

<tr bgcolor=#336600>
<td align=middle bgcolor=#800000 colspan=5 >
<p align="center"><font color="#FF3333" face="Webdings">6</font><font color="#FFFFFF">直接点击标题即可<b>在线</b>回复或查阅已回复贴子<font face="Webdings" color="#FF3333">6</font>
</font></p>
</td>
</tr>
<tr bgcolor=#cccccc>
<td align=center width="7%">回复</td>
<td align=center width="7%" nowrap>查阅</td>
<td align=left width="60%">
<p align=center class=sureyeah>主题 
</td>
<td align=left width="13%">
<p align=center>发言人</p>
</td>
<td align=left width="13%">
<div align="center">最后更新</div>
</td>
</tr>
<%
       do while not rs.eof
%>
<tr >
<td align=center width="7%" bgcolor="eeeeee">
<a title="红色此贴子回复人数,其他表示贴子编号及尚未有人回复"><font color="#FF6666">[<%=rs("child")%>]</font></a>
</td>
<td align=center bgcolor="eeeeee" width="7%"><%=rs("hits")%></td>
<td align=left bgcolor="eeeeee" width="60%">
<p><font color=<%=TableContent%>><a href="#"onClick="window.open('dispbbs.asp?boardID=<%=boardID%>&RootID=<%=rs("RootID")%>&ID=<%=rs("announceID")%>&skin=<%=skin%>','caikuang','scrollbars=yes,resizable=yes,top=20,left=20,width=700,height=600')"><%=htmlencode(rs("topic"))%></a>     
<%if rs("child")>Maxtitlelist then%>         
      &nbsp;&nbsp;[分页:         
<%
Pnum=Cint(rs("child")/Maxtitlelist)+1
for p=1 to Pnum
response.write " <a href='dispbbs.asp?boardID=1&RootID="&rs("RootID")&"&ID="&rs("announceID")&"&star="&P&"&skin=1' target=_blank><b>"&p&"</b></a> "
next
%>
]         
<%end if%></font>
</p>
</td>
<td align=left width="13%" bgcolor="eeeeee" nowrap>
<p align=left><%=htmlencode(rs("username"))%></p>
</td>
<td align=left width="13%" bgcolor="eeeeee" nowrap>
<%
on error resume next
set Ers=conn.execute("select username,dateandtime from bbs1 where announceid="&rs("times")&"")
response.write ""&FormatDateTime(rs("dateandtime"),2)&"&nbsp;"&FormatDateTime(rs("dateandtime"),4)&""
%></td>
</tr>
<%
i=i+1
if i>=MaxAnnouncePerPage then exit do
rs.movenext
loop
rs.close
%>
</table></td></tr></table>
<%
		if err.number<>0 then err.clear
	end sub

	sub listPages3()
	'on error resume next

%>
<table border="0" cellpadding="0" cellspacing="3" width="100%" align="center">
<form method="post" action="list.asp" name="frmList2">
        <input type=hidden name="selTimeLimit" value="<%=request("selTimeLimit")%>">
        <input type=hidden name="skin" value="<%=skin%>">
  <tr>
    <td valign="middle" nowrap><span class="smallFont">页次:<strong><%=currentPage%></strong>/<strong><%=n%></strong>页 每页<strong><%=MaxAnnouncePerPage%></strong> 总贴数<strong><%=totalrec%></strong></span></td>  
    <td valign="middle" nowrap>
      <div align="right"><p>分页:  
<%
	   for p=1 to n
	   if p<10 then
	       if p=currentPage then
	          response.write "["+Cstr(p)+"] "
		   else
		      response.write "<a href='javascript:viewPage2("+Cstr(p)+")' language='javascript'>["+Cstr(p)+"]</a>   "
		   end if
		end if
	next
%>
<span class="smallFont">转到:<input type="text" name="Page" size=3 maxlength=10  value="<%=currentpage%>"><input type="button" value="Go" language="javascript" onclick="viewPage1(document.frmList2.Page.value)" id="button1" name="button1"></span></p>        
      </div>    
    </td>
  </tr>
<input type="hidden" name="BoardID" value="<%=BoardID%>">
</form>
</table>

<%		if err.number<>0 then err.clear
	end sub 

	sub showEmptyBoard1()
%>
<TABLE bgColor='<%=Tableback%>' border=0 cellPadding=4 cellSpacing=1 width="100%" align=center>
  <TBODY>
  <TR bgColor='<%=Tabletitle%>'>
    <TD align=middle noWrap height=25><font color=<%=TableFont%>>状态</font></TD> 
    <TD align=middle noWrap><font color=<%=TableFont%>>主 题  (点心情符为开新窗浏览)</font></TD>   
    <TD align=middle noWrap><font color=<%=TableFont%>>作 者 </font></TD>   
    <TD align=middle noWrap><font color=<%=TableFont%>>回复/人气</font></TD> 
    <TD align=middle noWrap><font color=<%=TableFont%>>最新回复</font></TD></TR> 
  <tr bgColor="<%=Tablebody%>"><td colSpan=5 vAlign=center width="100%"><li>本论坛暂无内容,欢迎发贴。<li>或者在您选择的查询条件下没有相关贴子,请重新指定条件。</td></tr>
</TBODY></TABLE>
<%
	rs.close
	end sub
%>

⌨️ 快捷键说明

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