教务管理系统源代码
教务管理系统源代码
主页登录部分 default.asp
<% Option Explicit %>
<% Response.Buffer=True %>
<%
If Trim(request.form("username"))<>"" AND Trim(request.form("pswd"))<>"" Then
Dim db
Set db=Server.CreateObject("ADODB.Connection")
db.Open "jiaowu"
Dim userid,pswd,strsql,rs
userid=Request.Form("username")
pswd=Request.Form("pswd")
End If
If request.form("D1")="学生" Then
strsql="Select * From stu Where sno='"&userid&"'"
Set rs=db.Execute(strsql)
If pswd=rs("spin") Then
Session("stuid")=userid
Response.Redirect"student.asp"
Else
Response.write"密码错误"
End If
ElseIf request.form("D1")="教师" Then
strsql="Select * From tea Where tno='"&userid&"'"
Set rs=db.Execute(strsql)
If pswd=rs("tpin") Then
Session("teaid")=userid
Response.Redirect"teacher.asp"
Else
Response.write"密码错误"
End If
ElseIf request.form("D1")="教务管理员" Then
strsql="Select * From adm Where adm='"&userid&"'"
Set rs=db.Execute(strsql)
If pswd=rs("apin") Then
Session("admid")=userid
Response.Redirect"adm.asp"
Else
Response.write"密码错误"
End If
Else
Session("stuid")=""
Session("teaid")=""
Session("admid")=""
End If
%>
二、学生用户界面
(一)实现选课 student.asp
<% Option Explicit %>
<% Response.Buffer=True %>
<%
If Session("stuid")="" Then
Response.Redirect "default.asp"
Response.write"请先登录"
Else
Dim stuid,cnoid
stuid=Session("stuid")
cnoid=Request.form("T1")
Dim db
Set db=Server.CreateObject("ADODB.Connection")
db.Open "jiaowu"
Dim strsql,rs
strsql="Insert Into score(cno,sno) Values('"&cnoid&"','"&stuid&"')"
Set rs=db.Execute(strsql)
End If
db.close
Set db=Nothing
%>
(二)显示课表 cou_list.asp
<% Option Explicit %>
<% Response.Buffer=True %>
<%
If Session("stuid")="" Then
Response.Redirect "default.asp"
Response.write"请先登录"
Else
Dim db
Set db=Server.CreateObject("ADODB.Connection")
db.Open "jiaowu"
Dim strsql,rs
strsql="Select Distinct cou.cno,cou.cname,cou.tno, cou.room From cou"
Set rs=db.Execute(strsql)
End if
%>
非常好我支持^.^
(1) 50%
不好我反对
(1) 50%