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

📄 admin_tiku.asp

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

<%
'**************** 后台管理系统首页 *************
'** File: admin/index.asp V1.0 2005.05.08
'** Author: wwxbei
'***********************************************
if session("isAdminLoged")<>"logined" then
	Response.Write FSOFileRead("../html/admin_login.txt")
	Response.End
End if

dim adminTxt, strEdit, strEdit2, txt

Select Case Request.QueryString("action")
Case "add"

	Select Case Request.QueryString("tixing")
		Case "1"
			txt = FSOFileRead("../html/admin_choice.txt")
		Case "2"
			txt = FSOFileRead("../html/admin_choice.txt")
		Case "3"
			txt = FSOFileRead("../html/admin_judge.txt")
		Case "4"
			txt = FSOFileRead("../html/admin_fillin.txt")
		Case "5"
			txt = FSOFileRead("../html/admin_calcul.txt")
			txt = Replace(txt, "{theTixing}", "5")
			txt = Replace(txt, "{theTitle}", "添加问答题")
		Case "6"
			txt = FSOFileRead("../html/admin_calcul.txt")
			txt = Replace(txt, "{theTixing}", "6")
			txt = Replace(txt, "{theTitle}", "添加计算题")
	End Select

Case "list"
	
	strEdit2=""
	Call DBConnBegin()
	Select Case Request.QueryString("tixing")
		Case "1"
			Sql="select * from choice order by id desc"
		Case "2"
			Sql="select * from choice order by id desc"		
		Case "3"
			Sql="select * from judgment order by id desc"
		Case "4"
			Sql="select * from fillin order by id desc"
		Case "5"
			Sql="select * from calculation where type=5 order by id desc"
		Case "6"
			Sql="select * from calculation where type=6 order by id desc"
	End Select
	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
		strEdit = "<tr><td class='listcont'>{theQuestion}</td><td class='listtop2'><a href='admin_tiku.asp?action=edit&tixing={theTixing}&id={theID}'>编辑</a>&nbsp&nbsp<a href='admin_handle.asp?action=del&tixing={theTixing}&id={theID}'>删除</a></td></tr>"
		strEdit = Replace(strEdit,"{theQuestion}",Rs("question"))
		strEdit = Replace(strEdit,"{theTixing}",Request.QueryString("tixing"))
		strEdit = Replace(strEdit,"{theID}",Rs("id"))
		strEdit2= strEdit2 & strEdit
		RS.movenext 
		if RS.eof then
			i = i + 1
			exit for
		End If
	next 
	dim pagebar
	pagebar= ExportPageInfo(Rs, curpage, i, "admin_tiku.asp?action=list&tixing="&Request.QueryString("tixing")&"&")
	txt="<div id='content'><h4>试题列表</h4><table><tr><td class='listtop1'>描述</td><td class='listtop2'>操作</td></tr>"& strEdit2 & "</table><p/>" & pagebar &"</div>"
	End if
		Call DBConnEnd()

