28,408
社区成员




<!--#include file="conn.asp"-->
<%
if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='login.asp';</script>"
response.End
end if
if Request.QueryString("ok") = "save" then
set rs=server.CreateObject("adodb.recordset")
sql="updata apply_type set type='"Request("type")"' where id="request.QueryString("id")""
'rs.open "select * from apply_type where id="request.QueryString("id")"",conn,1,3
'rs("type")=request.form("type")
'rs.update
'rs.close
response.write "<script LANGUAGE='javascript'>alert('编辑成功!');window.location.href='man_apply_type.asp';</script>"
end if
if request.QueryString("id")<>"" then
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from apply_type where id="&request.QueryString("id"),conn,1,3
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FF0000}
td {
font-size: 9pt;
}
input {
font-size: 9pt;
border: 1px solid #666666;
}
.STYLE2 {
font-size: 12pt;
font-weight: bold;
color: #666666;
}
-->
</style>
<title>编辑报考类别</title>
</head>
<body>
<form action="edit_apply_type.asp?ok=save" method="POST" name="myform" id="myform" onSubmit="return checkform()">
<table width="680" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td height="35" align="center" bgcolor="#FFFFFF"><span class="STYLE2">编辑报考类别</span></td>
</tr>
</table>
<table width="680" border="0" align=center cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#FFFFFF">
<td width="28%" align="right">报考类别:</td>
<td width="77%"><input id="type" name="type" type="text" onBlur="callServer();" value="<%=rs1("type")%>"><span id="test1"></span><input id="check" name="check" type="hidden"/><input id="id" name="id" type="hidden"/></td>
</tr>
<script language="javascript" type="text/javascript">
var xmlHttp = false;
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e2) {
xmlHttp = false;
}
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
xmlHttp = new XMLHttpRequest();
}
function callServer() {
var a = document.getElementById("type").value;
if (a == null) return;
var url = "check_apply_type.asp?a=" + a;
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = updatePage;
xmlHttp.send(null);
}
function updatePage() {
if (xmlHttp.readyState < 4) {
test1.innerHTML="loading...";
}
if (xmlHttp.readyState == 4) {
var response = xmlHttp.responseText;
document.getElementById("check").value=response;
test1.innerHTML=response;
}
}
</script>
<tr bgcolor="#FFFFFF">
<td height="55" colspan="2" align="center"><input name="cmdSave" type="submit" class="go-wenbenkuang" value=" 修 改 ">
<input name="cmdCancel" type="button" class="go-wenbenkuang" onClick="javascript:window.close();location.href='man_apply_type.asp';" value=" 返 回 ">
</td>
</tr>
</table>
</form>
<script language="javascript">
function checkform(){
if(document.getElementById("type").value=="")
{
alert("报考类别不能为空!")
return false;
}
if(document.getElementById("check").value=="名称已被使用,请重新输入!")
{
alert("名称已被使用,请重新输入!")
return false;
}
}
</script>
</body>
</html>
<%end if%>
<!--#include file="conn.asp"-->
<%
if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='login.asp';</script>"
response.End
end if
if Request.QueryString("ok") = "save" then
set rs=server.CreateObject("adodb.recordset")
'rs.open "select * from apply_type where id="request.QueryString("id"),conn,1,3
rs.open "select * from apply_type",conn,1,3
rs("type")=request.form("type")
rs.update
rs.close
response.write "<script LANGUAGE='javascript'>alert('编辑成功!');window.location.href='man_apply_type.asp';</script>"
end if
if request.QueryString("id")<>"" then
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from apply_type where id="&request.QueryString("id"),conn,1,3
%>