📄 testlist.asp
字号:
<!--#include file="ADOFunctions.asp"-->
<!--#include file="admin_conn.asp"-->
<%
' If Not Request.Cookies("Passed")="Passed" Then
' Response.Write"<center>"&"您还没有登录!"&"</center>"
' Response.End
' End If
'If Not Request.Cookies("qx")="1" Then
' Response.Write"<center>"&"您的权限不够,无权查看此页!"&"</center>"
' Response.End
' End If
sub addrs(shijuan,miaoshu,shijian,tiliang,xueqi)
'set conn=server.CreateObject("adodb.connection")
'conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("s223bsh03.mdb") & ";Persist Security Info=False"
'conn.Open application("constring")
dim strsql
'dim shijuanb
'dim miaoshub
'dim shijianb
' dim tilaingb
' dim xueqib
kechengjihe=split( kechengjihe , ", " )
strsql="INSERT INTO TEST_PAPER (题目编号,试卷描述,考试时间,题量,学期) "
strsql=strsql & " values ('" & shijuan & "','" & miaoshu & " ','" & shijian & " ','" & cint(tiliang) & " ','" & xueqi & "')"
Err.Clear
on Error resume next
conn.Execute (strsql)
if (Err.number<>0) then
Response.Write "error:" + Err.Description
conn.Close
Err.Clear
%>
<script language="javascript">
<!--
window.alert ("添加失败!");
history.back(1)
-->
</script>
<%
else
%>
<script language="javascript">
<!--
window.alert ("添加试卷成功!请在此页面查看试卷信息。");
-->
</script>
<%
Response.Redirect "testlist.asp"
end if
end sub
Sub ShowPage(objRS,PageNo)
Response.Write "<TABLE width=960 border='0' align='center' cellpadding='0' cellspacing='1' >"
Response.Write "<tr>"
Response.Write "<td height='25' width=80 align='center'><strong><font size='2'>试卷编号</font></strong></td>"
Response.Write "<td height='25' width=100 align='center' ><strong><font size='2'>题目序列</font></strong></td>"
Response.Write "<td height='25' width=80 align='center'><strong><font size='2'>试卷描述</font></strong></td>"
Response.Write "<td height='25' width=80 align='center' ><strong><font size='2'>考试时间</font></strong></td>"
Response.Write "<td height='25' width=50 align='center' ><strong><font size='2'>题量</font></strong></td>"
Response.Write "<td height='25' width=80 align='center' ><strong><font size='2'>学期</font></strong></td>"
'Response.Write "<td height='25' width=160 align='center'><strong><font size='2'>Email</font></strong></td>"
'Response.Write "<td height='25' width=180 align='center' ><strong><font size='2'>个人网站</font></strong></td>"
Response.Write "<td height='25' width=50 align='center' ><strong><font size='2'>选择</font></strong></td>"
Response.Write "</tr>"
objRS.AbsolutePage = PageNo
For I = 1 To objRS.PageSize
Response.Write "<TR>"
Response.Write "<td height='25' align='center' >"&"<font color=#003366 size=2>"&objRS("id")&"</font>"&"</td>"
Response.Write "<td height='25' align='center' >"&"<font color=#003366 size=2>"&objRS("题目编号")&"</font>"&"</td>"
Response.Write "<td height='25' align='center' >"&"<font color=#003366 size=2>"&objRS("试卷描述")&"</font>"&"</td>"
Response.Write "<td height='25' align='center' >"&"<font color=#003366 size=2>"&objRS("考试时间")&"</font>"&"</td>"
Response.Write "<td height='25' align='center' >"&"<font color=#003366 size=2>"&objRS("题量")&"</font>"&"</td>"
Response.Write "<td height='25' align='center' >"&"<font color=#003366 size=2>"&objRS("学期")&"</font>"&"</td>"
'Response.Write "<td height='25' align='center' >"&"<font color=#003366 size=2>"&objRS("email")&"</font>"&"</td>"
'Response.Write "<td height='25' align='left' >"&"<font color=#003366 size=2>"&objRS("url")&"</font>"&"</td>"
Response.Write "<td height='25' align='center' >"&"<A HREF=deletetest.asp?No=" & objRS("id") & ">删除</a>"&"</td>"
Response.Write "</TR>"
objRS.MoveNext
If objRS.EOF Then Exit For
Next
Response.Write "</TABLE>"
End Sub
%>
<html>
<head>
<title>试卷列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<body bgcolor="#D8E2E4">
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="30">
<%
if Request.Form("add")="add" then
paper_list=trim(Request.Form("shijuanstr"))
paper_miaoshu=trim(Request.Form("shijuanshuoming"))
paper_time=trim(Request.Form("BeginInputDate"))
paper_liang=trim(Request.Form("tiliang"))
paper_trem=Request.Form("xueqi")
'response.write (paper_list)
'response.write (paper_miaoshu)
'response.write (paper_time)
'response.write (paper_liang)
'response.write (paper_trem)
'response.write ("++++++++++++++<br>")
addrs paper_list,paper_miaoshu,paper_time,paper_liang,paper_trem
end if
%>
<%
set objConn=server.CreateObject("adodb.connection")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("..\data\s223bsh03.mdb") & ";Persist Security Info=False"
'objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\zl\lab\data\s223bsh03.mdb ;Persist Security Info=False"
'Set objRS = GetRecordset("s223bsh03.mdb", "test_paper")
set objRS=server.CreateObject("adodb.recordset")
objRS.Open "select * from test_paper order by id desc",objConn,adOpenStatic
objRS.PageSize = 5
PageNo = Request("PageNo")
Response.Write "<font color=#006699 size=2>"&"<<"&" "&"</font>"
For i = 1 To objRS.PageCount
Response.Write "<font color=#006699 size=2>"&"["&"</font>"
If i = CInt(PageNo) Then
Response.Write "<font color=#006699 size=2>"&i&"</font>"
Else
Response.Write "<A HREF='testlist.asp?PageNo="&i&"'>"&"<font color=#006699 size=2>"&i&"</font>"&"</A>"
End If
Response.Write "<font color=#006699 size=2>"&"]"&"</font>"
Next
Response.Write "<font color=#006699 size=2>"&" "&">>"&"</font>"
If PageNo <> "" Then
ShowPage objRS, PageNo
Else
ShowPage objRS, 1
End If
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
</td>
</tr>
</table>
<hr>
<a href="managerdisplay.htm">回首页</a>
<p><a href="mandomain.asp">继续添加试卷</a>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -