📄 admin_usersave.asp
字号:
<%if Session("IsAdmin")<>true or session("KEY")<>"super" then response.redirect "admin_login.asp"%>
<!--#include file="conn.asp"-->
<%
id=request("id")
act=request("act")
set rs=server.CreateObject("ADODB.RecordSet")
if act="edit" then
username=trim(request("username"))
password=trim(request("password"))
Sex=trim(request("Sex"))
Email=trim(request("Email"))
sign=trim(request("sign"))
OICQ=trim(request("oicq"))
UserWebName=trim(request("UserWebName"))
UserWebUrl=trim(request("UserWebUrl"))
Address=trim(request("address"))
ContactAddress=trim(request("ContactAddress"))
TrueName=trim(request("TrueName"))
if username="" or password="" or Sex="" then
Response.Write "管理员名称,密码和性别都不能为空!"
Response.End
end if
sql="select * from user where id="& request("id")
rs.open sql,conn,1,3
if not rs.eof then
rs("Username")=username
rs("Password")=password
rs("Sex")=Sex
if Email="" then
rs("Email")=null
else
rs("Email")=Email
end if
if oicq="" then
rs("oicq")=null
else
rs("oicq")=oicq
end if
if sign="" then
rs("sign")=null
else
rs("sign")=sign
end if
if Address="" then
rs("Address")=null
else
rs("Address")=Address
end if
if ContactAddress="" then
rs("ContactAddress")=null
else
rs("ContactAddress")=ContactAddress
end if
if TrueName="" then
rs("TrueName")=null
else
rs("TrueName")=TrueName
end if
if UserWeburl="" then
rs("UserWeburl")=null
else
rs("UserWeburl")=UserWeburl
end if
if UserWebname="" then
rs("UserWebname")=null
else
rs("UserWebname")=UserWebname
end if
rs.update
end if
rs.close
elseif act="lock" then
sql="select * from user where id="&id
rs.open sql,conn,1,3
if not rs.eof then
if rs("lockuser")=false then
rs("lockuser")=true
else
rs("lockuser")=false
end if
rs.update
end if
rs.close
set rs=nothing
elseif act="deldate" then
selectdate=trim(Request.Form ("selectdate"))
selecttimes=trim(Request.Form ("selecttimes"))
if selectdate<>"" or selecttimes<>"" then
thisdate=date()
set rs=server.CreateObject("ADODB.RecordSet")
if selectdate="" and selecttimes<>"" then
sql="select username from [user] where logins<"&selecttimes
elseif selectdate<>"" and selecttimes="" then
sql="select username from [user] where datediff('y',datevalue(lastlogin),#"&thisdate&"#)>"&selectdate
elseif selectdate<>"" and selecttimes<>"" then
sql="select username from [user] where datediff('y',datevalue(lastlogin),#"&thisdate&"#)>"&selectdate&" and logins<"&selecttimes
end if
rs.open sql,conn,1,1
if not rs.eof then
arrRow=rs.GetRows
arrCon=rs.RecordCount
rs.close
set rs=nothing
for i=0 to arrCon-1
conn.execute("delete * from [user] where username='"&arrRow(0,i)&"'")
conn.execute("delete * from message where sender='"&arrRow(0,i)&"' or incept='"&arrRow(0,i)&"'")
conn.execute("delete * from SendMusic where FromUser='"&arrRow(0,i)&"' or ForUser='"&arrRow(0,i)&"'")
conn.execute("delete * from collection where username='"&arrRow(0,i)&"'")
next
arrCon=null
arrRow=null
else
rs.close
set rs=nothing
end if
end if
end if
conn.close
set conn=nothing
response.redirect "admin_UserMana.asp"
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -