%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true
Const PurviewLevel=2
Const CheckChannelID=0
Const PurviewLevel_Others="User"
%>
<%
const MaxPerPage=20
dim strFileName
dim totalPut,CurrentPage,TotalPages
dim rs, sql
dim UserID,UserSearch,Keyword,strField
dim Action,FoundErr,ErrMsg
dim tmpDays
keyword=trim(request("keyword"))
if keyword<>"" then
keyword=ReplaceBadChar(keyword)
end if
strField=trim(request("Field"))
UserSearch=trim(request("UserSearch"))
Action=trim(request("Action"))
UserID=trim(Request("UserID"))
ComeUrl=Request.ServerVariables("HTTP_REFERER")
if UserSearch="" then
UserSearch=0
else
UserSearch=Clng(UserSearch)
end if
strFileName="Admin_User.asp?UserSearch=" & UserSearch
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
注册用户管理
注 册 用 户 管 理
<%
if Action="Add" then
call AddUser()
elseif Action="SaveAdd" then
call SaveAdd()
elseif Action="Modify" then
call Modify()
elseif Action="SaveModify" then
call SaveModify()
elseif Action="Del" then
call DelUser()
elseif Action="Lock" then
call LockUser()
elseif Action="UnLock" then
call UnLockUser()
elseif Action="Move" then
call MoveUser()
elseif Action="Update" then
call UpdateUser()
elseif Action="DoUpdate" then
call DoUpdate()
elseif Action="AddMoney" then
call AddMoney()
elseif Action="SaveAddMoney" then
call SaveAddMoney()
else
call main()
end if
if FoundErr=True then
call WriteErrMsg()
end if
call CloseConn_User()
sub main()
dim strGuide
strGuide="
您现在的位置:注册用户管理 >> "
select case UserSearch
case 0
sql="select * from " & db_User_Table & " order by " & db_User_ID & " desc"
strGuide=strGuide & "所有用户"
case 1
sql="select top 100 * from " & db_User_Table & " order by " & db_User_ArticleChecked & " desc"
strGuide=strGuide & "发表文章最多的前100个用户"
case 2
sql="select top 100 * from " & db_User_Table & " order by " & db_User_ArticleChecked & ""
strGuide=strGuide & "发表文章最少的100个用户"
case 3
sql="select * from " & db_User_Table & " where datediff('h'," & db_User_LastLoginTime & ",Now())<25 order by " & db_User_LastLoginTime & " desc"
strGuide=strGuide & "最近24小时内登录的用户"
case 4
sql="select * from " & db_User_Table & " where datediff('h'," & db_User_RegDate & ",Now())<25 order by " & db_User_RegDate & " desc"
strGuide=strGuide & "最近24小时内注册的用户"
case 5
sql="select * from " & db_User_Table & " where " & db_User_UserLevel & "=3000 order by " & db_User_ID & " desc"
strGuide=strGuide & "等待邮件验证的用户"
case 6
sql="select * from " & db_User_Table & " where " & db_User_UserLevel & "=2000 order by " & db_User_ID & " desc"
strGuide=strGuide & "等待管理认证证的用户"
case 7
sql="select * from " & db_User_Table & " where " & db_User_LockUser & "=True order by " & db_User_ID & " desc"
strGuide=strGuide & "所有被锁住的用户"
case 8
sql="select * from " & db_User_Table & " where " & db_User_UserLevel & "=99 order by " & db_User_ID & " desc"
strGuide=strGuide & "所有收费用户"
case 9
sql="select * from " & db_User_Table & " where " & db_User_UserLevel & "=9 order by " & db_User_ID & " desc"
strGuide=strGuide & "所有VIP用户"
case 10
if Keyword="" then
sql="select * from " & db_User_Table & " order by " & db_User_ID & " desc"
strGuide=strGuide & "所有用户"
else
select case strField
case "UserID"
if IsNumeric(Keyword)=False then
FoundErr=True
ErrMsg=ErrMsg & "
用户ID必须是整数
"
else
sql="select * from " & db_User_Table & " where " & db_User_ID & "=" & Clng(Keyword)
strGuide=strGuide & "用户ID等于 " & Clng(Keyword) & " 的用户"
end if
case "UserName"
sql="select * from " & db_User_Table & " where " & db_User_Name & " like '%" & Keyword & "%' order by " & db_User_ID & " desc"
strGuide=strGuide & "用户名中含有“ " & Keyword & " ”的用户"
end select
end if
case else
FoundErr=True
ErrMsg=ErrMsg & "
错误的参数!
"
end select
strGuide=strGuide & "
"
if FoundErr=True then exit sub
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open sql,Conn_User,1,1
if rs.eof and rs.bof then
strGuide=strGuide & "共找到 0 个用户
"
response.write strGuide
else
totalPut=rs.recordcount
strGuide=strGuide & "共找到 " & totalPut & " 个用户"
response.write strGuide
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage strFileName,totalput,MaxPerPage,true,true,"个用户"
else
if (currentPage-1)*MaxPerPage
<%
end sub
sub ShowSearch()
%>
<%
end sub
sub AddUser()
%>
<%
end sub
sub Modify()
dim UserID
dim rsUser,sqlUser
UserID=trim(request("UserID"))
if UserID="" then
FoundErr=True
ErrMsg=ErrMsg & "
参数不足!
"
exit sub
else
UserID=Clng(UserID)
end if
Set rsUser=Server.CreateObject("Adodb.RecordSet")
sqlUser="select * from " & db_User_Table & " where " & db_User_ID & "=" & UserID
rsUser.Open sqlUser,Conn_User,1,3
if rsUser.bof and rsUser.eof then
FoundErr=True
ErrMsg=ErrMsg & "
找不到指定的用户!
"
rsUser.close
set rsUser=nothing
exit sub
end if
%>
<%
rsUser.close
set rsUser=nothing
end sub
sub AddMoney()
dim UserID
dim rsUser,sqlUser
UserID=trim(request("UserID"))
if UserID="" then
FoundErr=True
ErrMsg=ErrMsg & "
参数不足!
"
exit sub
else
UserID=Clng(UserID)
end if
Set rsUser=Server.CreateObject("Adodb.RecordSet")
sqlUser="select * from " & db_User_Table & " where " & db_User_ID & "=" & UserID
rsUser.Open sqlUser,Conn_User,1,3
if rsUser.bof and rsUser.eof then
FoundErr=True
ErrMsg=ErrMsg & "
找不到指定的用户!
"
rsUser.close
set rsUser=nothing
exit sub
end if
if rsUser(db_User_UserLevel)>99 then
FoundErr=True
ErrMsg=ErrMsg & "
此用户不是收费用户或VIP用户,无需续费!
"
rsUser.close
set rsUser=nothing
exit sub
end if
%>
<%
rsUser.close
set rsUser=nothing
end sub
sub UpdateUser()
%>
<%
end sub
%>
<%
sub SaveAdd()
dim UserName,Password,PwdConfirm,Question,Answer,Sex,Email,Homepage,OICQ,MSN,UserLevel,LockUser,ChargeType,UserPoint,BeginDate,Valid_Num,Valid_Unit
UserName=trim(request("UserName"))
Password=trim(request("Password"))
PwdConfirm=trim(request("PwdConfirm"))
Question=trim(request("Question"))
Answer=trim(request("Answer"))
Sex=trim(Request("Sex"))
Email=trim(request("Email"))
Homepage=trim(request("Homepage"))
OICQ=trim(request("OICQ"))
MSN=trim(request("MSN"))
UserLevel=trim(request("UserLevel"))
LockUser=trim(request("LockUser"))
ChargeType=trim(request("ChargeType"))
UserPoint=trim(request("UserPoint"))
BeginDate=trim(request("BeginDate"))
Valid_Num=trim(request("Valid_Num"))
Valid_Unit=trim(request("Valid_Unit"))
if UserName="" or strLength(UserName)>14 or strLength(UserName)<4 then
founderr=true
errmsg=errmsg & "
请输入用户名(不能大于14小于4)
"
else
if Instr(UserName,"=")>0 or Instr(UserName,"%")>0 or Instr(UserName,chr(32))>0 or Instr(UserName,"?")>0 or Instr(UserName,"&")>0 or Instr(UserName,";")>0 or Instr(UserName,",")>0 or Instr(UserName,"'")>0 or Instr(UserName,",")>0 or Instr(UserName,chr(34))>0 or Instr(UserName,chr(9))>0 or Instr(UserName,"")>0 or Instr(UserName,"$")>0 then
errmsg=errmsg+"
用户名中含有非法字符
"
founderr=true
end if
end if
if Password="" or strLength(Password)>12 or strLength(Password)<6 then
founderr=true
errmsg=errmsg & "
请输入密码(不能大于12小于6)
"
else
if Instr(Password,"=")>0 or Instr(Password,"%")>0 or Instr(Password,chr(32))>0 or Instr(Password,"?")>0 or Instr(Password,"&")>0 or Instr(Password,";")>0 or Instr(Password,",")>0 or Instr(Password,"'")>0 or Instr(Password,",")>0 or Instr(Password,chr(34))>0 or Instr(Password,chr(9))>0 or Instr(Password,"")>0 or Instr(Password,"$")>0 then
errmsg=errmsg+"
密码中含有非法字符
"
founderr=true
end if
end if
if PwdConfirm="" then
founderr=true
errmsg=errmsg & "
请输入确认密码(不能大于12小于6)
"
else
if Password<>PwdConfirm then
founderr=true
errmsg=errmsg & "
密码和确认密码不一致
"
end if
end if
if Question="" then
founderr=true
errmsg=errmsg & "
密码提示问题不能为空
"
end if
if Answer="" then
founderr=true
errmsg=errmsg & "
密码答案不能为空
"
end if
if Sex="" then
founderr=true
errmsg=errmsg & "
性别不能为空
"
else
sex=cint(sex)
if Sex<>0 and Sex<>1 then
Sex=1
end if
end if
if Email="" then
founderr=true
errmsg=errmsg & "
Email不能为空
"
else
if IsValidEmail(Email)=false then
errmsg=errmsg & "
您的Email有错误
"
founderr=true
end if
end if
if OICQ<>"" then
if not isnumeric(OICQ) or len(cstr(OICQ))>10 then
errmsg=errmsg & "
OICQ号码只能是4-10位数字,您可以选择不输入。
"
founderr=true
end if
end if
if MSN<>"" then
if IsValidEmail(MSN)=false then
errmsg=errmsg & "
你的MSN有误。
"
founderr=true
end if
end if
if UserLevel="" then
FoundErr=True
ErrMsg=ErrMsg & "
请指定用户级别!
"
else
UserLevel=CLng(UserLevel)
end if
if LockUser="True" then
LockUser=True
else
LockUser=False
end if
if ChargeType="" then
ChargeType=1
else
ChargeType=Clng(ChargeType)
end if
if UserPoint="" then
UserPoint=0
else
UserPoint=Clng(UserPoint)
end if
if BeginDate="" then
BeginDate=now()
else
BeginDate=Cdate(BeginDate)
end if
if Valid_Num="" then
Valid_Num=0
else
Valid_Num=Clng(Valid_Num)
end if
if Valid_Unit="" then
Valid_Unit=1
else
Valid_Unit=Clng(Valid_Unit)
end if
if (UserLevel=99 or UserLevel=9) then
if ChargeType=1 and UserPoint=0 then
FoundErr=True
ErrMsg=ErrMsg & "
请输入用户点数!
"
end if
if ChargeType=2 and Valid_Num=0 then
FoundErr=True
ErrMsg=ErrMsg & "
请输入有效期限
"
end if
end if
if founderr=true then
exit sub
end if
dim sqlReg,rsReg
sqlReg="select * from " & db_User_Table & " where " & db_User_Name & "='" & Username & "'"
set rsReg=server.createobject("adodb.recordset")
rsReg.open sqlReg,Conn_User,1,3
if not(rsReg.bof and rsReg.eof) then
founderr=true
errmsg=errmsg & "
你注册的用户已经存在!请换一个用户名再试试!
"
else
rsReg.addnew
rsReg(db_User_Name)=UserName
rsReg(db_User_Password)=md5(Password)
rsReg(db_User_Question)=Question
rsReg(db_User_Answer)=md5(Answer)
rsReg(db_User_Sex)=Sex
rsReg(db_User_Email)=Email
rsReg(db_User_Homepage)=Homepage
rsReg(db_User_QQ)=OICQ
rsReg(db_User_Msn)=MSN
rsReg(db_User_UserLevel)=UserLevel
rsReg(db_User_LockUser)=LockUser
rsReg(db_User_RegDate)=Now()
rsReg(db_User_ChargeType)=ChargeType
rsReg(db_User_UserPoint)=UserPoint
rsReg(db_User_BeginDate)=BeginDate
rsReg(db_User_Valid_Num)=Valid_Num
rsReg(db_User_Valid_Unit)=Valid_Unit
if UserTableType="Dvbbs6.0" or UserTableType="Dvbbs6.1" then
rsReg(db_User_UserClass) = FU_UserClass
rsReg(db_User_TitlePic) = FU_TitlePic
rsReg(db_User_UserGroupID) = FU_UserGroupID
rsReg(db_User_Face) = FU_Face
rsReg(db_User_FaceWidth) = FU_FaceWidth
rsReg(db_User_FaceHeight) = FU_FaceHeight
rsReg(db_User_UserWealth) = FU_UserWealth
rsReg(db_User_UserEP) = FU_UserEP
rsReg(db_User_UserCP) = FU_UserCP
rsReg(db_User_UserGroup) = FU_UserGroup
rsReg(db_User_Showre) = FU_Showre
end if
rsReg.update
call UpdateUserNum(UserName)
founderr=false
end if
rsReg.close
set rsReg=nothing
call CloseConn_User()
response.Redirect "Admin_User.asp"
end sub
sub SaveModify()
dim UserID,Password,PwdConfirm,Question,Answer,Sex,Email,Homepage,OICQ,MSN,UserLevel,LockUser,ChargeType,UserPoint,BeginDate,Valid_Num,Valid_Unit
dim rsUser,sqlUser
Action=trim(request("Action"))
UserID=trim(request("UserID"))
if UserID="" then
FoundErr=True
ErrMsg=ErrMsg & "
参数不足!
"
exit sub
else
UserID=Clng(UserID)
end if
Password=trim(request("Password"))
PwdConfirm=trim(request("PwdConfirm"))
Question=trim(request("Question"))
Answer=trim(request("Answer"))
Sex=trim(Request("Sex"))
Email=trim(request("Email"))
Homepage=trim(request("Homepage"))
OICQ=trim(request("OICQ"))
MSN=trim(request("MSN"))
UserLevel=trim(request("UserLevel"))
LockUser=trim(request("LockUser"))
ChargeType=trim(request("ChargeType"))
UserPoint=trim(request("UserPoint"))
BeginDate=trim(request("BeginDate"))
Valid_Num=trim(request("Valid_Num"))
Valid_Unit=trim(request("Valid_Unit"))
if Password<>"" then
if strLength(Password)>12 or strLength(Password)<6 then
founderr=true
errmsg=errmsg & "
密码不能大于12小于6,如果你不想修改密码,请保持为空。
"
end if
if Instr(Password,"=")>0 or Instr(Password,"%")>0 or Instr(Password,chr(32))>0 or Instr(Password,"?")>0 or Instr(Password,"&")>0 or Instr(Password,";")>0 or Instr(Password,",")>0 or Instr(Password,"'")>0 or Instr(Password,",")>0 or Instr(Password,chr(34))>0 or Instr(Password,chr(9))>0 or Instr(Password,"")>0 or Instr(Password,"$")>0 then
errmsg=errmsg+"
密码中含有非法字符,如果你不想修改密码,请保持为空。
"
founderr=true
end if
end if
if Password<>PwdConfirm then
founderr=true
errmsg=errmsg & "
密码和确认密码不一致
"
end if
if Question="" then
founderr=true
errmsg=errmsg & "
密码提示问题不能为空
"
end if
if Sex="" then
founderr=true
errmsg=errmsg & "
性别不能为空
"
else
sex=cint(sex)
if Sex<>0 and Sex<>1 then
Sex=1
end if
end if
if Email="" then
founderr=true
errmsg=errmsg & "
Email不能为空
"
else
if IsValidEmail(Email)=false then
errmsg=errmsg & "
您的Email有错误
"
founderr=true
end if
end if
if OICQ<>"" then
if not isnumeric(OICQ) or len(cstr(OICQ))>10 then
errmsg=errmsg & "
OICQ号码只能是4-10位数字,您可以选择不输入。
"
founderr=true
end if
end if
if MSN<>"" then
if IsValidEmail(MSN)=false then
errmsg=errmsg & "
你的MSN有误。
"
founderr=true
end if
end if
if UserLevel="" then
FoundErr=True
ErrMsg=ErrMsg & "
请指定用户级别!
"
else
UserLevel=CLng(UserLevel)
end if
if LockUser="True" then
LockUser=True
else
LockUser=False
end if
if ChargeType="" then
ChargeType=1
else
ChargeType=Clng(ChargeType)
end if
if UserPoint="" then
UserPoint=0
else
UserPoint=Clng(UserPoint)
end if
if BeginDate="" then
BeginDate=now()
else
BeginDate=Cdate(BeginDate)
end if
if Valid_Num="" then
Valid_Num=0
else
Valid_Num=Clng(Valid_Num)
end if
if Valid_Unit="" then
Valid_Unit=1
else
Valid_Unit=Clng(Valid_Unit)
end if
if (UserLevel=99 or UserLevel=9) then
if ChargeType=1 and UserPoint=0 then
FoundErr=True
ErrMsg=ErrMsg & "
请输入用户点数!
"
end if
if ChargeType=2 and Valid_Num=0 then
FoundErr=True
ErrMsg=ErrMsg & "
请输入有效期限
"
end if
end if
if founderr=true then
exit sub
end if
Set rsUser=Server.CreateObject("Adodb.RecordSet")
sqlUser="select * from " & db_User_Table & " where " & db_User_ID & "=" & UserID
rsUser.Open sqlUser,Conn_User,1,3
if rsUser.bof and rsUser.eof then
FoundErr=True
ErrMsg=ErrMsg & "
找不到指定的用户!
"
rsUser.close
set rsUser=nothing
exit sub
end if
if Password<>"" then
rsUser(db_User_Password)=md5(Password)
end if
rsUser(db_User_Question)=Question
if Answer<>"" then
rsUser(db_User_Answer)=md5(Answer)
end if
rsUser(db_User_Sex)=Sex
rsUser(db_User_Email)=Email
rsUser(db_User_Homepage)=HomePage
rsUser(db_User_QQ)=OICQ
rsUser(db_User_Msn)=MSN
rsUser(db_User_UserLevel)=UserLevel
rsUser(db_User_LockUser)=LockUser
rsUser(db_User_ChargeType)=ChargeType
rsUser(db_User_UserPoint)=UserPoint
rsUser(db_User_BeginDate)=BeginDate
rsUser(db_User_Valid_Num)=Valid_Num
rsUser(db_User_Valid_Unit)=Valid_Unit
rsUser.update
rsUser.Close
set rsUser=nothing
call CloseConn_User()
response.redirect "Admin_User.asp"
end sub
sub SaveAddMoney()
dim UserID,ChargeType,UserPoint,Valid_Num,Valid_Unit
dim rsUser,sqlUser
Action=trim(request("Action"))
UserID=trim(request("UserID"))
if UserID="" then
FoundErr=True
ErrMsg=ErrMsg & "
参数不足!
"
exit sub
else
UserID=Clng(UserID)
end if
ChargeType=trim(request("ChargeType"))
UserPoint=trim(request("UserPoint"))
Valid_Num=trim(request("Valid_Num"))
Valid_Unit=trim(request("Valid_Unit"))
if ChargeType="" then
ChargeType=1
else
ChargeType=Clng(ChargeType)
end if
if UserPoint="" then
UserPoint=0
else
UserPoint=Clng(UserPoint)
end if
if Valid_Num="" then
Valid_Num=0
else
Valid_Num=Clng(Valid_Num)
end if
if Valid_Unit="" then
Valid_Unit=1
else
Valid_Unit=Clng(Valid_Unit)
end if
if ChargeType=1 and UserPoint=0 then
FoundErr=True
ErrMsg=ErrMsg & "
请输入要追加的用户点数!
"
end if
if ChargeType=2 and Valid_Num=0 then
FoundErr=True
ErrMsg=ErrMsg & "
请输入要追加的天数
"
end if
if founderr=true then
exit sub
end if
Set rsUser=Server.CreateObject("Adodb.RecordSet")
sqlUser="select * from " & db_User_Table & " where " & db_User_ID & "=" & UserID
rsUser.Open sqlUser,Conn_User,1,3
if rsUser.bof and rsUser.eof then
FoundErr=True
ErrMsg=ErrMsg & "
找不到指定的用户!
"
rsUser.close
set rsUser=nothing
exit sub
end if
if ChargeType=1 then
rsUser(db_User_UserPoint)=rsUser(db_User_UserPoint)+UserPoint
else
if rsUser(db_User_Valid_Unit)=1 then
ValidDays=rsUser(db_User_Valid_Num)
elseif rsUser(db_User_Valid_Unit)=2 then
ValidDays=rsUser(db_User_Valid_Num)*30
elseif rsUser(db_User_Valid_Unit)=3 then
ValidDays=rsUser(db_User_Valid_Num)*365
end if
tmpDays=ValidDays-DateDiff("D",rsUser(db_User_BeginDate),now())
if tmpDays>0 then
rsUser(db_User_Valid_Num)=rsUser(db_User_Valid_Num)+Valid_Num
else
rsUser(db_User_BeginDate)=now()
rsUser(db_User_Valid_Num)=Valid_Num
rsUser(db_User_Valid_Unit)=Valid_Unit
end if
end if
rsUser.update
rsUser.Close
set rsUser=nothing
call CloseConn_User()
response.redirect "Admin_User.asp"
end sub
sub DelUser()
if UserID="" then
FoundErr=True
ErrMsg=ErrMsg & "
请指定要删除的用户
"
exit sub
end if
if instr(UserID,",")>0 then
UserID=replace(UserID," ","")
sql="delete from " & db_User_Table & " where " & db_User_ID & " in (" & UserID & ")"
else
sql="delete from " & db_User_Table & " where " & db_User_ID & "=" & Clng(UserID)
end if
Conn_User.Execute sql
call CloseConn_User()
response.redirect ComeUrl
end sub
sub LockUser()
if UserID="" then
FoundErr=True
ErrMsg=ErrMsg & "
请选择要锁定的用户
"
exit sub
end if
if instr(UserID,",")>0 then
UserID=replace(UserID," ","")
sql="Update " & db_User_Table & " set " & db_User_LockUser & "=true where " & db_User_ID & " in (" & UserID & ")"
else
sql="Update " & db_User_Table & " set " & db_User_LockUser & "=true where " & db_User_ID & "=" & CLng(UserID)
end if
Conn_User.Execute sql
call CloseConn_User()
response.redirect ComeUrl
end sub
sub UnLockUser()
if UserID="" then
FoundErr=True
ErrMsg=ErrMsg & "
请指定要解锁的用户
"
exit sub
end if
if instr(UserID,",")>0 then
UserID=replace(UserID," ","")
sql="Update " & db_User_Table & " set " & db_User_LockUser & "=False where " & db_User_ID & " in (" & UserID & ")"
else
sql="Update " & db_User_Table & " set " & db_User_LockUser & "=False where " & db_User_ID & "=" & CLng(UserID)
end if
Conn_User.Execute sql
call CloseConn_User()
response.redirect ComeUrl
end sub
sub MoveUser()
dim msg
if UserID="" then
FoundErr=True
ErrMsg=ErrMsg & "
请指定要移动的用户
"
exit sub
end if
dim UserLevel
UserLevel=trim(request("UserLevel"))
if UserLevel="" then
FoundErr=True
ErrMsg=ErrMsg & "
请指定目标用户组
"
exit sub
else
UserLevel=Clng(UserLevel)
end if
if instr(UserID,",")>0 then
UserID=replace(UserID," ","")
if UserLevel=999 then
msg=" 已经成功将选定用户设为“普通注册用户”!并且按照你在[网站选项---用户选项]中的预设值给设定了这些用户的计费方式、初始点数、有效期等数据。"
msg=msg & "
计费方式:"
if ChargeType_9=1 then
msg=msg & "扣点数 初始点数:" & UserPoint_9 & "点"
else
msg=msg & "有效期 开始日期:" & formatdatetime(now(),2) & " 有 效 期:" & ValidDays_9 & "天"
end if
sql="Update " & db_User_Table & " set " & db_User_UserLevel & "=" & UserLevel & "," & db_User_ChargeType & "=" & ChargeType_9 & "," & db_User_UserPoint & "=" & UserPoint_9 & "," & db_User_BeginDate & "=#" & formatdatetime(now(),2) & "#," & db_User_Valid_Num & "=" & ValidDays_9 & "," & db_User_Valid_Unit & "=1 where " & db_User_ID & "=" & CLng(UserID)
end if
end if
Conn_User.Execute sql
call WriteSuccessMsg(msg)
end sub
sub DoUpdate()
dim BeginID,EndID,sqlUser,rsUser,trs
BeginID=trim(request("BeginID"))
EndID=trim(request("EndID"))
if BeginID="" then
FoundErr=True
ErrMsg=ErrMsg & "
请指定开始ID
"
else
BeginID=Clng(BeginID)
end if
if EndID="" then
FoundErr=True
ErrMsg=ErrMsg & "
请指定结束ID
"
else
EndID=Clng(EndID)
end if
if FoundErr=True then exit sub
Set rsUser=Server.CreateObject("Adodb.RecordSet")
sqlUser="select * from " & db_User_Table & " where " & db_User_ID & ">=" & BeginID & " and " & db_User_ID & "<=" & EndID
rsUser.Open sqlUser,Conn_User,1,3
do while not rsUser.eof
set trs=Conn.execute("select count(ArticleID) from Article where Editor='" & rsUser(db_User_Name) & "'")
if isNull(trs(0)) then
rsUser(db_User_ArticleCount)=0
else
rsUser(db_User_ArticleCount)=trs(0)
end if
set trs=Conn.execute("select count(ArticleID) from Article where Passed=True and Editor='" & rsUser(db_User_Name) & "'")
if isNull(trs(0)) then
rsUser(db_User_ArticleChecked)=0
else
rsUser(db_User_ArticleChecked)=trs(0)
end if
rsUser.update
rsUser.movenext
loop
rsUser.close
set rsUser=nothing
call WriteSuccessMsg("已经成功将用户数据进行了更新!")
end sub
%>