📄 mpwd.asp
字号:
<!--#include file="../inc/function.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/ChkPurview.asp"-->
<%
Dim id,Action
Action=Trim(request("Action"))
ID=trim(Request("ID"))
if id="" then
Call Msg("非法f参数",1,"")
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户资料</title>
<link href="../css/mobile_sale.css" rel="stylesheet" type="text/css">
<SCRIPT language=javascript>
function Checkpwd()
{
if(document.form1.ypwd.value=="")
{
alert("原密码不能为空!");
document.form1.ypwd.focus();
return false;
}
if(document.form1.newpwd.value=="")
{
alert("密码不能为空!");
document.form1.newpwd.focus();
return false;
}
if((document.form1.newpwd.value)!=(document.form1.newpwd2.value))
{
alert("初始密码与确认密码不同!");
document.form1.newpwd.select();
document.form1.newpwd2.focus();
return false;
}
if (document.form1.Purview[1].checked==true){
GetClassPurview();
}
}
</script>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr class="topbg">
<td height="22" colspan="2" align="center"><strong>用 户 管 理</strong></td>
</tr>
<tr class="tdbg">
<td width="70" height="30"><strong>管理导航:</strong></td>
<td height="30"> <a href="ShowUser.asp?ID=<%=ID%>">个人资料</a> | <a href="Mpwd.asp?ID=<%=ID%>">修改资料</a> | <a href="LogUser.asp?ID=<%=ID%>">访问日志</a> </td>
</tr>
</table>
<br>
<%
if Action="ModifyPwd" then
call ModifyPwd()
elseif Action="SaveModifyPwd" then
call SaveModifyPwd()
else
call ModifyPwd()
end if
Call Conn_End(conn)
sub ModifyPwd()
dim ID
ID=trim(Request("ID"))
if ID="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请指定要修改的用户ID</li>"
exit sub
else
ID=Clng(ID)
end if
' sql="Select * from T_User where UserID=" & ID
if GetUserGID = 5 then
sql="Select * from T_User where UserID=" & ID
elseif GetUserGID = 6 then
sql="Select * from T_User where UserGID>5 and CityID='"&GetCityID&"' and UserID=" & ID
elseif GetUserGID = 7 then
sql="Select * from T_User where UserGID>6 and CityID='"&GetCityID&"' and CountyID='"&GetCountyID&"' and UserID=" & ID
elseif GetUserGID = 8 then
if GetUserType=1 then
sql="Select * from T_User where UserGID>7 and CityID='"&GetCityID&"' and UserID=" & ID
else
sql="Select * from T_User where UserGID>7 and CityID='"&GetCityID&"' and CountyID='"&GetCountyID&"' and UserID=" & ID
end if
end if
Call sql_open(Rs,Sql,conn,1,3)
If Rs.Bof and Rs.EOF then
Call Msg("您没有权限修改此人资料", 1,"")
else
%>
<form method="post" action="Mpwd.asp" name="form1" onsubmit="javascript:return CheckModifyPwd();">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" >
<tr class="title">
<td height="22" colspan="2"> <div align="center"><strong>修 改 用 户 密 码</strong></div></td>
</tr>
<tr>
<td width="40%" class="tdbg"><strong>用 户 名:</strong></td>
<td width="65%" class="tdbg"><%=Rs("UserName")%> <input name="ID" type="hidden" value="<%=rs("UserID")%>"></td>
</tr>
<tr>
<td width="40%" class="tdbg"><strong>新 密 码:</strong></td>
<td width="65%" class="tdbg"><input name="Password" type="password" id="Password">
(不修改请留空)</td>
</tr>
<tr>
<td class="tdbg"><strong>确认密码:</strong></td>
<td class="tdbg"><input name="PwdConfirm" type="password" id="PwdConfirm"></td>
</tr>
<tr>
<td class="tdbg"><strong>真实姓名:</strong></td>
<td class="tdbg"><input name="UserTrueName" type="text" id="UserTrueName" value="<%=Rs("UserTrueName")%>"></td>
</tr>
<tr class="tdbg">
<td class="tdbg"><strong>单位名称:</strong></td>
<td class="tdbg"><input name="UserUnit" type="text" id="UserUnit" value="<%=Rs("UserUnit")%>"></td>
</tr>
<%
if GetUserGID = 5 then
%>
<tr class="tdbg">
<td class="tdbg"><strong>库存警戒线</strong></td>
<td class="tdbg"><input name="UserProSave" type="text" id="UserProSave" value="<%=Rs("UserProSave")%>" size="8" maxlength="4"></td>
</tr>
<%
end if
%>
<tr class="tdbg">
<td class="tdbg"><strong>Email:</strong></td>
<td class="tdbg"><input name="UserEmail" type="text" id="UserEmail" value="<%=Rs("UserEmail")%>"></td>
</tr>
<tr class="tdbg">
<td class="tdbg"><strong>电话:</strong></td>
<td class="tdbg"><input name="UserTEL" type="text" id="UserTEL" value="<%=Rs("UserTEL")%>"></td>
</tr>
<tr class="tdbg">
<td class="tdbg"><strong>传真:</strong></td>
<td class="tdbg"><input name="UserFax" type="text" id="UserFax" value="<%=Rs("UserFax")%>"></td>
</tr>
<tr class="tdbg">
<td class="tdbg"><strong> 签名: </strong></td>
<td class="tdbg"><textarea name="UserSign" id="UserSign"><%=Rs("UserSign")%></textarea></td>
</tr>
<tr>
<td colspan="2" align="center" class="tdbg"><input name="Action" type="hidden" id="Action" value="SaveModifyPwd">
<input type="submit" name="Submit" value="保存修改结果" style="cursor:hand;">
<input name="Cancel" type="button" id="Cancel" value=" 取 消 " onClick="window.location.href='Admin_CityUser.asp'" style="cursor:hand;"></td>
</tr>
</table>
</form>
<%
end if
Call Rs_End(Rs)
end sub
sub SaveModifyPwd()
dim UserID,UserName,UserPassword,PwdConfirm,UserTrueName,UserUnit,UserEmail,UserTEL,UserFax,UserPower,UserSign
Dim UserProSave
UserID=trim(Request("ID"))
UserPassword=trim(Request("Password"))
PwdConfirm =trim(Request("PwdConfirm"))
UserTrueName=trim(Request("UserTrueName"))
UserUnit = Request("UserUnit")
UserEmail = Request("UserEmail")
UserTEL = Request("UserTEL")
UserFax = Request("UserFax")
' UserPower = Request("UserPower")
UserSign = Request("UserSign")
if GetUserGID = 5 then
UserProSave = Request("UserProSave")
end if
if UserID="" then
Call Msg("请指定要修改的用户ID", 1,"")
else
UserID=Clng(UserID)
end if
if UserPassword<>"" then
if PwdConfirm<>UserPassword then
Call Msg("确认密码必须与新密码相同", 1,"")
end if
end if
'省级用户、市县用户、县级用户、分销点用户
if GetUserGID = 5 then
sql="Select * from T_User where UserID=" & UserID
elseif GetUserGID = 6 then
sql="Select * from T_User where UserGID>5 and CityID='"&GetCityID&"' and UserID=" & UserID
elseif GetUserGID = 7 then
sql="Select * from T_User where UserGID>6 and CityID='"&GetCityID&"' and CountyID='"&GetCountyID&"' and UserID=" & UserID
elseif GetUserGID = 8 then
if GetUserType=1 then
sql="Select * from T_User where UserGID>7 and CityID='"&GetCityID&"' and UserID=" & UserID
else
sql="Select * from T_User where UserGID>7 and CityID='"&GetCityID&"' and CountyID='"&GetCountyID&"' and UserID=" & UserID
end if
end if
'
' sql="Select * from T_User where UserID=" & UserID
Call sql_open(Rs,sql,conn,1,3)
if rs.Bof and rs.EOF then
Call Msg("您没有权限修改此人资料", 1,"")
Call Rs_End(Rs)
exit sub
end if
if UserPassword<>"" then
Rs("UserPassword") =md5(UserPassword)
end if
Rs("UserTrueName") =UserTrueName
Rs("UserUnit") =UserUnit
Rs("UserEmail") =UserEmail
Rs("UserTEL") =UserTEL
Rs("UserFax") =UserFax
' Rs("UserPower") =UserPower
Rs("UserSign") =UserSign
if GetUserGID = 5 then
Rs("UserProSave") =UserProSave
end if
rs.update
Call Rs_End(Rs)
Response.Redirect "showuser.asp?ID="&ID&""
end sub
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -