⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_user.asp

📁 淘客网上商店网站程序 淘客网上商店网站程序 淘客网上商店网站程序
💻 ASP
📖 第 1 页 / 共 4 页
字号:
		<td width="80" height="25" align="right"><strong>用户状态:</strong></td>
		<td colspan="3"><input type="radio" name="LockUser" value="0" <%if LockUser=0 then response.write "checked"%> />
		正常&nbsp;&nbsp; <input type="radio" name="LockUser" value="1" <%if LockUser=1 then response.write "checked"%> />
		锁定</td>
	</tr>
	<tr class="tdbg" > 
		<td height="40" colspan="4" align="center">
		<input name="Action" type="hidden" id="Action" value="Save<%=Action%>" /> 
		<%if Action="Modify" then%>
		<input name="Submit"   type="submit" id="Submit" value=" 保存修改结果 "> 
		<%else%>
		<input name="Submit"   type="submit" id="Submit" value=" 添加新用户 "> 
		<%end if%>
		<input name="UserID" type="hidden" id="UserID" value="<%=UserID%>" /></td>
	</tr>
</form>
</table>
<script language="JavaScript" type="text/javascript">
first("selectp","selectc","myform",0,0);
</script>
<%
End Sub

Sub AddMoney()
	UserID=Cl.GetClng(UserID)
	if UserID=0 then Cl.ShowErr("<br /><li>参数不足!</li>")
	Set rsUser=Cl.Execute_U("select * from " & Db.UserTable & " Where UserID=" & UserID)
	if rsUser.bof and rsUser.eof then
		rsUser.close:set rsUser=Nothing
		Cl.OutMsg 0,"找不到指定的用户!","-1"
	end if
%>
<table width="100%" align="center" border="0" cellspacing="1" cellpadding="0" class="border">
<form action="Admin_User.asp" method="post" name="myform" id="myform">
	<tr> 
		<td height="22" colspan="2" align="center" class='title'><b>用 户 续 费</b></td>
	</tr>
	<tr class="tdbg" > 
		<td width="40%"><b>用户名:</b></td>
		<td width="60%"><%=rsUser(Db.UserName)%></td>
	</tr>
	<tr class="tdbg" > 
		<td width="40%"><strong>用户级别:</strong></td>
		<td width="60%"><%=Cl.GetUserGroupName(rsUser(Db.UserGroupID))%></td>
	</tr>
	<tr class="tdbg" >
		<td><strong>计费方式:</strong></td>
		<td><%
		if rsUser(Db.ChargeType)=1 then
		response.write "扣"&Cl.Web_Setting(28)&":&nbsp;每阅读一篇收费文章,扣除相应"&Cl.Web_Setting(28)&"。"
		else
		response.write "有效期:在有效期内,用户可以任意阅读收费内容"
		end if
		%>
		<input name="ChargeType" type="hidden" id="ChargeType" value="<%=rsUser(Db.ChargeType)%>" />	  </td>
	</tr>
	<%if rsUser(Db.ChargeType)=1 then%>
	<tr class="tdbg" >
		<td><strong>目前的用户<%=Cl.Web_Setting(28)%>:</strong></td>
		<td><%=rsUser(Db.UserPoint)%> <%=Cl.Web_Setting(29)%></td>
	</tr>
	<tr class="tdbg" >
		<td><strong>追加<%=Cl.Web_Setting(28)%>:</strong></td>
		<td> <input name="UserPoint" type="text" id="UserPoint" value="100" size="10" maxlength="10" />
		<%=Cl.Web_Setting(29)%></td>
	</tr>
	<%else%>
	<tr class="tdbg" >
		<td><strong>目前的有效期限信息:</strong></td>
		<td><%
		ValidDays=rsUser(Db.ValidNum)
		response.write "开始计算日期" & rsUser(Db.BeginDate) & "&nbsp;&nbsp;&nbsp;&nbsp;有 效 期:" & rsUser(Db.ValidNum) & " 天"
		response.write "<br />"
		tmpDays=ValidDays-DateDiff("D",rsUser(Db.BeginDate),now())
		if tmpDays>=0 then
			response.write "尚有 <font color=blue>" & tmpDays & "</font> 天到期"
		else
			response.write "已经过期 <font color=#ff6600>" & abs(tmpDays) & "</font> 天"
		end if
		%></td>
	</tr>
	<tr class="tdbg" >
		<td><strong>追加天数:</strong><br />
		若目前用户尚未到期,则追加相应天数<br />
		若目前用户已经过了有效期,则有效期从续费之日起重新计数。</td>
		<td>
		<input name="ValidNum" type="text" id="ValidNum" value="1" size="10" maxlength="10" /> 
		</td>
	</tr>
	<%end if%>
	<tr class="tdbg" > 
		<td height="40" colspan="2" align="center"><input name="Action" type="hidden" id="Action" value="SaveAddMoney" /> 
		<input name="Submit"   type="submit" id="Submit" value=" 保存续费结果 " /> 
		<input name="UserID" type="hidden" id="UserID" value="<%=rsUser("UserID")%>" /></td>
	</tr>
</form>
</table>
<%
	rsUser.close : set rsUser=Nothing
End Sub

Sub UpdateUser()
	dim StrBeGinID,StrEndID
	if Trim(request("EndID")) <>"" then
		StrBeGinID=Cl.GetClng(request("EndID"))+1
		StrEndID=StrBeGinID+(Cl.GetClng(request("EndID"))-Cl.GetClng(request("BeginID")))
	else
		StrBeGinID=1
		StrEndID=1000
	end if
%>
<table width="100%" align="center" border="0" cellspacing="1" cellpadding="0" class="border">
<form action="Admin_User.asp" method="post" name="myform" id="myform">
	<tr align="center"> 
		<td height="22" colspan="2" class="title"><strong>更 新 用 户 数 据</strong></td>
	</tr>
	<tr class="tdbg"> 
		<td colspan="2"><p>说明:<br />
		1、本操作将重新计算用户各频道总的发表数(包括文章、软件、图片......)。<br />
		2、本操作可能将非常消耗服务器资源,而且更新时间很长,请仔细确认每一步操作后执行。</p>
		</td>
	</tr>
	<tr class="tdbg"> 
		<td height="25">开始用户ID:</td>
		<td height="25"><input name="BeginID" type="text" id="BeginID" value="<%=StrBeGinID%>" size="10" maxlength="8" />
		用户ID,可以填写您想从哪一个ID号开始进行修复</td>
	</tr>
	<tr class="tdbg"> 
		<td height="25">结束用户ID:</td>
		<td height="25"><input name="EndID" type="text" id="EndID" value="<%=StrEndID%>" size="10" maxlength="8" />
		将更新开始到结束ID之间的用户数据,之间的数值最好不要选择过大</td>
	</tr>
	<tr class="tdbg"> 
		<td height="25">&nbsp;</td>
		<td height="25"><input name="Submit" type="submit" id="Submit" value=" 更新用户数据 " /> 
		<input name="Action" type="hidden" id="Action" value="DoUpdate" /></td>
	</tr>
</form>
</table>
<%
End Sub

Sub SaveUserInfo()

	Dim Password,PwdConfirm,IsReName,OldUserName
	Dim MessageStr
	UserName	= Trim(request("UserName"))
	UserReName	= Trim(request("UserReName"))
	Password	= Trim(request("Password"))
	PwdConfirm	= Trim(request("PwdConfirm"))
	UserSex		= Cl.GetClng(Request("UserSex"))
	UserGroupID	= Cl.GetClng(request("UserGroupID"))
	UserEmail	= Trim(request("UserEmail"))
	Question	= Trim(request("Question"))
	Answer		= Trim(request("Answer"))
	'==========================
	UserHome	= Trim(request("UserHome"))
	UserQQ		= Trim(request("UserQQ"))
	UserICQ		= Trim(request("UserICQ"))
	UserMSN		= Trim(request("UserMSN"))
	UserAIM		= Trim(request("UserAIM"))
	UserYahoo	= Trim(request("UserYahoo"))
	UserUC		= Trim(request("UserUC"))
	'==========================
	CityInfo	= sRIM(Trim(request("Country"))) & "|||"&sRIM(Trim(request("Province")))
	CityInfo	= Server.HTMLencode(CityInfo & "|||"&sRIM(Trim(request("City"))))
	UserBirthDay= Trim(request("UserBirthDay"))
	IDCard		= Trim(request("IDCard"))
	UserWorking	= Trim(request("UserWorking"))
	SchoolAge	= Trim(request("SchoolAge"))
	UserHomePhone=Trim(request("UserHomePhone"))
	UserMobile	= Trim(request("UserMobile"))
	UserTelePhone=Trim(request("UserTelePhone"))
	ZipCode		= Trim(Request("ZipCode"))
	UserAddRess	= Trim(request("UserAddRess"))
	'==========================
	ChargeType	= Cl.GetClng(request("ChargeType"))
	BeginDate	= Trim(request("BeginDate"))
	ValidNum	= Cl.GetClng(request("ValidNum"))
	UserPoint	= Trim(request("UserPoint"))
	ElitePoint	= Trim(request("ElitePoint"))
	AdvPoint	= Trim(request("AdvPoint"))
	UserMoney	= Trim(request("UserMoney"))
	DataCount	= Cl.GetClng(request("DataCount"))
	UserReMark	= Trim(request("UserReMark"))
	LockUser	= Cl.GetClng(request("LockUser"))
	'==========================
	IsReName	= Trim(request("IsReName"))
	if Password<>PwdConfirm then
		FoundErr=true
		ErrMsg=ErrMsg & "<br /><li>密码和确认密码不一致</li>"
	end if
	if Question="" then
		FoundErr=true
		ErrMsg=ErrMsg & "<br /><li>密码提示问题不能为空</li>"
	end if
	if UserEmail="" then
		FoundErr=true
		ErrMsg=ErrMsg & "<br /><li>Email不能为空</li>"
	else
		if Cl.ChkEmail(UserEmail)=false then
			ErrMsg=ErrMsg & "<br /><li>您的Email有错误</li>"
			FoundErr=true
		end if
	end if
	if UserQQ<>"" then
		if not isnumeric(UserQQ) then
			ErrMsg=ErrMsg & "<br /><li>QQ号码只能是4-10位数字,您可以选择不输入。</li>"
			FoundErr=true
		end if
	end if
	if UserMSN<>"" then
		if Cl.ChkEmail(UserMSN)=false then
			ErrMsg=ErrMsg & "<br /><li>你的MSN有误。</li>"
			FoundErr=true
		end if
	end if
	if UserBirthDay<>"" then
		if Not IsDate(UserBirthDay) then
		FoundErr=True
		ErrMsg=ErrMsg & "<br /><li>出生日期错误!</li>"
		end if
	end if
	if IDCard<>"" then
		if Not Isnumeric(IDCard) or len(Cstr(IDCard))<15 then
			FoundErr=True
			ErrMsg=ErrMsg & "<br /><li>身份证号码错误!</li>"
		end if
	end If
	If UserGroupID=0 Then
		FoundErr=True
		ErrMsg=ErrMsg & "<br /><li>请指定用户所属用户组!</li>"
	End if
	if FoundErr=True then Cl.ShowErr(ErrMsg)
	if UserSex<>0 and UserSex<>1 then UserSex=1
	if LockUser<>0 then LockUser=1
	if ChargeType=0 then ChargeType=1
	if BeginDate="" then
		BeginDate=Date()
	else
		BeginDate=Cdate(BeginDate)
	end if
	if Not IsNumeric(UserPoint) then
		UserPoint = 0
	else
		UserPoint = FormatNumber(UserPoint,2)
	end if
	if Not IsNumeric(UserMoney) then
		UserMoney = 0
	else
		UserMoney = FormatNumber(UserMoney,2)
	end if
	if UserTableType = "Bbsxp" then
		UserIM	= UserQQ &"\"& UserIcq &"\"& UserUC &"\"& UserAim &"\"& UserMsn &"\"& UserYahoo
		if UserSex=0 then
			UserSex="female"
		else
			UserSex="male"
		end if
	else
		UserIM = Userhome &"|||"& UserQQ &"|||"& UserIcq &"|||"& UserMsn &"|||"& UserAim &"|||"& UserYahoo &"|||"& UserUC
	end if
	Set rsUser=Server.CreateObject("Adodb.RecordSet")
	Select Case Action
	Case "SaveModify"
		UserID		= Cl.GetClng(UserID)
		if UserID=0 then Cl.ShowErr("<br /><li>参数不足!</li>")
		sqlUser="Select * from " & Db.UserTable & " Where UserID=" & UserID
		OpenConn_U : rsUser.Open sqlUser,Conn_U,1,3
		if rsUser.bof and rsUser.eof then
			rsUser.close:set rsUser=Nothing
			Cl.ShowErr("<br /><li>找不到指定的用户!</li>")
		end if
		if Answer<>rsUser(Db.UserAnswer) then
			Answer=md5(Answer,16)
		end if
		if Password<>"" then
			if Cl.strLength(Password)>12 or Cl.strLength(Password)<6 then 
				Cl.OutMsg 0,"密码不能大于12小于6,如果你不想修改密码,请保持为空。","-1"
			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,"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -