📄 admin_provuser.asp
字号:
kCount = 0
do while not Rst.eof
%>
subcat[<%=kCount%>] = new Array("<%= trim(Rst("CountyName"))%>","<%= trim(Rst("CityID"))%>","<%= trim(Rst("CountyID"))%>");
<%
kCount = kCount + 1
Rst.movenext
loop
Call Rs_End(Rst)
%>
onecount=<%=kCount%>;
function changelocation(CityID)
{
document.myform.CountyID.length = 0;
var CityID=CityID;
var i;
//document.myform.CountyID.options[0] = new Option('====所有地区====','');
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == CityID)
{
document.myform.CountyID.options[document.myform.CountyID.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<select name="CityID" onChange="changelocation(document.myform.CityID.options[document.myform.CityID.selectedIndex].value)">
<%
Sqltt = "select * from City order by CityID asc"
Call sql_open(Rstt,Sqltt,Conn,1,1)
do while not Rstt.eof
%>
<option value="<%=trim(Rstt("CityID"))%>"><%=trim(Rstt("CityName"))%></option>
<%
Rstt.movenext
loop
Call Rs_End(Rstt)
%>
</select>
<select name="CountyID">
<option selected value="">==所有地区==</option>
</select>
<script LANGUAGE="javascript">
changelocation(document.myform.CityID.options[document.myform.CityID.selectedIndex].value);
</script>
<!--联动下拉框结束-->
</td>
</tr>
<tr class="tdbg">
<td class="tdbg"><strong>单位名称:</strong></td>
<td class="tdbg"><input name="UserUnit" type="text" id="UserUnit"></td>
</tr>
<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>
<%
if GetUserPower="A" then
%>
<tr class="tdbg" id=LevArea>
<td class="tdbg"><strong>权限:</strong></td>
<td class="tdbg"><input name="UserPower" type="radio" value="A">
中移鼎讯公司
<input name="UserPower" type="radio" id="UserPower" value="B" checked>
省移动公司
</td>
<%
end if
%>
</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_ProvUser.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_ProvUser.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>
<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")%>>
省移动公司</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_ProvUser.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,CCityID,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")
CCityID = Request("CCityID") '添加市级时用
CityID = Request("CityID") '添加县级
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
If UserGID=5 Then '添加为省级用户(用组ID)
Rs("CityID") =0
Rs("CountyID") =0
Elseif UserGID=6 Then '市级
Rs("CityID") =CCityID
Rs("CountyID") =0
Else
Rs("CityID") =CityID
Rs("CountyID") =CountyID
end if
Rs("UserProSave") =UserProSave
Rs("UserUnit") =UserUnit
Rs("UserEmail") =UserEmail
Rs("UserTEL") =UserTEL
Rs("UserFax") =UserFax
if UserGID=5 then
Rs("UserPower") =UserPower
else
Rs("UserPower")="C"
end if
Rs("UserSign") =UserSign
Rs.update
Call Rs_End(Rs)
Conn.execute("update T_UserGroup set UserNum=UserNum+1 where UserGID='" & Cstr(UserGID) & "'")
Call Msg("保存成功",1,"")
'if UserGID=5 then '省级用户
' Response.Redirect "Admin_ProvUser.asp?CityID=0"
'Elseif UserGID=6 then '市级用户
' Response.Redirect "Admin_ProvUser.asp?CityID="&CCityID&""
'Elseif UserGID=7 then '县级用户
' Response.Redirect "Admin_ProUser.asp?CityID="&CityID&""
'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
Rs("UserPower") =UserPower
rs.update
Call Rs_End(Rs)
Call Msg("保存成功",1,"")
' if UserGID=5 then '省级用户
' Response.Redirect "Admin_ProvUser.asp?CityID=0"
' Elseif UserGID=6 then '市级用户
' Response.Redirect "Admin_ProvUser.asp?CityID="&CCityID&""
' Elseif UserGID=7 then '县级用户
' Response.Redirect "Admin_ProvUser.asp?CityID="&CCityID&""
' Else
Call main()
' end if
end sub
'////审核///
Sub CheckList()
dim UserID,CityID
CityID=Request("CityID")
UserID=trim(Request("ID"))
If CityID ="" then
CityID = 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_ProvUser.asp?CityID="&CityID&""
end sub
sub DelAdmin()
dim UserID,CityID
CityID=Request("CityID")
UserID=trim(Request("ID"))
If CityID ="" then
CityID = 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_ProvUser.asp?CityID="&CityID&""
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -