📄 selectlist.asp
字号:
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>在线考试系统</title>
<link rel="stylesheet" type="text/css" href="../DEFAULT.CSS">
<script language="JavaScript1.2" src="../js/lock.js"></script>
<script language="JavaScript">
function additem(para)
{
var oOption = window.opener.document.createElement("OPTION");
oOption.text=para;
oOption.value=para;
if(document.all.itype.value=="单选题")
{
coll=window.opener.document.all.singlelist;
if(coll.length>0)
{
for(i=0;i<coll.options.length;i++)
{
if(coll.options(i).value!=para)
{
result=true;
}
else
{
result=false;
break;
}
}
}
else
{
result=true;
}
if(result)
{
coll.add(oOption);
}
}
if(document.all.itype.value=="多选题")
{
coll=window.opener.document.all.multilist;
if(coll.length>0)
{
for(i=0;i<coll.options.length;i++)
{
if(coll.options(i).value!=para)
{
result=true;
}
else
{
result=false;
break;
}
}
}
else
{
result=true;
}
if(result)
{
coll.add(oOption);
}
}
if(document.all.itype.value=="判断题")
{
coll=window.opener.document.all.judgelist;
if(coll.length>0)
{
for(i=0;i<coll.options.length;i++)
{
if(coll.options(i).value!=para)
{
result=true;
}
else
{
result=false;
break;
}
}
}
else
{
result=true;
}
if(result)
{
coll.add(oOption);
}
}
}
function delitem(para)
{
if(document.all.itype.value=="单选题")
{
coll=window.opener.document.all.singlelist;
for(i=0;i<coll.options.length;i++)
{
if(coll.options(i).value==para)
{
coll.remove(i);
}
}
}
if(document.all.itype.value=="多选题")
{
coll=window.opener.document.all.multilist;
for(i=0;i<coll.options.length;i++)
{
if(coll.options(i).value==para)
{
coll.remove(i);
}
}
}
if(document.all.itype.value=="判断题")
{
coll=window.opener.document.all.judgelist;
for(i=0;i<coll.options.length;i++)
{
if(coll.options(i).value==para)
{
coll.remove(i);
}
}
}
}
</script>
</head>
<body bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#007CD0" width="100%" id="AutoNumber1">
<tr>
<td width="100%">当前位置:<font color="#FF0000">选择试题</font></td>
</tr>
</table>
<% Dim i,page,ipage,myself,param
sql="select * from view_database where havepass=1 and subject='"&request("subject")&"' and type='"&request("type")&"'"
rs.open sql,conn,3,2
if rs.eof then %>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="20" class="noborder" bgcolor="#F1F1F1">
<tr>
<td width="100%" class="border">
<p align="center">没有符合条件的试题!</td>
</tr>
</table>
<% else %>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#007CD0" width="100%" id="AutoNumber4" bgcolor="#F1F1F1">
<tr>
<td height="20" class="border_blue" colspan="5"> 当前列表说明</td>
</tr>
<tr>
<td height="20" colspan="5"> 【<font color="red"><%=request("subject")%></font>】题库【<font color="red"><%=request("type")%></font>】列表</td>
</tr>
<tr>
<td height="20" class="border" align="center" width="20"></td>
<td class="border" align="center">试题编号</td>
<td class="border" align="center">试题内容</td>
<td class="border" align="center">答案</td>
</tr>
<% on error resume next
rs.PageSize = 20
Page = CLng(Request("Page"))
If Page < 1 Then Page = 1
If Page > rs.PageCount Then Page = rs.PageCount
i=page+(page-1)*19
rs.AbsolutePage = Page
For iPage = 1 To rs.PageSize %>
<tr>
<td height="20" align="center" width="20"><input name="chkitem" type="checkbox" value="<%=rs("id")%>" onclick="if(this.checked) { additem('<%=rs("id")%>'); } else { delitem('<%=rs("id")%>'); }"> </td>
<td align="center"><%=rs("id")%> </td>
<td><a href="viewdatabase.asp?id=<%=rs("id")%>"> <%=left(rs("question"),23)%></a> </td>
<td align="center"><%=rs("answer")%> </td>
</tr>
<% rs.MoveNext
If rs.EOF Then Exit For
i=i+1
Next
%>
</table>
<input type="hidden" id="itype" value="<%=request("type")%>">
<%
param="&subject=" & request("subject") & "&type=" & request("type")
%>
<form ACTION="<%=Myself%>" METHOD="GET">
<div align="right">
<table cellspacing="0" cellpadding="0" class="withborder" style="border-collapse: collapse" bordercolor="#007CD0" width="100%" bgcolor="#F1F1F1" border="1">
<tr>
<td>
<p align="right"><%If Page <> 1 Then %>
<a href="<%=myself%>?page=1<%=param%>">第一页</a>
<a href="<%=myself%>?page=<%=(Page-1)%><%=param%>">上一页</a>
<% End If
If Page <> rs.PageCount Then %>
<a href="<%=myself%>?page=<%=(Page+1)%><%=param%>">下一页</a>
<a href="<%=myself%>?page=<%=rs.PageCount%><%=param%>">最后一页</a> <% End If %>
输入页次:<input name="Page" size="3" class="s01"> 页次:<font color="Red"><%=Page%>/<%=rs.PageCount%></font> </td>
</tr>
</table>
</div>
</form>
<%
end if
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -