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

📄 questionformq2.asp

📁 本系统用来开发网络开发系统的实现
💻 ASP
字号:

<!--#include file="adovbs.inc" -->
<!--#include file="admin_conn.asp"-->

<HTML>
<head>
<link  href=../css.css rel=stylesheet type=text/css>
</head>
<BODY>

<%

set myrs=server.CreateObject("adodb.recordset")
myrs.Open "select count(*) from test_questions_store where 课程编号=" & session("courseID") & "",conn,adOpenStatic
set myrs1=server.CreateObject("adodb.recordset")
myrs1.Open "select 课程名称 from course where 课程编号=" & session("courseID") & "",conn,adOpenStatic

if myrs(0)>0 then
%>
	<P align="center"><STRONG><FONT  color=darkred  size=6>修改课程名称是:“<% =myrs1(0) %>”的试题</FONT></STRONG></P>
<%
	myrs1.Close
	const N=3
	set rs1=server.CreateObject("adodb.recordset")
	rs1.PageSize=N
	rs1.Open "select * from test_questions_store where 课程编号=" & session("courseID") & "",conn,adOpenStatic
	
	pageth=Request.QueryString("pageth")
	'判断页数是否为空
	if pageth="" then pageth="1"
	'判断页数是否为数字
	if not IsNumeric(pageth) then pageth="1"
	'判断数字是否大于总页数
	pageth=cint(pageth)
	if pageth>rs1.PageCount then pageth=rs1.PageCount 
	
	rs1.AbsolutePage=pageth
	%>

	<table align=center border=1 cellpadding=0 cellspacing=0 >

	<tr><td colspan="11">共有 <%=rs1.RecordCount%> 条记录,每页 <%=N%> 条,共 <%=rs1.PageCount%> 页,当前是第 <%=rs1.AbsolutePage%> 页 </td></tr>
	<tr align=center>
		<td>试题编号</td>
		<td>试题内容</td>
		<td>试题答案A</td>
		<td>试题答案B</td>
		<td>试题答案C</td>
		<td>试题答案D</td>
		<td>正确答案</td>
		<td>试题详解</td>
		
		<td width=30 align=center> 修改 </td>
		<td width=30 align=center> 删除 </td>
		
	</tr>
	<%	
		for i=1 to N
	%>
			<tr align=center>
			<td><%=Server.HTMLEncode(rs1(0))%></td>
			<td><%=Server.HTMLEncode(rs1(1))%></td>
			<td><%=Server.HTMLEncode(rs1(2))%></td>
			<td><%=Server.HTMLEncode(rs1(3))%></td>
			<td><%=Server.HTMLEncode(rs1(4))%></td>
			<td><%=server.HTMLEncode(rs1(5))%></td>
			<td><%=Server.HTMLEncode(rs1(6))%></td>
			<td><%=Server.HTMLEncode(rs1(7))%></td>

			<td><a  href=QuestionformQ2.asp?Qm=<% =rs1(0) %> >修改</a></td>
			<td><a  href=QuestionformQ2.asp?Qd=<% =rs1(0) %> >删除</a></td>	
	</tr>
	<%		
			rs1.MoveNext 
			if rs1.EOF then exit for  '避免存在半页时循环出现问题;
			
		next	
		pagepre=pageth-1
		pagenext=pageth+1
		if pagepre<1 then pagepre=1
		if pagenext>rs1.PageCount then pagenext=rs1.PageCount 
	%>
	<tr>
	<td colspan=11>
	<form action="QuestionformQ2.asp" method="get" id=form1 name=form1>
	<%
	'如果当前页不是第一页,则显示;
	if pageth<>1 then
	%>
	<a href="QuestionformQ2.asp?pageth=1">第一页</a> | 
	<a href="QuestionformQ2.asp?pageth=<%=pagepre%>">上一页</a> | 
	<%
	end if
	'如果当前页不是最后一页,则显示;
	if pageth<>rs1.PageCount then
	%>
	<a href="QuestionformQ2.asp?pageth=<%=pagenext%>">下一页</a>
	<a href="QuestionformQ2.asp?pageth=<%=rs1.PageCount%>">最后一页</a> | 
	<%
		end if
	%>
	转向第<input name="pageth"  size=2>页
		<input type="submit" value=" GO " id=submit1 name=submit1>
	</form>
	<%
		rs1.Close
	%>
	</td>
	</tr>
	</table>
	<%
	dim Qdel1,sqlstring			'87
		Qdel1=Request.QueryString("Qd")
		if Qdel1>0 then
			sqlstring="delete from test_questions_store where id =" & Qdel1 & ""
			conn.Execute(sqlstring)
			%>
			<script  language="javascript">
			<!--
				window.alert("已成功删除。");
			-->
			</script>			
			<%		
		end if
else
	Response.Write "<h1><p align=center> 没有试题 </p></h1>"
end if
session("questionsID")=Request.QueryString("Qm")
if Request.QueryString("Qm") > 0 then
	Response.Redirect("Qmodify.asp")
end if
myrs.Close
%>

<%
	conn.Close
%>
<P align=center><a href=QuestionFormQ.asp>返回组合查询</a></P>
</BODY>
</HTML>

⌨️ 快捷键说明

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