📄 admintopic.asp
字号:
<!--#include file="Check.asp"-->
<!--#include file="Conn.asp"-->
<!--#include file="Functions.asp"-->
<%
Dim TeachingSujectID
TeachingSujectID = Session("TestTeachingSujectID")
Session("TestTeachingSujectID") = TeachingSujectID
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=application("TestVerSion")%></title>
<script language="javascript">
function editit(id)
{
page="EditTopic.asp?id="+id
window.open (page,'','width=560,height=440,resizable=1,scrollbars=yes')
}
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.name != 'chkall')
e.checked = form.chkall.checked;
}
}
function addit(myform)
{
if (document.ShowIt.subjectview.value!="" & document.ShowIt.typeadd.value!=""){
page="AddTopic.asp?typeadd="+document.ShowIt.typeadd.value+"&subjectview="+document.ShowIt.subjectview.value;
location.href = page;
}
else
{
alert("请首先选择自测类型和题目类型!");
return false;}
}
function delit(myform)
{
result="是否从题库中删除所选项?"
if (confirm(result))
{
document.viewdatabase.action="DelTopic.asp";
document.viewdatabase.submit();
}
else
return false;
}
</script>
<link rel="stylesheet" type="text/css" href="css.css">
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
body {
background-color: #B1DB99;
}
-->
</style></head>
<body>
<table width="100%" height="18" border="0" cellspacing="1" bordercolor="#C0C0C0" bgcolor="#D9ECFF" id="AutoNumber2" style="border-collapse: collapse">
<tr>
<td width="100%" background="../images/Down_bg.gif"> <%response.Write(Session("TeachingSujectID")&"0")%> ★ <strong>当前位置: <font color="#FF0000">题库管理</font></strong></td>
</tr>
</table>
<br>
<table border="1" cellpadding="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#C0C0C0" width="100%">
<form name="viewdatabase" method="post"><tr>
<td width="30" height="20" align="center" bgcolor="#D9ECFF">
<input type="checkbox" name="chkall" value="on" onClick="CheckAll(this.form)" style="font-size: 9pt; color: #000000">
</td>
<td width="30" align="center" bgcolor="#D9ECFF"><font color="#666666"><b>序号</b></font></td>
<td width="120" align="left" bgcolor="#D9ECFF">
<p align="center"><font color="#666666"> <b>所属类型</b></font></td>
<td align="left" bgcolor="#D9ECFF">
<p align="center"><font color="#666666"><b>题目内容</b></font></td>
<td align="left" bgcolor="#D9ECFF">
<p align="center"><font color="#666666"><b>题型</b></font></td>
<td width="30" align="left" bgcolor="#D9ECFF">
<p align="center"><font color="#666666"><b>操作</b></font></td>
</tr>
<%
subjectview=request("subjectview")
typeadd=request("typeadd")
mykey=request("mykey")
HowTo=Request("HowTo")
If Subjectview="" and typeadd="" and mykey="" Then
iSQL="select * from TestTopic where TeachingSujectID = "& TeachingSujectID &" order by id desc"
Else
If mykey<>"" Then'指定搜索条件
If Subjectview="" And TypeAdd<>"" Then
iSQL="select * from TestTopic where type='"& typeadd &"' and Question like '%"& mykey &"%' and TeachingSujectID = "& TeachingSujectID &" order by id desc"
ElseIF Subjectview<>"" And TypeAdd="" Then
iSQL="select * from TestTopic where Subject='"& Subjectview &"' and Question like '%"& mykey &"%' and TeachingSujectID = "& TeachingSujectID &" order by id desc"
Else
iSQL="select * from TestTopic where Question like '%"& mykey &"%' and TeachingSujectID = "& TeachingSujectID &" order by id desc"
End IF
Else'mykey=''时
If Subjectview="" And TypeAdd<>"" Then
iSQL="select * from TestTopic where type ='"& typeadd &"' and TeachingSujectID = "& TeachingSujectID &" order by id desc"
ElseIF Subjectview<>"" And TypeAdd="" Then
iSQL="select * from TestTopic where Subject='"& Subjectview &"' and TeachingSujectID = "& TeachingSujectID &" order by id desc"
Else
iSQL="select * from TestTopic where type ='"& typeadd &"' "& HowTo &" Subject='"& Subjectview &"' and TeachingSujectID = "& TeachingSujectID &" order by id desc"
End If
End If
End if
set rs=server.createobject("adodb.recordset")
rs.open iSQL,conn,3,2
rs.PageSize =10 '每页记录条数
iCount=rs.RecordCount '记录总数
iPageSize=rs.PageSize
if iCount<=0 then
if search="" then
word="目前还没有记录!"
else
word="没有查到符合条件的记录!"
end if
else
maxpage=rs.PageCount
page=request("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif page>maxpage then
page=maxpage
end if
rs.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if
end if
For i=1 To x
%>
<tr>
<td align="center" bgcolor="#D9ECFF"> <font color="#666666">
<input type="checkbox" name="id" value="<%=rs("id")%>">
</font></td>
<td align="center"><%=i%> </td>
<td align="left"><%=rs("subject")%></td>
<td align="left"><%=rs("question")%> </td>
<td align="left"><%=rs("type")%> </td>
<td align="left"> <p align="center"><a href="javascript:editit(<%=rs("id")%>)">
<img border="0" src="images/edit.gif" alt="查看/编辑"></a></td>
</tr>
<%
rs.MoveNext
Next
%></form>
<tr align="right">
<td colspan="6"><% call PageControl(iCount,maxpage,page,"border=0 align=right","<p align=center class=font2>") %>
</td>
</tr>
</table>
<div ALIGN="right">
<table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bgcolor="#D9ECFF" width="100%">
<form name="ShowIt" method="POST" action="AdminTopic.asp">
<tr>
<td align="right">
<input type="button" value="删除所选项" name="I3" class="b2" onClick="delit(this.form)">
<select size="1" name="subjectview">
<option selected value="">--选择题目类型--</option>
<% sql="select * from TestSubject where teachingSujectId = "& TeachingSujectID &" order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
do while not rs.eof
If Request("subjectview")=rs("TestSubject") Then
s="Selected"
Else
s=""
End If
%>
<option value="<%=rs("TestSubject")%>" <%=s%>><%=rs("TestSubject")%></option>
<% rs.movenext
loop
rs.close %>
</select> <Select Name='HowTo'>
<option value=AND>AND</option>
<option value=OR>OR</option>
</select> <select size="1" name="typeadd">
<option selected value="">--题型--</option>
<option value="单选题">单选题</option>
<option value="多选题">多选题</option>
<option value="判断题">判断题</option>
</select> <input type="button" value="添加题目" name="I6" onClick="addit(ShowIt)" class="b2">
<input type="text" name="mykey" size="10" value="<%=Request("mykey")%>" class="b1"> <input type="submit" value="查 询" name="I7" class="b2">
</td>
</tr>
</form>
</table>
</div>
</div>
</td>
</tr>
</table>
</body>
</html>
<script Language=JavaScript>
<%if Request.form("typeadd")<>"" Then%>
document.ShowIt.typeadd.value="<%=typeadd%>";
<%End If%>
<%if Request.form("HowTo")<>"" Then%>
document.ShowIt.HowTo.value="<%=HowTo%>";
<%End If%>
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -