📄 add_other.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!-- #include file="conn.asp" -->
<%
if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='login.html';</script>"
response.End
else
if request.QueryString("action")="add_EduName" then
set rs=server.CreateObject("adodb.recordset")
rs.open "select EduName from Edu where EduName='"&trim(request.Form("EduName"))&"'",conn,1,1
do while not rs.eof
i=i+1
rs.movenext
loop
if i>0 then
response.write "<script language=javascript>alert('此学历已存在');</script>"
response.write "<script language=javascript>this.location.href='javascript:history.back()';</script>"
Response.end
else
set rsedu=server.CreateObject("adodb.recordset")
rsedu.open "select * from Edu",conn,3,2
rsedu.AddNew
rsedu("EduName")=trim(request.Form("EduName"))
rsedu.Update
rsedu.close
set rsedu=nothing
response.write "<script language=javascript>alert('学历添加成功');</script>"
response.End
End if
End if
End if
%>
<%
if request.QueryString("action")="add_PostName" then
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select PostName from Post where PostName='"&trim(request.Form("PostName"))&"'",conn,1,1
do while not rs1.eof
j=j+1
rs1.movenext
loop
if j>0 then
response.write "<script language=javascript>alert('此职称已存在');</script>"
response.write "<script language=javascript>this.location.href='javascript:history.back()';</script>"
Response.end
else
set rspost=server.CreateObject("adodb.recordset")
rspost.open "select * from Post",conn,3,2
rspost.AddNew
rspost("PostName")=trim(request.Form("PostName"))
rspost.Update
rspost.close
set rspost=nothing
response.write "<script language=javascript>alert('职称添加成功');</script>"
response.End
End if
End if
%>
<%
if request.QueryString("action")="add_PolName" then
set rs2=server.CreateObject("adodb.recordset")
rs2.open "select PolName from Political where PolName='"&trim(request.Form("PolName"))&"'",conn,1,1
do while not rs2.eof
k=k+1
rs2.movenext
loop
if k>0 then
response.write "<script language=javascript>alert('此政治面貌已存在');</script>"
response.write "<script language=javascript>this.location.href='javascript:history.back()';</script>"
Response.end
else
set rspol=server.CreateObject("adodb.recordset")
rspol.open "select * from Political",conn,3,2
rspol.AddNew
rspol("PolName")=trim(request.Form("PolName"))
rspol.Update
rspol.close
set rspol=nothing
response.write "<script language=javascript>alert('政治面貌添加成功');</script>"
response.End
End if
End if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" type="text/css" href="main.css">
<title>添加其它信息</title>
<style type="text/css">
<!--
body {
background-image: url(images/4.jpg);
}
.style1 {color: #3300FF}
-->
</style></head>
<body>
<div align="center">
<form id="form1" name="form1" method="post" action="add_Other.asp?action=add_EduName" onsubmit="return checkEdu()">
<h3>添加学历</h3>
<p><span class="style1">学历名称</span>
<input type="text" name="EduName" id="EduName" />
<input type="submit" name="add" id="add_Edu" value="提交" />
</p>
</form>
<form id="form2" name="form2" method="post" action="add_Other.asp?action=add_PostName" onsubmit="return checkPost()">
<h3>添加职称</h3>
<p><span class="style1">职称名称</span>
<input type="text" name="PostName" id="PostName" />
<input type="submit" name="add_Post" id="add_Post" value="提交" />
</p>
</form>
<form id="form3" name="form3" method="post" action="add_Other.asp?action=add_PolName" onsubmit="return checkPol()">
<h3>添加政治面貌</h3>
<p><span class="style1">政治面貌</span>
<input type="text" name="PolName" id="PolName" />
<input type="submit" name="add_Pol" id="add_Pol" value="提交" />
</p>
</form>
</div>
</body>
<script type="text/javascript">
function checkEdu()
{
if (document.form1.EduName.value=="")
{
alert("请输入学历名称")
document.form1.EduName.focus()
return false
}
}
function checkPost()
{
if (document.form2.PostName.value=="")
{
alert("请输入职称名称")
document.form2.PostName.focus()
return false
}
}
function checkPol()
{
if (document.form3.PolName.value=="")
{
alert("请输入政治面貌")
document.form3.PolName.focus()
return false
}
}
</script>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -