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

📄 admin_courseware.asp

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

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

Dim txtR,txtAll
txtAll = FSOFileRead("../html/admin_courseware.txt")

Select Case trim(Request.QueryString("action"))
	Case "add"
		txtAll = replace(txtAll,"{theTitle}","添加课件")
		txtR = FSOFileRead("../html/admin_coursewareadd.txt")
	Case "list"
		txtAll = replace(txtAll,"{theTitle}","课件列表")
		dim txtRtop,txtRcon
		txtRtop = "<table><tr><td class='listtop1'>名称<td class='listtop1'>章节<td class='listtop1'>类型<td class='listtop1'>加入时间<td class='listtop1'>点击次数<td class='listtop2'>操作</tr>"
		Call DBConnBegin()
		sql = "select * from courseware"
		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
			txtR="<div id='content'><h4>试题列表</h4>数据库中还没有记录!</div>"
		else
			RS.pagesize = 10
			RS.absolutepage = curpage 
			for i = 0 to RS.pagesize-1
				txtRcon = "<tr><td class='listcont'>{theTitle}<td class='listtop1'>{theChapter}<td class='listtop1'>{theFiletype}<td class='listtop1'>{theDay}<td class='listtop1'>{theHits}<td class='listtop1'><a href='admin_courseware.asp?action=edit&id={theID}'>编辑</a> <a href='admin_courseware.asp?action=delcourse&id={theID}'>删除</a></tr>"
				txtRcon = replace(txtRcon, "{theTitle}", rs("title"))
				txtRcon = replace(txtRcon, "{theChapter}", rs("chapter"))
				txtRcon = replace(txtRcon, "{theFiletype}", rs("filetype"))
				txtRcon = replace(txtRcon, "{theDay}", rs("theday"))
				txtRcon = replace(txtRcon, "{theHits}", rs("hits"))
				txtRcon = replace(txtRcon, "{theID}", rs("id"))
				txtR = txtR & txtRcon
				RS.movenext 
				if RS.eof then
					i = i + 1
					exit for
				End If
			next 
			dim pagebar
			pagebar= ExportPageInfo(Rs, curpage, i, "admin_courseware.asp?action=list&")
			txtR = txtRtop & txtR & "</table><p/>" & pagebar 
		End if
		Call DBConnEnd()
	Case "edit"
		txtAll = replace(txtAll,"{theTitle}","修改课件信息")
		Call DBConnBegin()
		sql = "select * from courseware where id="&trim(Request.QueryString("id"))
		rs.open sql,conn,1,1
		if rs.BOF and rs.EOF then
			GoError " 参数错误!请单击相应链接进入本页面。"
			response.End
		else
			txtR = FSOFileRead("../html/admin_coursewareedit.txt")
			txtR = replace(txtR, "{theTitle}", rs("title"))
			txtR = Replace(txtR, "{chapter"&Rs("chapter")&"}", "selected")
			txtR = replace(txtR, "{type"&Rs("filetype")&"}", "selected")
			txtR = replace(txtR, "{theFileurl}", rs("fileurl"))
			txtR = replace(txtR, "{theDescribe}", rs("describe"))
		End if
		Call DBConnEnd()

	Case "delcourse"
		Call DBConnBegin()
		Conn.Execute("delete from courseware where id="&request.querystring("id"))
		Call DBConnEnd()
		Response.Redirect ("admin_courseware.asp?action=list")
			
	Case ""
		Select Case trim(Request.Form("action"))
		Case "save"
			Call DBConnBegin()
			sql="Select * from courseware where title is Null"
			rs.open sql,conn,1,3
			rs.addnew
			rs("title")=Request.Form("title")
			rs("chapter")=Request.Form("chapter")
			rs("fileurl")=Request.Form("fileurl")
			rs("filetype")=Request.Form("filetype")
			rs("describe")=Request.Form("describe")
			rs("hits")=0
			rs.update
			Call DBConnEnd()
			Response.redirect "admin_courseware.asp?action=list"
		Case else
			Response.redirect "admin_courseware.asp?action=list"
		End Select
		
		
End Select

txtAll = replace(txtAll,"{theContent}",txtR)

Response.write txtAll
%>

⌨️ 快捷键说明

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