📄 admin_user_modify.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Check_Sql123.asp" -->
<!--#include file="admin_qx.asp" -->
<% call isgly_sys() %>
<!--#include file="conn_db123.asp" -->
<!--#include file="jm5.asp"-->
<!--#include file="inc/Config_zd.asp"-->
<%no1_upd=trim(request("no1_upd"))
if no1_upd<>""then session("updadmin_REFERER")=Request.ServerVariables("HTTP_REFERER")
updadmin_id=trim(request("updadmin_id"))
operate=request("operate")
if operate="userupd"then'+++++++++++++++++++++
adminlogin=trim(request("adminlogin"))
adminpwd_new=trim(request("adminpwd_new"))
adminpwd2_new=trim(request("adminpwd2_new"))
adminname=trim(request("adminname"))
admin_shenfen=trim(request("admin_shenfen"))
admv_jb_gj=trim(request("admv_jb_gj"))
adma_jb_gj=trim(request("adma_jb_gj"))
admu_jb_gj=trim(request("admu_jb_gj"))
admd_jbtorecycle_gj=trim(request("admd_jbtorecycle_gj"))
admd_jb_gj=trim(request("admd_jb_gj"))
admc_jb_gj=trim(request("admc_jb_gj"))
admin_zg_check_gj=trim(request("admin_zg_check_gj"))
admin_zg_recycle_gj=trim(request("admin_zg_recycle_gj"))
admin_bumen_big=trim(request("admin_bumen_big"))
admin_bumen_small=trim(request("admin_bumen_small"))
admv_jb_bumen=trim(request("admv_jb_bumen"))
adma_jb_bumen=trim(request("adma_jb_bumen"))
admu_jb_bumen=trim(request("admu_jb_bumen"))
admd_jbtorecycle_bumen=trim(request("admd_jbtorecycle_bumen"))
admd_jb_bumen=trim(request("admd_jb_bumen"))
admin_zg_check_bumen=trim(request("admin_zg_check_bumen"))
admin_zg_recycle_bumen=trim(request("admin_zg_recycle_bumen"))
isbelocked=trim(request("isbelocked"))
remark=trim(request("remark"))
if adminlogin="" then
response.Write "<script language=javascript>{window.alert('报错:用户名不能为空!');window.history.go(-1);}</script>"
response.end
end if
if adminname="" then
response.Write "<script language=javascript>{window.alert('报错:真实姓名不能为空!');window.history.go(-1);}</script>"
response.end
end if
if admin_shenfen="" then
response.Write "<script language=javascript>{window.alert('报错:请选择“访问权限身份级别”!');window.history.go(-1);}</script>"
response.end
end if
if adminpwd_new<>"" or adminpwd2_new <>""then
if adminpwd_new<>adminpwd2_new then
response.Write "<script language=javascript>{window.alert('报错:两次输入的密码不相同!\n“新密码”和“确认新密码”只有要需要修改密码的时候填写。\n 如不需要修改密码则不需要填写,此时请让“新密码”和“确认新密码”留空');window.history.go(-1);}</script>"
response.end
end if
if len(adminpwd_new)<5 or len(adminpwd_new)>30 then
response.Write "<script language=JavaScript>{window.alert('报错:密码长度不够,至少要输入五位,最长不超过30位!');window.history.go(-1);}</script>"
response.End()
end if
end if
if admin_shenfen="2" then
if admin_bumen_big="" then
response.Write "<script language=javascript>{window.alert('报错:添加“部门管理员”,则必须选择所属部门!');window.history.go(-1);}</script>"
response.end
end if
end if
'检验用户名不能在系统中重复
sqlbianhao="select * from admin_123 where adminlogin='"&adminlogin&"'"
set rsbianhao=server.CreateObject("adodb.recordset")
rsbianhao.open sqlbianhao,conn,1,2
if rsbianhao.recordcount>1 then
response.Write "<script language=javascript>{window.alert('报错:用户名重复!原因是该用户名已经存在于库中,请选择其他用户名!');window.history.go(-1);}</script>"
response.End
end if
rsbianhao.close
set rsbianhao=nothing
sql_upd="select * from admin_123 where admin_id ="&updadmin_id
set rs_upd=server.CreateObject("adodb.recordset")
rs_upd.open sql_upd,conn,1,2
rs_upd("adminlogin")=adminlogin
if adminpwd_new<>""then
rs_upd("adminpwd")=md5(adminpwd_new)
end if
rs_upd("adminname")=adminname
rs_upd("admin_shenfen")=admin_shenfen
if admin_shenfen="0"then
rs_upd("admin_bumen_big")=""
rs_upd("admin_bumen_small")=""
rs_upd("admv_jb")="T"
rs_upd("adma_jb")="T"
rs_upd("admu_jb")="T"
rs_upd("admd_jbtorecycle")="T"
rs_upd("admd_jb")="T"
rs_upd("admc_jb")="T"
rs_upd("admin_zg_check")="T"
rs_upd("admin_zg_recycle")="T"
end if
if admin_shenfen="1"then
rs_upd("admin_bumen_big")=""
rs_upd("admin_bumen_small")=""
rs_upd("admv_jb")=admv_jb_gj
rs_upd("adma_jb")=adma_jb_gj
rs_upd("admu_jb")=admu_jb_gj
rs_upd("admd_jbtorecycle")=admd_jbtorecycle_gj
rs_upd("admd_jb")=admd_jb_gj
rs_upd("admc_jb")=admc_jb_gj
rs_upd("admin_zg_check")=admin_zg_check_gj
rs_upd("admin_zg_recycle")=admin_zg_recycle_gj
end if
rs_upd("isbelocked")=isbelocked
rs_upd("remark")=remark
rs_upd.update
rs_upd.close
set rs_upd=nothing
response.write "<script language=JavaScript>{window.alert('修改成功! \n 请按“确定”返回! \n ');location.href='"&session("updadmin_REFERER")&"';}</script>"
end if '+++++++++++++++++++++
sql="select * from admin_123 where admin_id ="&updadmin_id
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,2
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="Images/Style.css" rel="stylesheet" type="text/css">
<title>修改用户</title>
<style type="text/css">
<!--
.style3 {color: #FF0000}
.style1 {color: #0000FF}
body {
background-color: #DECDFA;
margin-left: 2px;
margin-right: 2px;
}
body,td,th {
font-size: 12px;
}
.STYLE8 {color: #CC3300}
.STYLE9 {font-size: 18px}
.STYLE4 {color: #FFFFFF}
.STYLE4 {font-size: 12px; color: #000000; }
-->
</style>
</head>
<body>
<table class=tableBorder width="99%" border=0 align="center" cellpadding=5 cellspacing=1>
<tbody>
<tr>
<th width="100%" height=21 sytle="line-height:150%">【修改查看用户】</th>
</tr>
<tr>
<td class=forumRow>
<form id="form1" name="form1" method="post" action="?" OnSubmit="return subcheck()">
<table width="100%" border="1" align="center" cellpadding="2" cellspacing="1" bordercolor="#F3F3F3" style="border-collapse: collapse">
<tr>
<td align="right" class="style3" >用户名:</td>
<td width="89%"><label>
<input name="adminlogin" type="text" id="adminlogin" value="<%=rs("adminlogin")%>" size="23"/>
<span class="style1">* 请尽量不要用真实姓名</span></label></td>
</tr>
<tr>
<td align="right" class="style3">新密码:</td>
<td><span class="style3">
<input name="adminpwd_new" type="password" id="adminpwd_new" size="23" />
</span></td>
</tr>
<tr>
<td align="right" class="style3">确认新密码:</td>
<td><span class="style3">
<input name="adminpwd2_new" type="password" id="adminpwd2_new" size="23" />
</span></td>
</tr>
<tr>
<td align="right" class="style3">真实姓名:</td>
<td><input name="adminname" type="text" id="adminname" value="<%=rs("adminname")%>" size="23" />
<span class="style1">*</span></td>
</tr>
<tr>
<td rowspan="2" align="right" class="style3">用户身份:</td>
<td><input name='admin_shenfen' type='radio' value="0" onFocus="span_gj.style.display='none';span_bumen.style.display='none';" id="admin_shenfen_sys" <%if rs("admin_shenfen")="0"then response.write"checked"%>/>
<label for="admin_shenfen_sys"><span class="style3">系统管理员</span> | 拥有系统的一切权限,请慎用!</label></td>
</tr>
<tr>
<td><input name='admin_shenfen' id="admin_shenfen_adv" type='radio' value="1" onFocus="span_gj.style.display='';span_bumen.style.display='none';" <%if rs("admin_shenfen")="1"then response.write"checked"%> />
<label for="admin_shenfen_adv"> <span class="style3">一般管理员</span> | 针对全部记录的权限:</label>
<br>
<span class="STYLE4" id="span_gj">
<input name="admv_jb_gj" type="checkbox" id="admv_jb_gj" onFocus="form1.admin_shenfen_adv.checked='checked';span_gj.style.display='';span_bumen.style.display='none';" onclick="return false" value="T" checked <%if rs("admin_shenfen")="1" and rs("admv_jb")="T"then response.write"checked"%>>
<label for="admv_jb_gj">查看 </label>
<input name="adma_jb_gj" type="checkbox" id="adma_jb_gj" value="T" onFocus="form1.admin_shenfen_adv.checked='checked';span_gj.style.display='';span_bumen.style.display='none';" <%if rs("admin_shenfen")="1" and rs("adma_jb")="T"then response.write"checked"%>><label for="adma_jb_gj">添加</label>
<input name="admu_jb_gj" type="checkbox" id="admu_jb_gj" value="T" onFocus="form1.admin_shenfen_adv.checked='checked';span_gj.style.display='';span_bumen.style.display='none';" <%if rs("admin_shenfen")="1" and rs("admu_jb")="T"then response.write"checked"%>> <label for="admu_jb_gj">修改 </label><label for="admd_jbtorecycle_gj"></label>
<input name="admd_jb_gj" type="checkbox" id="admd_jb_gj" value="T" onFocus="form1.admin_shenfen_adv.checked='checked';span_gj.style.display='';span_bumen.style.display='none';" <%if rs("admin_shenfen")="1" and rs("admd_jb")="T"then response.write"checked"%>> <label for="admd_jb_gj">删除</label>
<input name="admc_jb_gj" type="checkbox" id="admc_jb_gj" value="T" onFocus="form1.admin_shenfen_adv.checked='checked';span_gj.style.display='';span_bumen.style.display='none';" <%if rs("admin_shenfen")="1" and rs("admc_jb")="T"then response.write"checked"%>> <label for="admc_jb_gj">审核</label>
</span><span id="span_bumen"></span></td>
</tr>
<tr>
<td align="right" class="style3">帐户状态:</td>
<td><span class="STYLE4">
<input name="isbelocked" type="radio" id="islocked_ul" value="F" <%if rs("isbelocked")="F"then response.write"checked"%>>
<label for="islocked_ul">正常可用</label>
<input type="radio" name="isbelocked" value="T" id="islocked_l" <%if rs("isbelocked")="T"then response.write"checked"%>>
<label for="islocked_l">锁定 (被锁定了的帐户禁止登录系统)</label>
</span></td>
</tr>
<tr>
<td align="right" class="style3">备注:</td>
<td><label>
<input name="remark" type="text" id="remark" value="<%=rs("remark")%>" size="50" />
<span class="style1">可选</span></label></td>
</tr>
</table>
<label>
<div align="center">
<input type="submit" name="Submit" value="修改用户" style="width:100;background-color: #B7F4D6; color: #000000; border: 1 solid #00CC00" />
<input name="operate" type="hidden" id="operate" value="userupd">
<input name="updadmin_id" type="hidden" id="updadmin_id" value="<%=rs("admin_id")%>">
</div>
<div align="center"><u><a href="javascript:window.history.go(-1)" class="STYLE8 STYLE9"><br>
直 接 返 回</a></u></div>
<label></label>
</form>
<div align="center"></div> </td>
</tr>
</tbody>
</table>
</body>
</html>
<script language="javascript">
function subcheck()
{
if (form1.adminlogin.value=="")
{
alert ("用户名 不能为空!");
form1.adminlogin.focus ();
return false;
}
if (form1.adminpwd_new.value!="")
{
if(form1.adminpwd_new.value.length<5||form1.adminpwd_new.value.length>30)
{
alert ("新的密码 必须为5到30位之间!");
form1.adminpwd_new.focus ();
return false;
}
}
if (form1.adminpwd2_new.value!="")
{
if(form1.adminpwd2_new.value.length<5||form1.adminpwd2_new.value.length>30)
{
alert ("新的确认密码 必须为5到30位之间!");
form1.adminpwd2_new.focus ();
return false;
}
}
if(form1.adminpwd_new.value!=""||form1.adminpwd2_new.value!="")
{
if (form1.adminpwd_new.value!=form1.adminpwd2_new.value)
{
alert ("新的 密码与确认密码 不一致!");
form1.adminpwd_new.focus ();
return false;
}
}
if (form1.adminname.value=="")
{
alert ("真实姓名 不能为空!");
form1.adminname.focus ();
return false;
}
if (form1.admin_shenfen_sys.checked==false&&form1.admin_shenfen_adv.checked==false)
{alert ("必须选择一种 用户身份!");
//form1.adminname.focus ();
return false;
}
return true;
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -