免费获取|
论文天下网
  • 论文天下网 |
  • 原创毕业论文 |
  • 论文范文 |
  • 论文下载 |
  • 计算机论文 |
  • 论文降重 |
  • 毕业论文 |
  • 外文翻译 |
  • 免费论文 |
  • 开题报告 |
  • 心得体会 |

当前位置:论文天下网 -> 免费论文 -> 计算机论文

ASP在线教育系统(二)

;相关资料 20
Titli Text 资料标题 20
  3. 页面所涉及的数据库表信息
  此页面用来显示搜索资料信息,此页使用了系统中的资料栏目信息表type。
  4. 页面代码分析
 ‘Html页面表单提交到list.asp
 <form action="list.asp" method="post">
 ‘Html页面显示部分,显示要填写的搜索条件
 ……
 </form>
3.1.8 资料信息搜索结果页
  1. list.asp页面示例
  图3-8为显示资料信息列表所看到的页面。
  
3-8  显示资料信息列表
  2. 页面中需要用户填写的Html表单元素
  此页无需填写Html表单元素。
  3. 页面所涉及的数据库表信息
  此页面用来显示资料信息列表,使用了系统中的资料信息表main和教师信息表teacher。
3.2  资料管理模块
  资料管理模块包含以下子模块。
  ●  管理员登陆
  ●  资料栏目管理
  ●  资料信息管理
  管理员登陆子模块包含以下页面。
  ●  adminlogin.asp
  ●  asmincheck.asp
  ●  adminmain.asp
  资料栏目管理子模块包含以下页面。
  ●  addtype.asp
  ●  addtypeok.asp
  ●  edittype.asp
  ●  edittypeok.asp
  ●  deltype.asp
  ●  deltypeok.asp
  资料信息管理子模块包含以下页面。
  ●  put.asp
  ●  pubok.asp
  ●  list.asp
  ●  edit.asp
  ●  editok.asp
  ●  admindelcourseware.asp
  ●  admindelcoursewareok.asp
  各页面间的关系如图3-9所示。
 
3-9  各页面间的关系
3.2.1 管理员登陆页
  1. adminlogin.asp页面示例
  图3-10为管理员登陆所看到的页面。管理员密码为admin。

图3-10  管理员登陆
 2. 页面中需要用户填写的Html表单元素
 此页共有两个表单元素,如表3所示。
 表3                    adminlogin.asp页的表单元素
 名称  表单元素类型  含义 最大长度
Adminpwd Password 管理员密码 15
  3. 页面所涉及的数据库表信息
  此页并没有涉及到数据库表的操作。
  4. 页面代码分析
 ‘Html页面表单提交到adminlogin.asp
 <form action="admincheck.asp" method="post">
 ‘Html页面显示部分,显示要填写的登陆信息
 ……
 </form>
3.2.2 验证管理员帐号页
 1. 页面中需要用户填写的Html表单元素
 此页无需填写Html表单元素。
 2. 页面所涉及的数据库表信息
 此页面用来验证管理员信息,使用了系统中的管理员表config。
 3. 页面代码分析
 ‘引用创建数据库连接对象函数文件
 <!--#include file="conn.asp"-->
 <%’取得提交过来的信息
 adminpwd = request("adminpwd")
 ‘如果输入的密码为空
 if adminpwd = "" then
  conn.close
  set conn = nothing
  response.write "<script>alert('请输入密码');history.go(-1);</script>"
  response.end
 end if
 sql = "select * from config"
 set rs = server.createobject("adodb.recordset")
 rs.open sql,conn,1,1
 ‘如果输入的密码与数据库中密码一致说明密码正确,登陆成功
 if adminpwd = rs("adminpwd") then
 ‘登陆成功后 session("admin")起用
 session("admin")=”admin”
  rs.close
  set rs = nothing
  conn.close
  set conn = nothing
 ‘登陆成功后就跳转到管理页面
  response.redirect "adminmain.asp"
 ‘如果输入的密码与数据库中密码不一致说明密码输入错误
 else
  rs.close
  set rs = nothing
  conn.close
  set conn = nothing
 response.write "<script>alert('密码错误');window.location.href='adminlogin.asp';</script>"
3.2.3 管理员登陆成功页
  1.adminmain.asp页面示例
  图3-11为管理员登陆成功后所看到的页面。

图3-11  管理员登陆成功
  2. 页面中需要用户填写的Html表单元素
  此页无需填写Html表单元素。
  3. 页面所涉及的数据库表信息
  此页使用了系统中的管理员表config。
  4. 页面代码分析
 ‘引用创建数据库连接对象函数文件
 <!--#include file="conn.asp"-->
 ‘引用判断是否是管理员登陆文件
 <!--#include file="isadmin.asp"-->
 ‘Html页面显示部分
 ……
 <frameset rows="*" cols="100,*,0" framespacing="0" frameborder="NO" border="0">
   <frame src="adminleft.asp" name="left" scrolling="NO" noresize>
   <frame src="adminindex.asp" name="main" noresize>
3.2.4 增加资料栏目页
  1. addtype.asp页面示例
  图3-12为增加栏目信息所看到的页面。

  2. 页面中需要用户填写的Html表单元素
  此页仅有1个表单元素,如表4所示。
  表4                   addtype.asp页的表单元素
名称  表单元素类型  含义 最大长度
Addtype  Text 栏目名称 10
  3. 页面所涉及的数据库表信息
  此页面用来增加栏目信息,使用了系统中的栏目信息记录表type。
  4. 页面代码分析
 <%’取得栏目信息
 sql = "select * from type"
 set rs = server.createobject("adodb.recordset")
 ‘打开记录集对象
 rs.open sql,conn,1,1
 ‘显示栏目信息
 do while not rs.eof
  response.write "<tr align='center'><td width=180>"&rs("type")&"</td>"
  response.write "<td><a href=edittype.asp?id="&rs("typeid")&">编辑</a>/<a href=deltype.asp?id="&rs("typeid")&">删除</a></td></tr>"
 ‘取下一条栏目信息
  rs.movenext
 loop
 ‘关闭记录集对象
 rs.close
 set rs = nothing
 ‘关闭数据库连接对象
 conn.close
 set conn = nothing
 %>
 ‘Html页面表单提交到addtype.doc
 <form action="addtypeok.asp" method="post">
 请输入要添加的栏目名称:<input type=text name="addtype" size=10><input type=submit name="submit" value="添加">
 <br>(栏目名称可以如“论文”、“实验素材”等)
 </form>
3.2.5 增加栏目成功页
  1. 页面中需要用户填写的Html表单元素
  此页无需填写Html表单元素。
  2. 页面所涉及的数据库表信息
  此页使用了系统中的栏目信息记录表type。
  3. 页面代码分析
 ‘引用创建数据库连接对象函数文件
 <!--#include file="conn.asp"-->
 ‘引用判断是否是管理员登陆文件
 <!--#include file="isadmin.asp"-->
 <%’取得输入的栏目名称
 addtype = trim(request("addtype"))
 if addtype = "" then
  response.write "<script>alert('请输入要添加的栏目名');history.go(-1);</script>"
  conn.close
  set conn = nothing
  response.end
 end if
 if len(addtype) > 5 then
  response.write "<script>alert('栏目名不得超过5个汉字');history.go(-1);</script>"
  conn.close
  set conn = nothing
  response.end
 end if
 ‘查找栏目信息表是否有栏目名相同的记录
 sql = "select * from type where type='"&addtype&"'"
 set rs = server.createobject("adodb.recordset")
 rs.open sql,conn,1,3
 ‘如果有则提示
 if not (rs.bof and rs.eof) then
  rs.close
  set rs = nothing
  conn.close
  set conn = nothing
  response.write "<script>alert('数据库中已经有一个名为"&addtype&"的栏目了');history.go(-1);</script>"
  response.end
 else
 ‘如果没有记录则可以添加了
  rs.addnew
  rs("type")=addtype
  rs.update
 ‘关闭记录集对象
  rs.close
  set rs = nothing
 ‘关闭数据库连接对象
  conn.close
  set conn = nothing
 end if
 response.write "<script>alert('添加成功');window.location.href='addtype.asp';</script>"
 %>