Case "edit"

	Call DBConnBegin()
	Select Case Request.QueryString("tixing")
		Case "1"
			Sql="select * from choice where id="&Request.QueryString("id")
			Rs.Open Sql,conn,1,1
			txt = FSOFileRead("../html/admin_choice2.txt")
			txt = Replace(txt, "{theQuestion}", Rs("question"))
			txt = Replace(txt, "{theA}", Rs("A"))
			txt = Replace(txt, "{theB}", Rs("B"))
			txt = Replace(txt, "{theC}", Rs("C"))
			txt = Replace(txt, "{theD}", Rs("D"))
			txt = Replace(txt, "{theID}", Rs("id"))
			txt = Replace(txt, "{theAnswer}", Rs("answer"))
			txt = Replace(txt, "{tixing"&Rs("type")&"}", "selected")
			txt = Replace(txt, "{chapter"&Rs("chapter")&"}", "selected")
			txt = Replace(txt, "{score"&Rs("score")&"}", "selected")
			txt = Replace(txt, "{difficulty"&Rs("difficulty")&"}", "selected")
		Case "2"
			Sql="select * from choice where id="&Request.QueryString("id")
			Rs.Open Sql,conn,1,1
			txt = FSOFileRead("../html/admin_choice2.txt")
			txt = Replace(txt, "{theQuestion}", Rs("question"))
			txt = Replace(txt, "{theA}", Rs("A"))
			txt = Replace(txt, "{theB}", Rs("B"))
			txt = Replace(txt, "{theC}", Rs("C"))
			txt = Replace(txt, "{theD}", Rs("D"))
			txt = Replace(txt, "{theID}", Rs("id"))
			txt = Replace(txt, "{theAnswer}", Rs("answer"))
		Case "3"
			Sql="select * from judgment where id="&Request.QueryString("id")
			Rs.Open Sql,conn,1,1
			txt = FSOFileRead("../html/admin_judge2.txt")
			txt = Replace(txt, "{theQuestion}", Rs("question"))
			txt = Replace(txt, "{theID}", Rs("id"))
			txt = Replace(txt, "{chapter"&Rs("chapter")&"}", "selected")
			txt = Replace(txt, "{score"&Rs("score")&"}", "selected")
			txt = Replace(txt, "{difficulty"&Rs("difficulty")&"}", "selected")
		Case "4"
			Sql="select * from fillin where id="&Request.QueryString("id")
			Rs.Open Sql,conn,1,1
			txt = FSOFileRead("../html/admin_fillin2.txt")
			txt = Replace(txt, "{theQuestion}", Rs("question"))
			txt = Replace(txt, "{theAnswer}", Rs("answer"))
			txt = Replace(txt, "{theID}", Rs("id"))
			txt = Replace(txt, "{chapter"&Rs("chapter")&"}", "selected")
			txt = Replace(txt, "{score"&Rs("score")&"}", "selected")
			txt = Replace(txt, "{difficulty"&Rs("difficulty")&"}", "selected")
		Case "5"
			Sql="select * from calculation where id="&Request.QueryString("id")
			Rs.Open Sql,conn,1,1
			txt = FSOFileRead("../html/admin_calcul2.txt")
			txt = Replace(txt, "{theQuestion}", Rs("question"))
			txt = Replace(txt, "{theAnswer}", Rs("answer"))
			txt = Replace(txt, "{theTixing}", "5")
			txt = Replace(txt, "{theTitle}", "修改问答题")
			txt = Replace(txt, "{theID}", Rs("id"))
			txt = Replace(txt, "{chapter"&Rs("chapter")&"}", "selected")
			txt = Replace(txt, "{score"&Rs("score")&"}", "selected")
			txt = Replace(txt, "{difficulty"&Rs("difficulty")&"}", "selected")
		Case "6"
			Sql="select * from calculation where id="&Request.QueryString("id")
			Rs.Open Sql,conn,1,1
			txt = FSOFileRead("../html/admin_calcul2.txt")
			txt = Replace(txt, "{theQuestion}", Rs("question"))
			txt = Replace(txt, "{theAnswer}", Rs("answer"))
			txt = Replace(txt, "{theTixing}", "6")
			txt = Replace(txt, "{theTitle}", "修改计算题")
			txt = Replace(txt, "{theID}", Rs("id"))
			txt = Replace(txt, "{chapter"&Rs("chapter")&"}", "selected")
			txt = Replace(txt, "{score"&Rs("score")&"}", "selected")
			txt = Replace(txt, "{difficulty"&Rs("difficulty")&"}", "selected")
	End Select
	Call DBConnEnd()

End Select

adminTxt = FSOFileRead("../html/admin_tiku.txt")
adminTxt = replace(adminTxt, "{theRightFrmContent}", txt)
Response.write adminTxt

%>
	

⌨️ 快捷键说明

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