www.gusucode.com > ASP+ACCESS在线教育系统设计(源代码+论文) > ASP+ACCESS在线教育系统设计(源代码+论文)\王智_在线教育系统\problem.asp

    <%@  Language = "VBScript"  %>
<!-- #Include file="include\adovbs.inc" -->
<!-- #Include file="include\cod_ado.inc" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<!-- #Include file="include\style.inc" -->
</head>
<body>
<%
	strPage = Request.queryString("page")
	
	dim objCnn,rs
	strDSN = Application("dsn")
	strSQL = "select id,title,time_qry,flag_answer from problems where flag_show=true order by id desc"
	cod_AdoOpen objCnn,rs,strDSN,strSQL
%>
<%
	if rs.RecordCount>0 then 
		sumcount = rs.RecordCount
		rs.MoveFirst
	end if
		rs.PageSize = 20	
		intPageCount = rs.PageCount
		if Len(strPage) = 0 then strPage = "1"
		if int(strPage)<1 then strPage = "1"
		'if int(strPage)>intPageCount then strPage = CStr(intPageCount)
		if rs.eof then 
%>
<form method="POST" action="insertproblem.asp">
  <h3>您的问题是:</h3>
  <p>问题标题:<input type="text" name="title" size="42"></p>
  <p>问题内容:</p>
  <p><textarea rows="10" name="problem" cols="50"></textarea></p>
  <p><input type="submit" value="提交问题" name="B1"><input type="reset" value="重新填写" name="B2"></p>
</form>
<%			
			response.end 
		end if
		rs.absolutepage=cint(strpage)
%>

<table border="0" cellspacing="1" width="600">
<tr><td colspan=3 align=center>
[<a href="#A">我要提问</a>][本页是第<%=int(strPage)%>/<%=intPageCount%>页] <% 
		if int(strPage)>1 then
%> 
[<a href="problem.asp?page=<%=CStr( int(strPage)-1 )%>">前一页</a>] <%
		end if
%> <% 
		if int(strPage)<intPageCount then
%> [<a href="problem.asp?page=<%=CStr( int(strPage)+1 )%>">下一页</a>] <%
		end if
%>
</td></tr>
</table>
<table border="0" cellspacing="1" width="600">
<tr class="tr3">
    <td width="70" align=center>序号</td>
    <td width="*" align=center>提问标题</td>
    <td width="150" align="center">提问时间</td>
    <td width="80" align="center">回答标志</td>
</tr>
<% 
dim flagcolor,classtype
flagcolor = true

for intRecord = 1 To rs.PageSize 
	if rs.EOF then 
		exit for
	end if
	
flagcolor = not (flagcolor)	
if (flagcolor) then 
	classtype = "tr1"
else 
	classtype = "tr2"
end if
%>
  <tr class="<%=classtype%>">
    <td align=center><%=sumcount-12*(cint(strpage)-1)-intRecord+1%></td>
    <td><a href="problem_item.asp?ID=<%=rs("ID")%>&amp;page=<%=strpage%>"><%=rs("title")%></a></td>
    <td align="center"> <%=Formatdatetime(rs("time_qry"),1)%> </td>
    <td align="center"> 
    <%
    if (rs("flag_answer")) then 
		Response.Write "已回答"
	else
		Response.Write "未回答"
	end if
    %> </td>
  </tr>
<%
	rs.MoveNext			
Next 
%>
</table>
<table border="0" cellspacing="1" width="600">
<tr><td colspan=3>
<p align="center">[本页是第<%=int(strPage)%>/<%=intPageCount%>页] <% 
		if int(strPage)>1 then
%> 
[<a href="problem.asp?page=<%=CStr( int(strPage)-1 )%>">前一页</a>] <%
		end if
%> <% 
		if int(strPage)<intPageCount then
%> [<a href="problem.asp?page=<%=CStr( int(strPage)+1 )%>">下一页</a>] <%
		end if
%> </p>
</td></tr>

<tr class=tr1><td colspan=3>
<a name="A">
<form method="POST" action="insertproblem.asp">
  <h3>您的问题是:</h3>
  <p>问题标题:<input type="text" name="title" size="42"></p>
  <p>问题内容:</p>
  <p><textarea rows="10" name="problem" cols="70" wrap=hard></textarea></p>
  <p><input type="submit" value="提交问题" name="B1">
  <input type="reset" value="重新填写" name="B2"></p>
</form>
</a>
</td></tr>
</table>

<%
call cod_AdoClose(objCnn, rs)
%>
</body>
</html>