3.2.6 修改栏目信息页
  1. edittype.asp页面示例
  图3-13为修改栏目信息所看到的页面。

图3-13  修改栏目信息
  2. 页面中需要用户填写的Html表单元素
  此页仅有1个表单元素,如表5所示。
  表5                   edittype.asp页的表单元素
 名称  表单元素类型  含义 最大长度
Addtype  Text 栏目名称 10
  3. 页面所涉及的数据库表信息
  此页用来修改栏目信息页面,使用了系统中的栏目信息记录表type。
  4. 页面代码分析
 ‘引用创建数据库连接对象函数文件
 <!--#include file="conn.asp"-->
 ‘引用判断是否是管理员登陆文件
 <!--#include file="isadmin.asp"-->
 <%’取得要修改栏目信息的id号
 id = trim(request("id"))
 sql = "select * from type where typeid="&id
 set rs = server.createobject("adodb.recordset")
 ‘打开栏目信息表查找需要修改的栏目名称
 rs.open sql,conn,1,1
 filetype = rs("type")
 ‘关闭记录集对象
 rs.close
 set rs = nothing
 ‘关闭数据库连接对象
 conn.close
 set conn = nothing
 %>
 ‘Html页面显示部分
 ……
 ‘Html页面表单提交到edittypeok.asp
 <form action="edittypeok.asp" method="post">
 将栏目“<%=filetype%>”更名为:<input type=text name="addtype" size=10 value="<%=filetype%>">
 <input type=hidden name="id" value="<%=id%>">
 <input type=submit name="submit" value="修改">
 <br>(栏目名称可以如“论文”、“实验素材”等)
 </form>
3.2.7 保存修改的栏目信息页
  1. 页面中需要用户填写的Html表单元素
  此页无需填写Html表单元素。
  2. 页面所涉及的数据库表信息
  此页使用了系统中的栏目信息记录表type。
  3. 页面代码分析
 ‘引用创建数据库连接对象函数文件
 <!--#include file="conn.asp"-->
 ‘引用判断是否是管理员登陆文件
 <!--#include file="isadmin.asp"-->
 <%’取得要修改的栏目信息的id号
 id = trim(request("id"))
 addtype = trim(request("addtype"))
 ‘如果没有输入栏目名称则提示
 if addtype = "" then
  response.write "<script>alert('请输入栏目名');history.go(-1);</script>"
  conn.close
  set conn = nothing
  response.end
 end if
 ‘栏目名称的长度不能大于5
 if len(addtype) > 5 then
  response.write "<script>alert('栏目名不得超过5个汉字');history.go(-1);</script>"
  conn.close
  set conn = nothing
  response.end
 end if
 ‘打开栏目信息表查找需要修改的栏目名称
 sql = "select * from type where type='"&addtype&"' and typeid<>"&id
 set rs = server.createobject("adodb.recordset")
 rs.open sql,conn,1,1
 ‘如果修改的名称在数据库中已经有记录则不能修改
 if not (rs.bof and rs.eof) then
  rs.close
  set rs = nothing
  conn.close
  set conn = nothing
  response.write "<script>alert('数据库中已经有一个名为"&addtype&"的栏目了');history.go(-1);</script>"
  response.end
 end if
 rs.close
 set rs = nothing
 ‘如果修改的名称在数据库中没有记录了则可以修改
 conn.execute "update type set type='"&addtype&"' where typeid="&id
 conn.close
 set conn = nothing
 response.write "<script>alert('修改成功');window.location.href='addtype.asp';</script>"
 %>
3.2.8 删除栏目信息页
  1. deltype.asp页面示例
  图3-14为删除栏目信息所看到的页面。

