📄 addstudent.asp
字号:
</form>
</table>
<%
case "addmore2"
lx=trim(request("lx"))
nf=trim(request("nf"))
bj=trim(request("bj"))
lx=trim(request("lx"))
bjrs=cint(request("bjrs"))
if lx="" or len("lx")<>2 then
response.write "<script LANGUAGE='javascript'>alert('类别选择错误!');history.go(-1);</script>"
response.end
end if
if nf="" or len("nf")<>2 then
response.write "<script LANGUAGE='javascript'>alert('年份输入错误!');history.go(-1);</script>"
response.end
end if
if bj="" or len("bj")<>2 then
response.write "<script LANGUAGE='javascript'>alert('班级代码输入错误!');history.go(-1);</script>"
response.end
end if
if bjrs="" or bjrs>999 then
response.write "<script LANGUAGE='javascript'>alert('人数输入值错误!');history.go(-1);</script>"
response.end
end if
if lx="1" then lx1="初"
if lx="2" then lx1="高"
if lx="3" then lx1="初补习"
if lx="4" then lx1="高补习"
if lx="5" then lx1="其它类型"
bjdm=lx&nf&bj
bjmc=lx1&nf&"级"&bj&"班"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from Jw_classes where bjdm='" & bjdm & "'",conn,1,3
if not rs.eof then
response.write "<script LANGUAGE='javascript'>alert('班级代码为"&bjdm&"的"&bjmc&"已经存在,请重新输入!');history.go(-1);</script>"
response.end
else
%>
<html>
<head>
<title>教务管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css.css" rel="stylesheet" type="text/css">
</head>
<body style="background-color: #799AE1">
<table class="tableBorder" width="887" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="8" align="center" background="images/admin_bg_1.gif" height="25"><b><font color="#ffffff">教务管理—</font></b><font color="#FFFFFF"><b>添加一班学生</b></font></td>
</tr>
<form name="studentinfo" method="post" action="addstudent.asp?action=addmore3&bjrs=<% =bjrs%>&bjdm=<% =bjdm%>">
<tr>
<td width="100%" bgcolor="#E8F1FF" align="center" height="25" colspan="8">
<font color="#FF0000">认真选择,在操作前请详细阅读使用说明</font></td>
</tr>
<tr>
<td width="17%" bgcolor="#E8F1FF" align="center" height="25">班级代码:</td>
<td width="17%" bgcolor="#E8F1FF" align="center" height="25" colspan="2"><% =bjdm%></td>
<td width="17%" bgcolor="#E8F1FF" align="center" height="25">班级名称:</td>
<td width="17%" bgcolor="#E8F1FF" align="center" height="25"><% =bjmc%></td>
<td width="16%" bgcolor="#E8F1FF" align="center" height="25" colspan="2">班主任:</td>
<td width="16%" bgcolor="#E8F1FF" align="center" height="25"><input class="wenbenkuang" name="bzr" type="text" id="Topic20" size="12">
</td>
</tr>
<tr>
<td width="17%" bgcolor="#E8F1FF" align="center" height="25">学号</td>
<td width="17%" bgcolor="#E8F1FF" align="center" height="25" colspan="2">姓名</td>
<td width="17%" bgcolor="#E8F1FF" align="center" height="25">学号</td>
<td width="17%" bgcolor="#E8F1FF" align="center" height="25">姓名</td>
<td width="16%" bgcolor="#E8F1FF" align="center" height="25" colspan="2">学号</td>
<td width="16%" bgcolor="#E8F1FF" align="center" height="25">姓名</td>
</tr>
<tr>
<td width="100%" bgcolor="#E8F1FF" align="center" height="25" colspan="8">
<div align="center">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<%
if bjrs mod 3 = 0 then
h=bjrs\3
else
h=bjrs\3+1
end if
xh=1
for i = 1 to h
if len(xh)=1 then xh1="00"&xh
if len(xh)=2 then xh1="0"&xh
if len(xh+1)=1 then xh2="00"&(xh+1)
if len(xh+1)=2 then xh2="0"&(xh+1)
if len(xh+2)=1 then xh3="00"&(xh+2)
if len(xh+2)=2 then xh3="0"&(xh+2)
%>
<tr>
<td width="17%" bgcolor="#E8F1FF" align="center" height="25"><input class="wenbenkuang" name="num<% =xh1%>" value="<% =lx&nf&bj&xh1%>" type="hidden" id="Topic20" size="12"><% response.write lx&nf&bj&xh1%></td>
<td width="17%" bgcolor="#E8F1FF" align="center" height="25"><input class="wenbenkuang" name="name<% =xh1%>" type="text" id="Topic20" size="12"></td>
<td width="17%" bgcolor="#E8F1FF" align="center" height="25"><% if xh < bjrs then response.write lx&nf&bj&xh2%></td>
<td width="17%" bgcolor="#E8F1FF" align="center" height="25">
<% if xh < bjrs then%>
<input class="wenbenkuang" name="num<% =xh2%>" value="<% =lx&nf&bj&xh2%>" type="hidden" id="Topic20" size="12">
<input class="wenbenkuang" name="name<% =xh2%>" type="text" id="Topic20" size="12">
<% end if%>
</td>
<td width="16%" bgcolor="#E8F1FF" align="center" height="25"><input class="wenbenkuang" name="num<% =xh3%>" value="<% =lx&nf&bj&xh3%>" type="hidden" id="Topic20" size="12"><% if xh+1 < bjrs then response.write lx&nf&bj&xh3%></td>
<td width="16%" bgcolor="#E8F1FF" align="center" height="25">
<% if xh+1 < bjrs then%>
<input class="wenbenkuang" name="name<% =xh3%>" type="text" id="Topic20" size="12">
<% end if%>
</td>
</tr>
<%
xh=xh+3
next
%>
</table>
</div>
</td>
</tr>
<tr>
<td bgcolor="#E8F1FF" height="25" colspan="8">
<input class="go-wenbenkuang" name="submit" value=确认增加一个班级的学生(写数据库) type=submit onClick="return checkup();">
</td>
</tr>
</form>
</table>
<%
end if
rs.close
set rs=nothing
%>
<%
case "addmore3"
bjrs=request("bjrs")
for i = 1 to bjrs
if len(i) = 1 then ii="00"&i
if len(i) = 2 then ii="0"&i
num1=trim("num"&ii)
name1=trim("name"&ii)
num=request(num1)
name=request(name1)
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from Jw_student",conn,1,3
rs.addnew
rs("Num")=Num
rs("Name")=Name
rs("Password")="965eb72c92a549dd"
rs("Lastlogin")=now()
rs("LastloginIP")="0.0.0.0"
rs.update
rs.close
set rs=nothing
next
bzr=request("bzr")
bjdm=request("bjdm")
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from Jw_classes",conn,1,3
rs.addnew
rs("bjdm")=bjdm
rs("bzr")=bzr
rs.update
rs.close
set rs=nothing
response.redirect "ok.asp?ok=创建班级、增加班级学生、创建班主任"
case "save"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from Jw_student",conn,1,3
rs.addnew
rs("Password")="965eb72c92a549dd"
rs("Lastlogin")=now()
rs("LastloginIP")="0.0.0.0"
rs("Num")=request("Num")
rs("Name")=request("Name")
rs("xb")=request("xb")
rs("mz")=request("mz")
rs("sg")=request("sg")
rs("stzk")=request("stzk")
rs("sl")=request("sl")
rs("xx")=request("xx")
rs("drzw")=request("drzw")
rs("zzmm")=request("zzmm")
rs("csrq")=request("csrq")
rs("rxrq")=request("rxrq")
rs("qsbh")=request("qsbh")
rs("gdjs")=request("gdjs")
rs("lxdh")=request("lxdh")
rs("chxrx")=request("chxrx")
rs("tcah")=request("tcah")
rs("fqxm")=request("fqxm")
rs("fqdh")=request("fqdh")
rs("fqyb")=request("fqyb")
rs("fqdz")=request("fqdz")
rs("mqxm")=request("mqxm")
rs("mqdh")=request("mqdh")
rs("mqyb")=request("mqyb")
rs("mqdz")=request("mqdz")
rs("jcqk")=request("jcqk")
rs("grjl")=request("grjl")
rs.update
rs.close
set rs=nothing
response.redirect "ok.asp?ok=增加一名学生"
case "editsave"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from Jw_student where id="&session("studentid"),conn,1,3
rs("Name")=request("Name")
rs("xb")=request("xb")
rs("mz")=request("mz")
rs("sg")=request("sg")
rs("stzk")=request("stzk")
rs("sl")=request("sl")
rs("xx")=request("xx")
rs("drzw")=request("drzw")
rs("zzmm")=request("zzmm")
rs("csrq")=request("csrq")
rs("rxrq")=request("rxrq")
rs("qsbh")=request("qsbh")
rs("gdjs")=request("gdjs")
rs("lxdh")=request("lxdh")
rs("chxrx")=request("chxrx")
rs("tcah")=request("tcah")
rs("fqxm")=request("fqxm")
rs("fqdh")=request("fqdh")
rs("fqyb")=request("fqyb")
rs("fqdz")=request("fqdz")
rs("mqxm")=request("mqxm")
rs("mqdh")=request("mqdh")
rs("mqyb")=request("mqyb")
rs("mqdz")=request("mqdz")
rs("jcqk")=request("jcqk")
rs("grjl")=request("grjl")
rs.update
rs.close
set rs=nothing
response.redirect "ok.asp?ok=修改学生资料"
case "lock"
studentid=request("id")
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from Jw_student where id="&studentid,conn,1,3
rs("lock")=1
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect "ok.asp?ok=锁定学生"
case "unlock"
studentid=request("id")
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from Jw_student where id="&studentid,conn,1,3
rs("lock")=0
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect "ok.asp?ok=解除锁定学生"
case "del"
studentid=request("id")
conn.execute "delete from Jw_student where id="&studentid
conn.close
set conn=nothing
response.redirect "ok.asp?ok=删除学生资料"
end select
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -