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

📄 admin_homework.asp

📁 数值计算方法网络课件系统是浙江大学过程装备与控制工程专业2001级本科生毕业设计成果。本系统采用ASP+ACCESS架构
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="../inc/func2.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/pagebar.asp"-->

<%
if session("isAdminLoged")<>"logined" then
	Response.Write FSOFileRead("../html/admin_login.txt")
	Response.End
End if
dim adminTxt, strList, strList2, txt

Select Case Request.QueryString("action")
Case "list"
	Call DBConnBegin()
	Sql="select * from notice order by id desc"
	dim curpage,i
	if Request.QueryString("page")="" then
	curpage=1
	else 
	curpage=Request.QueryString("page")
	end if
	Rs.Open Sql,conn,1,1
	if Rs.BOF and Rs.EOF then
		txt="<div id='content'><h4>试题列表</h4>数据库中还没有记录!</div>"
	else
	RS.pagesize = 10
	RS.absolutepage = curpage 
	for i = 0 to RS.pagesize-1
		strList2 = "<tr><td>{theTitle}<td align='center'>{theChapter}<td align='center'>{theCupid}<td width='100' align='center'>{theTime}<td align='center'>{theHits}<td align='center'><a href='admin_homework.asp?action=edit&id={theID}'>编辑</a> <a href='admin_homework.asp?action=delnotice&id={theID}'>删除</a></tr>"
		strList2=replace(strList2,"{theTitle}",rs("title"))
		strList2=replace(strList2,"{theChapter}",rs("chapter"))
		strList2=replace(strList2,"{theCupid}",CIntToChar(rs("cupid")))
		strList2=replace(strList2,"{theTime}",rs("time"))
		strList2=replace(strList2,"{theHits}",rs("hits"))
		strList2=replace(strList2,"{theID}",rs("id"))
		strList = strList & strList2
		rs.movenext
		if RS.eof then
			i = i + 1
			exit for
		End If
	next
	End if
	dim pagebar
	pagebar= ExportPageInfo(Rs, curpage, i, "admin_homework.asp?action=list"&"&")
	strList =  "<table border=1 cellspacing=""1"" cellpadding=""0"" bordercolor=#ACf4e7><tr><td align='center' width='260' height='30'>标题<td align='center'>所属章节<td align='center' width='80'>所在分类<td width='100' align='center'>加入时间<td align='center'>点击次数<td align='center' width='100'>操作</tr>" & strList & "</table><br>" & pagebar & "<br>"

Case "add"
	strList = FSOFileRead("../html/admin_addnotice.txt")
	strList = replace(strList,"{topicStr}","")
	strList = replace(strList,"{theAuthor}","")
	strList = replace(strList,"{theContent}","")
	strList = replace(strList,"{theAction}","add")

Case "delnotice"
	Call DBConnBegin()
	Conn.Execute("delete from notice where id="&request.querystring("id"))
	Call DBConnEnd()
	Response.Redirect "admin_homework.asp?action=list"

Case "edit"
	strList = FSOFileRead("../html/admin_editnotice.txt")
	Call DBConnBegin()
	sql="Select * from notice where id=" & Request.QueryString("id")
	rs.open sql,conn,1,1
	strList = replace(strList,"{topicStr}",rs("title"))
	strList = replace(strList,"{theAuthor}",rs("name"))
	strList = replace(strList,"{theContent}",rs("say"))
	strList = replace(strList,"{theAction}","edit")
	strList = replace(strList,"{theID}",rs("id"))
	strList = replace(strList,"{"&rs("cupid")&"}", "selected")
	strList = replace(strList,"{chapter"&rs("chapter")&"}", "selected")
	Call DBConnEnd()

Case "save"
		Dim j
		Dim sContent
		sContent = ""
		For j = 1 To Request.Form("d_say").Count
		sContent = sContent & Request.Form("d_say")(j)
		Next
		Call DBConnBegin()
		if Request.Form("action")="add" then
		sql="Select * from notice where title is null"
		rs.open sql,conn,3,3
		rs.addnew
		end if
		if Request.Form("action")="edit" then
		sql="Select * from notice where id=" & Request.Form("id")
		rs.open sql,conn,3,3
		end if
		rs("name")=Request.Form("author")
		rs("title")=Request.Form("d_title")
		rs("cupid")=Request.Form("cupid")
		rs("chapter")= CInt(Request.Form("chapter"))
		rs("say")=sContent
		rs("hits")=0
		rs.update
		Call DBConnEnd()
		Response.Redirect "admin_homework.asp?action=list"

Case else
	Response.Redirect "admin_homework.asp?action=list"
End Select

txt = FSOFileRead("../html/admin_homework.txt")
txt = Replace(txt, "{theTitle}", "列表")
txt = Replace(txt, "{theHomeworkList}", strList)

Response.Write txt


%>

⌨️ 快捷键说明

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