图3-14  删除栏目信息
  2. 页面中需要用户填写的Html表单元素
  此页无需填写Html表单元素。
  3. 页面所涉及的数据库表信息
  此页使用了系统中的栏目信息记录表type。
  4. 页面代码分析
 ‘Html页面表单提交到deltypeok.asp
 <form action="deltypeok.asp" method="post">
 <table style="BORDER-COLLAPSE: collapse" borderColor=#808080 width="250" border="1" align="center" cellpadding=1>
 <tr><td align="center" class="header">将有下列数据被删除</td></tr>
 <tr><td align="left">
 1.该栏目在数据库中的记录<br>
 2.所有属于该栏目的资料
 </td></tr>
 </table>
 <center><input type=hidden name="id" value="<%=id%>"><br>
 <input type=submit name="submit" value="确定">&nbsp;&nbsp;<input type=button name="cancle" value="取消" onclick="history.go(-1);"></center>
 </form>
3.2.9 删除栏目信息成功页
  1. 页面中需要用户填写的Html表单元素
  此页无需填写Html表单元素。
  2. 页面所涉及的数据库表信息
  此页使用了系统中的栏目信息记录表type。
  3. 页面代码分析
 ‘引用创建数据库连接对象函数文件
 <!--#include file="conn.asp"-->
 ‘引用判断是否是管理员登陆文件
 <!--#include file="isadmin.asp"-->
 <%’取得要删除栏目信息的id号
 id = trim(request("id"))
 ‘如果要删除栏目信息的id号为空说明非法操作
 if id = "" then
  conn.close
  set conn = nothing
  response.write "<script>alert('请不要捣乱');top.window.location.href='adminmain.asp';</script>"
  response.end
 end if
 ‘查找对应id号的栏目信息
 sql = "select * from type where typeid="&id
 set rs = server.createobject("adodb.recordset")
 ‘打开记录集对象
 rs.open sql,conn,1,1
 ‘对应id号的栏目信息如果不存在则说明该栏目不存在
 if rs.bof and rs.eof then
  rs.close
  set rs = nothing
  conn.close
  set conn = nothing
  response.write "<script>alert('请不要捣乱');top.window.location.href='adminmain.asp';</script>"
  response.end
 end if
 rs.close
 set rs = nothing
 ‘对应id号的栏目信息如果存在则删除栏目信息
 conn.execute "delete from type where typeid="&id
 ‘删除资料信息中对应栏目id号的资料信息
 conn.execute "delete from main where idoftype="&id
 ‘关闭数据库连接对象
 conn.close
 set conn = nothing
 response.write "<script>alert('删除成功');window.location.href='addtype.asp';</script>"
 %>
3.2.10 发布资料信息页
  1.pub.asp页面示例
  图3-15为发布资料信息所看到的页面。

  2. 页面中需要用户填写的Html表单元素
  此页共有6个表单元素,如表6所示。
  表6                   pub.asp页的表单元素
 名称  表单元素类型  含义 最大长度
Teacher Text 教师姓名 15
Course Text 课程名称 15
Title Text 资料标题 52
Fileurl Text 资料地址 52
Filesize Text 资料大小 15
content textarea 资料简介 300
  3. 页面所涉及的数据库表信息
  此页用来发布资料信息页面,使用了系统中的栏目信息记录表type。
  4. 页面代码分析
 ‘Html页面表单提交到pubok.asp
 <form action="pubok.asp" method="post" onSubmit=submitonce(this)>
 ‘Html页面显示部分,填写资料信息
 ……
 <%’取得栏目信息
 sql = "select * from type"
 set rs = server.createobject("adodb.recordset")
 rs.open sql,conn,1,1
 %>
 &nbsp;<select name="type">
 <option value="" selected>请选择</option>
 <%’显示栏目信息
 do while not rs.eof
 %>
  <option value="<%=rs("typeid")%>"><%=rs("type")%></option>
 <%’取下一条栏目信息
  rs.movenext
 loop
 response.write "</select>"
 ‘关闭记录集对象
 rs.close
 set rs = nothing
 %>
3.2.11 资料信息发布成功页
  1. 页面中需要用户填写的Html表单元素
  此页无需填写Html表单元素。
  2. 页面所涉及的数据库表信息
  此页使用了系统中的资料信息记录表main。
3.2.12 资料信息列表页
  图3-16为资料信息列表页面。

  2. 页面中需要用户填写的Html表单元素
  此页无需填写Html表单元素。
  3. 页面所涉及的数据库表信息
  此页面用来显示资料信息列表,使用了系统中的资料信息表main和教师信息表teacher。
  4. 页面代码分析
  代码与3.2.8节的删除栏目信息页基本相同。
3.2.13 资料信息修改页
  1. edit.asp页面示例
  图3-17为修改资料信息所看到的页面。

图3-17  修改资料信息
  2. 页面中需要用户填写的Html表单元素
  此页共有5个表单元素,如表7所示。
  表7                   edit.asp页的表单元素
 名称  表单元素类型  含义 最大长度
Course  Text 课题名称 15
Title  Text 资料标题 52
Fileurl  Text 资料地址 52
Filesize  Text 资料大小 15
Content Textarea 资料简介 300
  3. 页面所涉及的数据库表信息
  此页用来修改资料信息,使用了系统中的资料信息记录表main。
  4. 页面代码分析
 ‘引用创建数据库连接对象函数文件
 <!--#include file="conn.asp"-->
 ‘引用判断是否是教师登陆文件
 <!--#include file="isteacher.asp"-->
 ‘引用网站设置文件
 <!--#include file="fenlei.asp"-->
 <%’取得要修改资料信息的id号
 id = request("id")
 ‘必须输入要修改资料信息的id号
 if id = "" then
  conn.close
  set conn = nothing
  response.write "<script>alert('请不要捣乱');top.window.location.href='teachermain.asp';</script>"
  response.end
 end if
 ‘取得要显示的资料信息
 sql = "select * from main,teacher where main.idofteacher=teacher.teacherid and main.mainid="&id
 set rs = server.createobject("adodb.recordset")
 rs.open sql,conn,1,1
 ‘如果信息不存在则不能修改
 if rs.bof and rs.eof then
  rs.close
  set rs = nothing
  conn.close
  set conn = nothing
  response.write "<script>alert('请不要捣乱');top.window.location.href='teachermain.asp';</script>"
  response.end
 else
 ‘如果存在判断用户是否有修改资料的权限
  if rs("teacherid") <> int(session("teacherid")) and session("admin") <> "admin" then
   rs.close
   set rs = nothing
   conn.close
   set conn = nothing
   response.write "<script>alert('这个资料不是你发布的,你想干什么?');top.window.location.href='teachermain.asp';</script>"
 &nb

首页 上一页 1 2 3 下一页 尾页 2/3/3

相关论文
上一篇:ASP在线花店系统 下一篇:毕业设计题目:图书管理系统
推荐论文 本专业最新论文
Tags:ASP 在线教育 系统 【返回顶部】

相关栏目

自动化相关
计算机论文
工程管理论文
法律论文
医学论文
人力资源
电子专业
电气工程
英语论文
行政管理
电子商务
社科文学
教育论文
物流专业
金融专业
财务管理
会计专业
化学化工材料科学
电子通信
环境科学
经济类
机械模具类
报告,总结,申请书
其他专业论文


关于我们 | 联系方式 | 论文说明 | 网站地图 | 免费获取 | 钻石会员 | 原创毕业论文

 

论文天下网提供论文检测,论文降重,论文范文,论文排版,网站永久域名WWW.GEPUW.NET

本站部分文章来自网友投稿上传,如发现侵犯了您的版权,请联系指出,本站及时确认并删除  E-mail: 893628136@qq.com

Copyright@ 2009-2022 GEPUW.NET 论文天下网 版权所有