📄 admin_cityuser.asp
字号:
<tr class="tdbg">
<td class="tdbg"><strong>库存警戒线</strong></td>
<td class="tdbg"><input name="UserProSave" type="text" id="UserProSave" value="50" size="8" maxlength="5"></td>
</tr>
<tr class="tdbg">
<td class="tdbg"><strong>Email:</strong></td>
<td class="tdbg"><input name="UserEmail" type="text" id="UserEmail"></td>
</tr>
<tr class="tdbg">
<td class="tdbg"><strong>电话:</strong></td>
<td class="tdbg"><input name="UserTEL" type="text" id="UserTEL"></td>
</tr>
<tr class="tdbg">
<td class="tdbg"><strong>传真:</strong></td>
<td class="tdbg"><input name="UserFax" type="text" id="UserFax"></td>
</tr>
<tr class="tdbg">
<td class="tdbg"><strong> 签名: </strong></td>
<td class="tdbg"><textarea name="UserSign" id="UserSign"></textarea></td>
</tr>
<!--
<tr class="tdbg" id=bot>
<td class="tdbg"><strong>权限:</strong></td>
<td class="tdbg"><input type="radio" name="UserPower" value="A">
超级用户
<input name="UserPower" type="radio" id="UserPower" value="B">
审核用户(审核、拒绝)
<input name="UserPower" type="radio" id="UserPower" value="C">
普通用户(增加、修改、
删除)</td>
</tr>
-->
<tr>
<td height="40" colspan="2" align="center" class="tdbg"><input name="Action" type="hidden" id="Action" value="SaveAdd">
<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 sub
sub ModifyPwd()
dim UserID
UserID=trim(Request("ID"))
if UserID="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请指定要修改的用户ID</li>"
exit sub
else
UserID=Clng(UserID)
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,"")
else
%>
<form method="post" action="Admin_CityUser.asp" name="myform" 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>
<%
if Rs("UserGID")<>8 then
%>
<tr>
<td class="tdbg"><strong>权限:</strong></td>
<td class="tdbg"><input name="UserPower" type="radio" value="A" <%if Rs("UserPower")="A" then Response.Write("checked")%>>
超级用户
<input name="UserPower" type="radio" id="UserPower" value="B" <%if Rs("UserPower")="B" then Response.Write("checked")%>>
审核用户(审核、拒绝)
<input name="UserPower" type="radio" id="UserPower" value="C" <%if Rs("UserPower")="C" then Response.Write("checked")%>>
普通用户(增加、修改、
删除)</td>
</tr>
<%end if%>
<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
%>
</body>
</html>
<%
sub SaveAdd()
Dim UserName,UserPassword,PwdConfirm,UserTrueName,UserGID,CityID,CountyID,UserUnit,UserEmail,UserTEL,UserFax,UserPower,UserSign
Dim UserProSave
UserName =trim(Request("UserName"))
UserPassword=trim(Request("Password"))
PwdConfirm =trim(Request("PwdConfirm"))
UserTrueName=trim(Request("UserTrueName"))
UserGID = Request("UserGID")
CityID = GetCityID '添加市级时用(直接取得)
CountyID = Request("CountyID") '添加县级
UserProSave = Request("UserProSave")
UserUnit = Request("UserUnit")
UserEmail = Request("UserEmail")
UserTEL = Request("UserTEL")
UserFax = Request("UserFax")
UserPower = Request("UserPower")
UserSign = Request("UserSign")
if UserName="" then
Call Msg("用户名不能为空", 1,"")
end if
if UserPassword="" then
Call Msg("初始密码不能为空", 1,"")
end if
if PwdConfirm<>UserPassword then
Call Msg("确认密码必须与初始密码相同", 1,"")
end if
Sql="Select * from T_User where UserName='"&UserName&"'"
Call sql_open(Rs,Sql,conn,1,3)
if not (Rs.bof and Rs.EOF) then
Call Msg("数据库中已经存在此用户", 1,"")
Call Rs_End(Rs)
exit sub
end if
Rs.addnew
Rs("UserName") =UserName
Rs("UserPassword") =md5(UserPassword)
Rs("UserTrueName") =UserTrueName
Rs("UserGID") =UserGID
Rs("CityID") =CityID
if UserGID=8 Then '市级/市分销点
Rs("CountyID") =0
Else
Rs("CountyID") =CountyID
end if
'Response.write UserGID&"<br>"
'Response.write GetCityID&"<br>"
'Response.Write CountyID
'Response.End()
Rs("UserProSave") =UserProSave
Rs("UserUnit") =UserUnit
Rs("UserEmail") =UserEmail
Rs("UserTEL") =UserTEL
Rs("UserFax") =UserFax
' if UserPower="" then
' Rs("UserPower")="A"
' else
' Rs("UserPower") =UserPower
' end if
Rs("UserPower")="C"
Rs("UserSign") =UserSign
Rs.update
Call Rs_End(Rs)
Conn.execute("update T_UserGroup set UserNum=UserNum+1 where UserGID='" & Cstr(UserGID) & "'")
if UserGID=6 then '市级用户
Response.Redirect "Admin_CityUser.asp?CountyID=0"
Elseif UserGID=7 then '县级用户
Response.Redirect "Admin_CityUser.asp?CountyID="&CountyID&""
Else
Call main()
end if
end sub
sub SaveModifyPwd()
dim UserID,UserName,UserPower
UserID=trim(Request("ID"))
UserPower = Request("UserPower")
if UserID="" then
Call Msg("请指定要修改的用户ID", 1,"")
else
UserID=Clng(UserID)
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 UserPower="" then
Rs("UserPower")="A"
else
Rs("UserPower") =UserPower
end if
rs.update
Call Rs_End(Rs)
Call Msg("保存成功",1,"")
' if UserGID=6 then '市级用户
' Response.Redirect "Admin_CityUser.asp?CountyID=0"
' Elseif UserGID=7 then '县级用户
' Response.Redirect "Admin_CityUser.asp?CountyID="&CountyID&""
' Else
Call main()
' end if
end sub
'////审核///
Sub CheckList()
dim UserID,CountyID
CountyID=Request("CountyID")
UserID=trim(Request("ID"))
If CountyID ="" then
CountyID = 0
End if
if UserID=trim(Session("UserID")) then
Call Msg("您不能审核您自己", 1,"")
end if
if UserID="" then
Call Msg("请指定要审核的用户", 1,"")
else
UserID=Clng(UserID)
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 Rs("UserIsCheck")=0 then
Rs("UserIsCheck")=1
else
Rs("UserIsCheck")=0
end if
Rs.update
Call Rs_End(Rs)
Response.Redirect "Admin_CityUser.asp?CountyID="&CountyID&""
end sub
sub DelAdmin()
dim UserID,CountyID
CountyID=Request("CountyID")
UserID=trim(Request("ID"))
'//////////////////////////////////
if UserID=trim(Session("UserID")) then
Call Msg("您不能删除您自己", 1,"")
end if
'//////////////////////////////////
If CountyID ="" then
CountyID = 0
End if
if UserID="" then
Call Msg("请指定要删除的用户ID", 1,"")
exit sub
end if
if instr(UserID,",")>0 then
UserID=replace(UserID," ","")
sql="Select * from T_User where UserID in (" & UserID & ")"
else
UserID=clng(UserID)
sql="select * from T_User where UserID=" & UserID
end if
Call Sql_open(Rs,Sql,Conn,1,3)
do while not rs.eof
rs.delete
rs.update
rs.movenext
loop
Call Rs_End(Rs)
Response.Redirect "Admin_CityUser.asp?CountyID="&CountyID&""
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -