📄 addkecheng.asp
字号:
<!--#include file ="connection.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添加教师信息</title>
<style type="text/css">
<!--
.STYLE1 {
color: #FFFFFF;
font-size: 18px;
font-weight: bold;
}
-->
</style>
</head>
<body bgcolor="#FBC2AD">
<div align=center>
<%
user=session("user")
lb=session("lb")
if user=""or lb<>"admin" then
response.redirect"index.asp"
else
sqlstr="select distinct xino, xiname from 系"
set rs=Server.CreateObject("ADODB.Recordset")
rs.open sqlstr,CN,1,3
%>
<%
select case request("action")
case "填报教学计划"
add()
case else
list()
end select
%>
<%
sub list()
%>
<%
xino=request.QueryString("xino")
if xino <> "--选择系--" then
if xino="" then
sql = "select * from 专业 "
else
sql = "select * from 专业 where xino='"&xino & "'"
end if
set rs1=Server.Createobject("ADODB.RecordSet")
rs1.Open sql,CN
sql = "select * from 教师 where xino='"&xino & "'"
set rs2=Server.Createobject("ADODB.RecordSet")
rs2.Open sql,CN
if rs1.Eof then
response.Write "尚无系部信息,请先添加一级分类"
response.End()
end if
%>
<table width="144" height="84">
<tr>
<td> </td>
</tr>
</table>
<form action="" method="post">
<table width="311" border="0" cellpadding="3" cellspacing="1" bordercolor="#000000" bgcolor="#000000" class="sft">
<tr>
<td height="30" colspan="2" bgcolor="#FF903C"><div align="center" class="STYLE1">填报教学计划</div> </td>
</tr>
<tr>
<td width="83" height="30" bgcolor="#FF903C"><div align="center">系部:</div></td>
<td width="213" height="30" bgcolor="#FFFFFF"><select name="xino" size="1" style="border-style: dotted; border-width: 0; background-color: #FCB4BC" onChange="self.location.href=options[selectedIndex].value">
<option value="--选择系--" selected>--选择系--</option>
<%
do while not rs.eof
%>
<%
if xino=rs("xino") then
%>
<option value="?xino=<%=rs("xino")%>" selected><%=rs("xiname")%></option>
<%
else
%>
<option value="?xino=<%=rs("xino")%>"><%=rs("xiname")%></option>
<%
end if
rs.movenext
loop
%>
</select> </td>
</tr>
<tr>
<td height="31" bgcolor="#FF903C"><div align="center">专业:</div></td>
<td height="31" bgcolor="#FFFFFF"><select name="zhuanyeno" size="1" id="zhuanyeno" style="border-style: dotted; border-width: 0; background-color: #FCB4BC">
<option value="--选择专业--" selected>--选择专业--</option>
<% do while not rs1.eof
%>
<option value="<%=rs1("zhuanyeno")%>"><%=rs1("zhuanye")%></option>
<% rs1.movenext
loop
%>
</select></td>
</tr>
<tr>
<td height="31" bgcolor="#FF903C"><div align="center">学期:</div></td>
<td height="31" bgcolor="#FFFFFF"><select name="xueqi" size="1" id="xueqi" style="border-style: dotted; border-width: 0; background-color: #FCB4BC">
<option value="--选择专业--" selected>--选择学期--</option>
<option value="2007-2008(1)">2007-2008(1)</option>
<option value="2007-2008(2)">2007-2008(2)</option>
<option value="2008-2009(1)">2008-2009(1)</option>
<option value="2008-2009(2)">2008-2009(2)</option>
<option value="2009-2010(1)">2009-2010(1)</option>
<option value="2009-2010(2)">2009-2010(2)</option>
</select></td>
</tr>
<tr>
<td height="28" bgcolor="#FF903C"><div align="center">课程编号:</div></td>
<td height="28" bgcolor="#FFFFFF"><input name="lessonno" type="text" id="lessonno"style="border-style: dotted; border-width: 0; background-color: #FCB4BC" size="20"> </td>
</tr>
<tr>
<td width="83" height="23" bgcolor="#FF903C"><div align="center">课程名:</div></td>
<td width="213" height="23" bgcolor="#FFFFFF"><input name="lessonname" type="text" id="lessonname"style="border-style: dotted; border-width: 0; background-color: #FCB4BC" size="20"> </td>
</tr>
<tr>
<td width="83" height="26" bgcolor="#FF903C"><div align="center">任课教师: </div></td>
<td width="213" height="26" bgcolor="#FFFFFF"><select name="teacherno" size="1"style="border-style: dotted; border-width: 0; background-color: #FCB4BC">
<option value="--选择教师--" selected>--选择教师--</option>
<% do while not rs2.eof
%>
<option value="<%=rs2("teacherno")%>"><%=rs2("teachername")%></option>
<% rs2.movenext
loop
%>
</select>
</td>
</tr>
<tr>
<td height="20" colspan="2" bgcolor="#FFFFFF"><div align="center">
<div align="center">
<input type="submit" name="action" value="填报教学计划" style="border-style: dotted; border-width: 0; background-color: #FCB4BC">
</div>
</table>
</form>
<p class=sft>
</div>
<% end if
end sub
%>
</body>
</html>
<%
sub add()
xino=trim(request.QueryString("xino"))
zhuanyeno=trim(request.Form("zhuanyeno"))
xueqi=trim(request.Form("xueqi"))
lessonno=trim(request.Form("lessonno"))
lessonname=trim(request.Form("lessonname"))
teacherno=trim(request.Form("teacherno"))
sqlstr="select * from 课程 where lessonno='" & lessonno &"'"
set rs3=Server.CreateObject("ADODB.recordset")
rs3.open sqlstr,CN
if rs3.eof then
sqlstr="insert into 课程 values('" & lessonno &"','"
sqlstr=sqlstr & xueqi & "','"
sqlstr=sqlstr & xino & "','"
sqlstr=sqlstr & zhuanyeno & "','"
sqlstr=sqlstr & lessonname & "','"
sqlstr=sqlstr & teacherno & "')"
CN.execute sqlstr
response.Redirect("addkecheng.asp")
else
response.write "<script language='javascript'>"
response.write "alert('该课程信息已经存在!');"
response.write "history.back(1);"
response.write "</script>"
response.end
end if
end sub
%>
<%
end if
rs.close
'rs1.close
'rs2.close
CN.close
set rs=nothing
'set rs1=nothing
'set rs2=nothing
set CN=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -