<!--#include file="../ACT.Function.asp"-->
<!--#include file="../../act_inc/cls_pageview.asp"-->
<!--#include file="../../act_inc/md5.asp"-->
<!--#include file="ACT.UM.ASP"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>act_cms_会员管理</title>
<link href="../Images/css1/css.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript" src="../../editor/fckeditor/fckeditor.js"></script>
<script type='text/javascript' src='../../ACT_INC/WebTime/WdatePicker.js'></script>

<style type="text/css">
<!--
.STYLE1 {font-weight: bold}
-->
</style>
</head>
<body>
<%
	If Not ACTCMS.ChkAdmin() Then  Call Actcms.Alert("对不起，您没有操作权限！","")

	Dim ShowErr,Action,UserID,Sql,ValidDays,tmpDays,EdaysFlag,ModeID,TableName,IF_NULL,i
	Action = Request("Action")
	UserID = Request("UserID")
 ModeID = ACTCMS.ChkNumeric(Request("ModeID"))
 if ModeID=0 or ModeID="" Then ModeID=1

%>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
  <tr>
    <td colspan="2" align="center"  class="bg_tr"><strong>会员系统----用户管理</strong></td>
  </tr>
  <tr>
    <td width="9%" align="right"><strong>用户选项：</strong></td>
    <td><span class="STYLE1"><A href="?Action=UserSearch&ModeID=<%=ModeID%>">搜索用户</A>┆<A href="?ModeID=<%=ModeID%>">所有用户</A>┆<A href="?UserSearch=1&ModeID=<%=ModeID%>">被锁住的用户</A>┆<A href="?UserSearch=2&ModeID=<%=ModeID%>">待审批会员</A>┆<A href="?UserSearch=3&ModeID=<%=ModeID%>">待邮件验证</A>┆<A href="?UserSearch=4&ModeID=<%=ModeID%>">24小时内登录</A>┆<A href="?UserSearch=5&ModeID=<%=ModeID%>">24小时内注册</A></span></td>
  </tr>
</table><% 
	 TableName=ACTCMS.actexe("select ModeTable from ModeUser_Act where ModeID ="&ModeID&"")(0)
	Select Case Action
			Case "Update"
				Call UpdateUser()
			Case "DoUpdate"
				Call DoUpdate()
			Case "Del"
				Call Del()
			Case "Lock"
				Call Locked()
			Case "UnLock"
				Call UnLocked()
			Case "Move"
				Call MoveUser()
			Case "UserSearch"
				Call UserSearch()
			Case "AddMoneys"
				Call AddMoneys()
			Case "xf"
				Call xf()
			Case "Edit"
				Call Edit()
			Case "SaveEdit"
				Call SaveEdit()
			Case Else
				Call Main()
	End Select
		
	

			sub SaveEdit()
			dim UserID,UserName,RealName,Password,RPassWord,Question,Answer,Sex,Email,HomePage,QQ,MSN,GroupID,locked,DataCount,ChargeType,Point,Moneys,startdate,Edays,province
			dim rsUser,sqlUser,founderr
			dim OfficeTel,Address
			dim IDCard,BirthDay,City,Zip
			Dim SchoolAge,UserWorking,HomeTel,Mobile
			Action=Trim(request("Action"))
			UserID=actcms.ChkNumeric(request("UserID"))
			if UserID=0 then
				FoundErr=True
				Call ACTCMS.Alert("参数不足！","")
				exit sub
			end if
			Password  = Trim(request("Password"))
			RPassWord= Trim(request("RPassWord"))
			Question  = Trim(request("Question"))
			Answer    = Trim(request("Answer"))
			Sex       = Trim(Request("Sex"))
			Email     = Trim(request("Email"))
			HomePage  = Trim(request("HomePage"))
			QQ        = Trim(request("QQ"))
			MSN       = Trim(request("MSN"))
			GroupID   = Trim(request("GroupID"))
			locked    = Trim(request("locked"))
			Moneys=actcms.ChkNumeric(Trim(request("Moneys")))
			province= Request("prov")
			city=     Request("city")
			UserName=Trim(request("UserName"))
			RealName=Trim(request("RealName"))
			Address=Trim(request("Address"))
			IDCard=Trim(request("IDCard"))
			BirthDay=Trim(request("BirthDay"))
			Zip=Trim(Request("Zip"))
			HomeTel=Trim(request("HomeTel"))
			Mobile=Trim(request("Mobile"))
			IF_NULL=U_M.Act_U_MX_Arr(ModeID)
			If IsArray(IF_NULL) Then
			For I=0 To Ubound(IF_NULL,2)
			 If IF_NULL(2,I)=0 And Trim(ACTCMS.S(IF_NULL(0,I)))="" Then  Call  ACTCMS.ALERT(IF_NULL(1,I)&"不能为空","")
			Next
			End If
			Set rsUser=Server.CreateObject("Adodb.RecordSet")
			sqlUser="select * from "&TableName&" where UserID=" & UserID
			rsUser.Open sqlUser,Conn,1,3
			if rsUser.bof and rsUser.eof then
				FoundErr=True
				Call ACTCMS.Alert("找不到指定的用户！","")
				rsUser.close:set rsUser=Nothing
				exit sub
			end if
			if Password<>"" then
				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
					Call ACTCMS.Alert("密码中含有非法字符，如果你不想修改密码，请保持为空。","")
					founderr=true
				end if
			end if
			if Password<>RPassWord then
				founderr=true
				Call ACTCMS.Alert("密码和确认密码不一致","")
			end if
			if Sex="" then
				founderr=true
				Call ACTCMS.Alert("性别不能为空","")
			end if
			if Email<>"" and  ACTCMS.IsValidEmail(Email)=false then
					Call ACTCMS.Alert("您的Email有错误","")
					founderr=true
			end if
			
		
			if GroupID="" then
				FoundErr=True
				Call ACTCMS.Alert("请指定用户级别！","")
			else
				GroupID=CLng(GroupID)
			end if
			if locked<>0 then locked=1
			if ChargeType="" then
				ChargeType=1
			else
				ChargeType=Clng(ChargeType)
			end if
			if startdate="" then
				startdate=Now()
			else
				startdate=Cdate(startdate)
			end if
			
			if BirthDay<>"" then
				if Not IsDate(BirthDay) then
				FoundErr=True
				Call ACTCMS.Alert("出生日期错误！","")
				end if
			end if
			if founderr=true then exit sub
			rsUser("RealName")=RealName
			if Password<>"" then
				rsUser("Password")=md5(Password)
			end if
			
			rsUser("Question")=Question
			if Answer<>"" then
				rsUser("Answer")=Answer
			end if
			rsUser("Email")=Email
			rsUser("Sex")=Sex
			rsUser("GroupID")=GroupID
			rsUser("locked")=locked
			rsUser("Moneys")=Moneys
			rsUser("Birthday")=Birthday
			rsUser("province")=province
			rsUser("City")=City
			If IsArray(IF_NULL) Then
				For I=0 To Ubound(IF_NULL,2)
					If IF_NULL(3,I)="NumberType" Then 
					   rsUser("" & IF_NULL(0,I) & "" )= ACTCMS.ChkNumeric(ACTCMS.S(IF_NULL(0,I)))
					ElseIf IF_NULL(3,I)="DateType" Then 
						If IsDate(ACTCMS.S(IF_NULL(0,I)))=False Then 
							rsUser("" & IF_NULL(0,I) & "")= Now()
						Else 
							rsUser("" & IF_NULL(0,I) & "")=ACTCMS.S(IF_NULL(0,I))
						End If 
					Else 
						rsUser("" & IF_NULL(0,I) & "")=ACTCMS.S(IF_NULL(0,I))
					End If 
				Next
			End If
			rsUser.update
			rsUser.Close
			set rsUser=Nothing
			Call ACTCMS.Alert("恭喜您，修改成功！请按确定返回！","User_Admin.asp?ModeID="&ModeID&"")
		end sub
	
	

		Sub xf()
			dim UserID,rsUser,sqlUser,Reason
			Dim FoundErr,Moneys:Moneys=Request("Moneys")
			Dim Score:Score=ACTCMS.ChkNumeric(Request("Score"))
			If Not IsNumeric(Moneys) Then 
				FoundErr=True
				ShowErr=ShowErr & "<br><li>资金有误！</li>"
			End If
			
			If Not IsNumeric(Score) Then 
				FoundErr=True
				ShowErr=ShowErr & "<br><li>点数有误！</li>"
			End If
			Action=Trim(request("Action"))
			UserID=actcms.ChkNumeric(request("UserID"))
			if UserID=0 then
				FoundErr=True
				ShowErr=ShowErr & "<br><li>参数不足！</li>"
			end if
			Reason=Request("Reason")
		
			
		    if Reason="" Then
			  FoundErr=True
			  ShowErr=ShowErr & " <br><li>请输入操作原因</li>"
			end if
			if founderr=true then Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl="&"&Title=1"&"&Title=1"):exit sub
			Set rsUser=Server.CreateObject("Adodb.RecordSet")
			sqlUser="select * from "&TableName&" where UserID=" & UserID
			rsUser.Open sqlUser,Conn,1,3
			if rsUser.bof and rsUser.eof then
				FoundErr=True
				ShowErr=ShowErr & "<br><li>找不到指定的用户！</li>"
				rsUser.close:set rsUser=Nothing
				exit sub
			end if

			rsUser("Moneys")=Moneys
			rsUser("Score")=Score

			rsUser.update
			 
			' Call ACTCMS.Logs(0,0,rsUser("UserName"),1,Point,Session("AdminName"),Reason)
			rsUser.Close:set rsUser=Nothing
			ShowErr = "<li>操作成功</li>"
			Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl=User/User_Admin.asp")
			Response.End
		end sub
		
		
			Sub DoUpdate()
			response.Write "DoUpdate"
	
			End Sub
	Sub Del()'删除
		IF UserID = "" Then
			ShowErr = "<li>请指定要删除的用户</li>"
			Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl="&"&Title=1")
			Response.End
		End IF
		If instr(UserID,",")>0 then
			UserID=replace(UserID," ","")
			Sql="delete from "&TableName&" where UserID in (" & UserID & ") "
		Else
			Sql="delete from "&TableName&" where UserID=" & actcms.ChkNumeric(UserID) & " "
		End if
		Conn.Execute sql
		ShowErr = "<li>用户删除成功！</li>"
		Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl=User/User_Admin.asp")
		Response.End
    End Sub
	Sub Locked()'锁定
		IF UserID = "" Then
			ShowErr = "<li>请指定要锁定的用户</li>"
			Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl="&"&Title=1"&"&Title=1")
			Response.End
		End IF
		If instr(UserID,",")>0 then
			UserID=replace(UserID," ","")
			Sql="Update "&TableName&" set locked=1 where UserID in (" & UserID & ")"
		Else
			Sql="Update "&TableName&" set locked=1 where UserID=" & actcms.ChkNumeric(UserID)
		End if
		Conn.Execute sql:Set Conn=nothing
		ShowErr = "<li>用户锁定成功！</li>"
		Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl=User/User_Admin.asp?ModeID="&ModeID&"")
		Response.End
    End Sub
	Sub UnLocked()'解锁
		IF UserID = "" Then
			ShowErr = "<li>请指定要解锁的用户</li>"
			Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl="&"&Title=1"&"&Title=1")
			Response.End
		End IF
		If instr(UserID,",")>0 then
			UserID=replace(UserID," ","")
			Sql="Update "&TableName&" set locked=0 where UserID in (" & UserID & ")"
		Else
			Sql="Update "&TableName&" set locked=0 where UserID=" & actcms.ChkNumeric(UserID)
		End if
		Conn.Execute sql:Set Conn=nothing
		ShowErr = "<li>用户解锁成功！</li>"
		Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl=User/User_Admin.asp?ModeID="&ModeID&"")
		Response.End
    End Sub
	Sub MoveUser()'移动
	Dim GroupID, RsGroup
		GroupID = actcms.ChkNumeric(Request("GroupID"))
		IF UserID = "" Then
			ShowErr = "<li>请指定要移动的用户</li>"
			Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl="&"&Title=1"&"&Title=1")
			Response.End
		End IF
		IF GroupID = 0 Then Response.Write "目标用户组不存在":Response.end
		UserID=replace(UserID," ","")
		Set RsGroup=Conn.Execute("Select GroupName,ChargeType,ValidDays,GroupPoint From Group_ACT Where GroupID="&GroupID&"")
		If Not (RsGroup.Bof and RsGroup.Eof) then
			IF IsSqlDataBase = 1 Then
				Conn.Execute("Update "&TableName&" set GroupID=" & GroupID & ",ChargeType =" & RsGroup(1) & ",Point =" &  RsGroup(3) & ",startdate ='" & formatdatetime(now(),2) & "',EDays=" & RsGroup(2) & " where UserID in (" & UserID & ")")
			Else
				Conn.Execute("Update "&TableName&" set GroupID=" & GroupID & ",ChargeType =" & RsGroup(1) & ",Point =" &  RsGroup(3) & ",startdate =#" & formatdatetime(now(),2) & "#,EDays=" & RsGroup(2) & " where UserID in (" & UserID & ")")
			End IF
		Else
			ShowErr = "<li>请指定目标用户组</li>"
			Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl="&"&Title=1")
			Response.End
			Exit Sub
		End if
		ShowErr = "<li>已经成功将选定用户设为“<font color=red>"&RsGroup(0)&"</font>”！<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;并且用户已继承“<font color=red>"&RsGroup(0)&"</font>”的权限。</li><br><li>计费方式："
		If RsGroup(1)=1 Then
				ShowErr = ShowErr & "扣点数</li><li>初始点数：<font color=red>" & RsGroup(3) & "</font>点</li>"
		ElseIF RsGroup(1)=2 Then
				ShowErr = ShowErr & "有效期</li><li>开始日期：<font color=red>" & Formatdatetime(now(),2) & "</font></li><br><li>有 效 期：<font color=red>" & RsGroup(2) & "</font>天</li>"
		ElseIF RsGroup(1)=3 Then
				ShowErr = ShowErr & "有效期</li><li>开始日期：" & Formatdatetime(now(),2) & "</li><br><li>有 效 期：无限期(永不过期)</li>"
		End If
		ShowErr = ShowErr&"</li>"
		RsGroup.Close : Set RsGroup=Nothing
		Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl=User/User_Admin.asp?ModeID="&ModeID&"")
		Response.End
    End Sub
 Sub Main
	Dim strLocalUrl,ValidDays,tmpDays
	strLocalUrl = request.ServerVariables("SCRIPT_NAME")
	Dim intPageNow
	intPageNow = request.QueryString("page")
	Dim intPageSize, strPageInfo
	intPageSize = 20
	Dim arrRecordInfo, i
	Dim sql, sqlCount,Sqls,UserSearch,pages,StrGuide
	UserSearch = Request("UserSearch")
	pages = "UserSearch="&Request("UserSearch")&"&page"
	Select Case UserSearch
		Case 1
			Sqls = "Where Locked = 1 "
			StrGuide = "所有被锁住的用户"
		Case 2
			Sqls = " Where GroupID = 2  "
			StrGuide = "待管理员认证用户"
		Case 3
			Sqls = " Where GroupID = 1  "
			StrGuide = "待邮件验证的用户"
		Case 4
			Sqls = " where datediff('h',LoginTime," & NowString & ")<25 "
			StrGuide = "最近24小时内登录的用户"
		Case 5
			Sqls = " where datediff('h',RegDate," & NowString & ")<25 "
			StrGuide = "最近24小时内注册的用户"
		Case 6
			Sqls = " where GroupID = "&  actcms.ChkNumeric(Request.QueryString("GroupID"))&" "
			StrGuide = "查询结果"
			pages = "UserSearch="&Request.QueryString("UserSearch")&"&GroupID="&actcms.ChkNumeric(Request.QueryString("GroupID"))&"&page"
		Case 7
			StrGuide = "查询结果"
			pages = "UserSearch="&Request("UserSearch")&"&Email="&Request("Email")&"&usernamechk="&Request("usernamechk")&"&username="&Request("username")&"&GroupID="&actcms.ChkNumeric(Request("GroupID"))&"&page"
			UserID =actcms.ChkNumeric(UserID)
					if UserID>0 then
						Sqls = " UserID="&UserID&" "
					else 
						Sqls=""
						if request("username")<>"" then
							if request("usernamechk")="yes" then
								Sqls=Sqls & " username='"&request("username")&"' "
							else
								Sqls=Sqls &" username like '%"&request("username")&"%' "
							end if
						end if
						if cint(request("GroupID"))>0 then
							if Sqls="" then
								Sqls=Sqls & " GroupID="&request("GroupID")&" "
							else
								Sqls=Sqls & " and GroupID="&request("GroupID")&" "
							end if
						end if	
				end if	
			
					if request("Email")<>"" then
							if Sqls="" then
								Sqls=Sqls & " Email like '%"&request("Email")&"%'"
							else
								Sqls=Sqls & " and Email like '%"&request("Email")&"%'"
							end if
						end if
				if Sqls <> "" then Sqls = " where "&Sqls&"  "			
		Case Else
			pages = "page"
			StrGuide = "所有用户"
	End Select
	sql = "SELECT [UserID], [GroupID], [UserName],[Locked], [Loginip],[LoginNumber],[LoginTime]" & _
		" FROM ["&TableName&"]" &Sqls& _
		"ORDER BY [UserID] DESC"
	sqlCount = "SELECT Count([UserID])" & _
			" FROM ["&TableName&"]"&Sqls
		Dim clsRecordInfo
		Set clsRecordInfo = New Cls_PageView
			clsRecordInfo.intRecordCount = 2816
			clsRecordInfo.strSqlCount = sqlCount
			clsRecordInfo.strSql = sql
			clsRecordInfo.intPageSize = intPageSize
			clsRecordInfo.intPageNow = intPageNow
			clsRecordInfo.strPageUrl = strLocalUrl
			clsRecordInfo.strPageVar = pages
		clsRecordInfo.objConn = Conn		
		arrRecordInfo = clsRecordInfo.arrRecordInfo
		strPageInfo = clsRecordInfo.strPageInfo
		Set clsRecordInfo = nothing
 %> 
 <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
    <form name="form2" method="post" action="User_Admin.asp"><tr>
      <td align="center" class="bg_tr">快速搜索</td>
    </tr>
    <tr>
      <td><strong>用户名：</strong>
      <input name="username" type="text" id="username" size="20">
       <label for="usernamechk"><strong>用户名完整匹配</strong>
       <input name="usernamechk" type="checkbox" id="usernamechk" value="yes" checked></label>
       <strong>用户组：</strong>
      <select size="1" name="GroupID">
        <option value="0" selected>全部</option>
        <%=GroupOption(3)%>
      </select>
		   <input name="UserSearch" type="hidden" id="UserSearch" value="7">
		  <input name=Submit class="act_btn" type=button value="  快速搜索   " onclick=CheckInfo1()></td>
    </tr>
 </form> </table>

  <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
 <form name="Userform" method="Post" action="User_Admin.asp" onSubmit="return confirm('确定要执行选定的操作吗？');">
	<tr>
      <td colspan="12" class="bg_tr">您现在的位置：<a href="?"  ><font class="bg_tr">管理首页</font>  </a>&gt;&gt; 注册用户管理&gt;&gt;<%= StrGuide %></td>
    </tr>
    <tr>
      <td  align="center" nowrap><STRONG>选中</STRONG></td>
      <td  align="center" nowrap><STRONG>ID</STRONG></td>
      <td  align="center" nowrap><STRONG>用户名</STRONG></td>
      <td  align="center" ><STRONG>所属用户组</STRONG></td>
      <td align="center" nowrap><STRONG>最后登录IP</STRONG></td>
      <td  align="center"><STRONG>最后登录时间</STRONG></td>
      <td  align="center" nowrap><STRONG>登录次数</STRONG></td>
      <td  align="center" nowrap><STRONG>状态</STRONG></td>
      <td  colspan="2" align="center" nowrap><strong>管理操作</strong></td>
      <td align="center" nowrap><strong>删除</strong></td>
    </tr>
	 <%
		Dim bgColor
		If IsArray(arrRecordInfo) Then
			For i = 0 to UBound(arrRecordInfo, 2)
	%>
    <tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
      <td align="center" ><input name="UserID" type="checkbox" id="UserID" value="<%= arrRecordInfo(0,i) %>"></td>
      <td align="center" ><%= arrRecordInfo(0,i) %></td>
      <td align="center" ><%=Replace(arrRecordInfo(2,i),request("username"),"<font color=""RED"">"&request("username")&"</font>") %></td>
      <td align="center" ><%=GetGroupName(arrRecordInfo(1,i)) %></td>
      <td align="center" ><%=arrRecordInfo(4,i)%></td>
      <td align="center" ><%=arrRecordInfo(6,i)%></td>
      <td align="center" ><%=arrRecordInfo(5,i)%></td>
      <td align="center" ><% IF arrRecordInfo(3,i) = 0 Then Response.Write "正常" Else Response.Write "<font color=red>已锁定</font>" %></td>
      <td colspan="2"  align="center">
	
	<select name="page" size="1" onChange="javascript:window.location=this.options[this.selectedIndex].value;">
      <option value="" >请选择</option>
      <option value="?Action=Edit&UserID=<%=arrRecordInfo(0,i)  %>&ModeID=<%=ModeID%>" >修改</option>
	 <% IF arrRecordInfo(3,i) = 0 Then %>
	   <option value="?Action=Lock&UserID=<%= arrRecordInfo(0,i) %>&ModeID=<%=ModeID%>">锁定</option>
	 <%  Else%>
	 <option value="?Action=UnLock&UserID=<%= arrRecordInfo(0,i) %>&ModeID=<%=ModeID%>">解锁</option>
	<%End If  %>
	 <option value="?Action=AddMoneys&UserID=<%= arrRecordInfo(0,i) %>&ModeID=<%=ModeID%>">续费</option>
    </select></td>
      <td  align="center"><a href="?Action=Del&UserID=<%= arrRecordInfo(0,i) %>&ModeID=<%=ModeID%>" onClick="return confirm('确认删除此用户吗?')">删除</a></td>
    </tr>
	<% 
	Next
	End If
	%>
    <tr >
      <td height="25" colspan="12"><label for="chkAll">&nbsp;
        <input name="ChkAll" type="checkbox" id="ChkAll" onClick="CheckAll(this.form)" value="checkbox">选中本页显示的所有用户</label>
        <strong>操作：</strong> 
					 <label for="Del"><input ID="Del" name="Action" type="radio" value="Del" checked onClick="document.Userform.GroupID.disabled=true">
					  删除&nbsp;&nbsp;&nbsp;&nbsp;</label>
					  <label for="Lock"><input ID="Lock" name="Action" type="radio" value="Lock" onClick="document.Userform.GroupID.disabled=true">
					  锁定 &nbsp;&nbsp;&nbsp;</label>
					  <label for="UnLock"><input ID="UnLock" name="Action" type="radio" value="UnLock" onClick="document.Userform.GroupID.disabled=true">
					  解锁 &nbsp;&nbsp;&nbsp; </label>
					  <label for="Move"><input ID="Move" name="Action" type="radio" value="Move" onClick="document.Userform.GroupID.disabled=false">
					  移动到</label>
					  <select name="GroupID" id="GroupID" disabled>
					  <%=GroupOption(3)%>
					  </select>
				&nbsp;&nbsp;
	  <input type="submit" name="Submit"  class="act_btn"  value=" 执&nbsp;&nbsp;行 " >	  </td>
    </tr>
    <tr >
      <td height="25" colspan="12" align="center"><%= strPageInfo%></td>
    </tr>
  </form></table>

<script language="javascript">

		function CheckAll(form)
		  {  
		 for (var i=0;i<form.elements.length;i++)  
			{  
			   var e = Userform.elements[i];  
			   if (e.name != 'ChkAll'&&e.type=="checkbox")  
			   e.checked = Userform.ChkAll.checked;  
		   }  
	  }
function overColor(Obj)
{
	var elements=Obj.childNodes;
	for(var i=0;i<elements.length;i++)
	{
		elements[i].className="tdbg1"
		Obj.bgColor="";
	}
	
}
function outColor(Obj)
{
	var elements=Obj.childNodes;
	for(var i=0;i<elements.length;i++)
	{
		elements[i].className="tdbg";
		Obj.bgColor="";
	}
}


		</script>
<% 
 End Sub
	Public Function GetGroupName(GroupID)
	 On Error Resume Next
	 Dim Grs
	 Set Grs=ACTCMS.ACTEXE("Select GroupSetting From Group_ACT Where GroupID=" & GroupID)
	 If Not Grs.eof Then 
		GetGroupName = Split(Grs(0),"^@$@^")(0)
	 Else
		GetGroupName="<font color=red>该用户组已被删除</font>"
	 End If 
	End Function
	

	Public Function GroupOption(Selected)
	 Dim RSObj,GroupName:Set RSObj=Server.CreateObject("Adodb.Recordset")
	    RSObj.Open "Select GroupID,GroupSetting From Group_ACT",Conn,1,1
	  	Do While Not RSObj.Eof
		   GroupName=Split(RSObj(1),"^@$@^")(0)
		   IF Selected=RSObj(0) Then
			GroupOption=GroupOption & "<option value=""" & RSObj(0) & """ Selected>" &GroupName & "</option>"
		   Else
			GroupOption=GroupOption & "<option value=""" & RSObj(0) & """>" & GroupName & "</option>"
		   End If
		RSObj.MoveNext
		Loop
	  RSObj.Close:Set RSObj=Nothing
	End Function	
	
Sub UpdateUser()
	
%>
<form name="form1" method="post" action="User_Admin.asp">
  <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
    <tr>
      <td colspan="2" align="center"  class="bg_tr"><strong>会员系统-更 新 用 户 数 据</strong></td>
    </tr>
    <tr>
      <td colspan="2"><p>说明：<BR>
        1、本操作将重新计算用户各频道总的发表数(包括文章、软件、图片......)。<BR>
      2、本操作可能将非常消耗服务器资源，而且更新时间很长，请仔细确认每一步操作后执行。</p></td>
    </tr>
    <tr>
      <td width="13%" align="right"><strong>开始用户ID：</strong></td>
      <td width="87%">
	  <input  name="StartID" type="text" id="StartID" value="1" onKeyUp="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">
	  </td>
    </tr>
    <tr>
      <td align="right"><strong>结束用户ID：</strong></td>
      <td>
	  <input name="EndID" type="text" id="EndID" value="1000" onKeyUp="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">
	  </td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td>
	  <input name="Action" type="hidden" id="Action" value="DoUpdate">
	  <input type=button onclick=CheckInfo()  name=Submit value="&nbsp;更新用户数据&nbsp;" />&nbsp;&nbsp;</td>
    </tr>
  </table>
</form>
<SCRIPT language=javascript>
		function CheckInfo()
		{
		  if(document.form1.StartID.value=="" || isNaN(document.form1.StartID.value) || document.form1.StartID.value<1)
			{
			  ACTCMS.Alert("开始ID不能为空,并且只能为数字,同时不能小于1");
			  document.form1.StartID.focus();
			  return false;
			}
		  if(document.form1.EndID.value=="" || isNaN(document.form1.EndID.value) || document.form1.EndID.value<1)
			{
			  ACTCMS.Alert("结束ID不能为空,并且只能为数字,同时不能小于1！");
			  document.form1.EndID.focus();
			  return false;
			}		form1.Submit.value="正在提交数据,请稍等...";
		form1.Submit.disabled=true;	
	    form1.submit();
        return true;
		}
		</script>

<%
	End Sub 
	Sub UserSearch() %>
		<form name="form2" method="post" action="User_Admin.asp">
		<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1"  class="table">
		<tr>
			<td height="25" colspan="2" align="center" class="bg_tr"><strong>高级查询</strong></td>
		</tr>
		<tr>
			<td width="20%" align="right"><strong>用户ID：</strong></td>
			<td width="80%"><input size="45" name="userid" type="text"></td>
		</tr>
		<tr>
			<td width="20%" align="right"><strong>用户名：</strong></td>
			<td width="80%"><input size="45" name="username" type="text"><label for="usernamechk1">&nbsp;<input type="checkbox" id="usernamechk1" name="usernamechk" value="yes" checked>用户名完整匹配</label></td>
		</tr>
		<tr>
			<td width="20%" align="right"><strong>用户组：</strong></td>
			<td width="80%">
			<select size="1" name="GroupID">
			<option value="0" selected>全部</option>
			<%=GroupOption(3)%>
			</select>		  </td>
		</tr>
		<tr>
			<td width="20%" align="right"><strong>Email包含：</strong></td>
			<td width="80%"><input size="45" name="Email" type=text></td>
		</tr>
		<tr>
		  <td>&nbsp;</td>
		  <td>
		  <input name="UserSearch" type="hidden" id="UserSearch" value="7">
		  <input name=Submit  class="act_btn"  type=button value="   搜  索   " onclick=CheckInfo1()></td>
		  </tr>
		</table>
		</form>	
		<%End Sub
 CloseConn %>
 <script language="javascript">	
	function CheckInfo1()
		{
		form2.Submit.value="正在提交数据,请稍等...";
		form2.Submit.disabled=true;	
	    form2.submit();	
		}
	</script>
	<% Sub AddMoneys()
		Dim rsUser,sqlUser,tmpDays
		UserID=actcms.ChkNumeric(Request.QueryString("UserID"))
		If UserID=0 then Response.Redirect("../Error.asp?Errs="&Server.URLEncode("<li>参数不足!</li>")&"&ErrorUrl=User/User_Admin.asp?ModeID="&ModeID&""):Response.End
		Set rsUser=Conn.Execute("select * from "&TableName&" where UserID=" & UserID)
		If rsUser.bof and rsUser.eof then
			rsUser.close:set rsUser=Nothing
			Response.Redirect("../Error.asp?Errs="&Server.URLEncode("<li>找不到指定的用户！</li>")&"&ErrorUrl=User/User_Admin.asp?ModeID="&ModeID&"")	
			Exit sub
		End if

	%>
	
	
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1"  class="table">
	<form name="form3" method="post" action="?">
		<tr>
			<td height="25" colspan="2" align="center" class="bg_tr"><strong>用 户 续 费</strong></td>
		</tr>
		<tr>
			<td width="20%" align="right"><strong>用户名：</strong></td>
			<td width="80%"><%=rsUser("UserName")%></td>
		</tr>
		<tr>
			<td width="20%" align="right"><strong>用户级别：</strong></td>
			<td width="80%"><%=GetGroupName(rsUser("GroupID"))%></td>
		</tr>

		<tr>
			<td width="20%" align="right"><strong>可用资金：</strong></td>
			<td width="80%">
			
			  <input name="Moneys" type="text" id="Moneys" value="<%=rsUser("Moneys")%>" size="10" maxlength="10"></td>
		</tr>

			  <td height="60" align="right"><strong>会员点数：</strong><br></td>
			  <td>
			  <input name="Score" type="text" id="Score" value="<%=rsUser("Score")%>" size="10" maxlength="10">
			  
			  </td>
	</tr>
		<tr>
          <td align="right"><STRONG>请输入原因：</STRONG></td>
		  <td><input name="Reason" type="text" id="Reason" value="" size="55"></td>
    </tr>
		<tr>
          <td align="right">&nbsp;</td>
		  
		  <td>
		   <input name="Action" type="hidden" id="Action" value="xf">
		   <input name="UserID" type="hidden" id="UserID" value="<%= rsUser("UserID") %>">
		   <input type="submit" name="Submit2" class="act_btn" value=" 保存 ">
	      <input type="reset" name="Submit3"  class="act_btn" value=" 重置 "></td>
    </tr>
	</form>
	  </table>    
	
<%End Sub 

		Sub Edit()
		
		dim rsUser,sqlUser,sSex,ChargeType,UserID
			UserID=actcms.ChkNumeric(ACTCMS.S("UserID"))
			if UserID=0 then call ACTCMS.Alert("非法提交参数!","")

			Set rsUser=Server.CreateObject("Adodb.RecordSet")
			sqlUser="select * from "&TableName&" where UserID=" & UserID
			rsUser.Open sqlUser,Conn,1,3
	
		
  %>
  <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
  <FORM name="tcjdxr" action="?ModeID=<%=ModeID%>" method="post">
    <TR class="bg_tr">
      <TD height="22" colspan="4" align="center"><span style="margin-top:10px;text-align:center;font-weight:bold">修改注册用户信息</span></TD>
    </TR>
    <TR>
      <TD width="80" height="25" align="right"><strong>用户名称：</strong></TD>
      <TD><Input Name="UserName" type=text size=30 Value="<%=rsUser("UserName")%>" readonly>
          <font color="red">*</font></TD>
      <TD width="80" height="25" align="right"><strong>真实姓名：</strong></TD>
      <TD><Input Name="RealName" type=text size=30 Value="<%=rsUser("realName")%>"></TD>
    </TR>
    <TR>
      <TD width="80" height="25" align="right"><strong>用户密码：</strong></TD>
      <TD height="25"><INPUT name="PassWord" type="password" id="PassWord" value="" size="30" maxLength="12">
          <br>
        <font color="#FF6600">如果不想修改，请留空</font></TD>
      <TD width="80" height="25" align="right"><strong>重复密码：</strong></TD>
      <TD height="25"><INPUT name="RPassWord" type="password" id="RPassWord" value="" size="30" maxLength="12">
          <br>
        <font color="#FF6600">如果不想修改，请留空</font></TD>
    </TR>
    <TR >
      <TD width="80" height="25" align="right"><strong>密码问题：</strong></TD>
      <TD><INPUT type=text maxLength=50 size=30 name="Question" value="<%=rsUser("Question")%>">
          <font color="#FF6600">*</font> </TD>
      <TD width="80" height="25" align="right"><strong>问题答案：</strong></TD>
      <TD><INPUT type=text maxLength=20 size=30 name="Answer" value="<%=rsUser("Answer")%>">
          <br>
        <font color="#FF6600">如果不想修改，请留空</font> </TD>
    </TR>
    <TR>
      <TD width="80" height="25" align="right" ><strong>用户性别：</strong></TD>
      <TD height="25"><INPUT type=radio value="0" name=sex  <%if rsUser("Sex")="0" then Response.Write "CHECKED"%>>
        男 &nbsp;&nbsp;
        <INPUT type=radio value="1" name=sex <%if rsUser("Sex")="1" then Response.Write "CHECKED"%>>
        女</TD>
      <TD width="80" height="25" align="right"><strong>用户等级：</strong></TD>
      <TD><select name="GroupID" id="GroupID">
        <%=GroupOption(rsUser("GroupID"))%>
      </select></TD>
    </TR>
    <TR>
      <TD width="80" height="25" align="right"><strong>用户邮箱：</strong></TD>
      <TD><Input Name="Email" type=text size=30 Value="<%=rsUser("Email")%>">
          <br>
        <a href="mailto:<%=rsUser("Email")%>"></a></TD>
      <TD width="80" height="25" align="right"></TD>
      <TD></TD>
    </TR>



	<TR>
	  <TD height="25" align="right"><strong><font color=red>扩展信息：</font></strong></TD>
	  <TD ColSpan=3 align="left">
	  <table width="100%" border="0" cellpadding="0" cellspacing="0" >
       <%Call  U_M.ACT_MXEdit(ModeID,UserID) %>
      </table>
	  </TD>
    </TR>
	<TR>
      <TD width="80" height="25" align="right"><strong>所在省市：</strong></TD>
      <TD ColSpan=3><select name="prov" onChange="selectcityarea('prov','city','tcjdxr');" style="width:110">
        <%if rsUser("Province")<>"" then%>
        <option  value="<%=rsUser("Province")%>" selected="selected"><%=rsUser("Province")%></option>
        <%else%>
        <option  value="" selected="selected">==请选择省份==</option>
        <%end if%>
      </select>
          <select name="city" style="width:110">
            <%if rsUser("city")<>"" then%>
            <option  value="<%=rsUser("city")%>" selected="selected"><%=rsUser("city")%></option>
            <%else%>
            <option  value="" selected="selected">==请选择城市==</option>
            <%end if%>
          </select>
         
          <script language="javascript" src="<%=ACTCMS.ActSys%>act_Inc/Province.js"></script>      </TD>
    </TR>



    <TR>
      <TD width="80" height="25" align="right"><strong>会员金币：</strong></TD>
      <TD><Input Name="Moneys" disabled=true   type=text size=8 Value="<%=rsUser("Moneys")%>">  元
	  </TD>
      <TD width="80" height="25" align="right"><strong>会员点数：</strong></TD>
      <TD><Input disabled=true  Name="Score" type=text size=30 Value="<%=rsUser("Score")%>">
	  
	  </TD>
    </TR>
    <TR >
      <TD width="80" height="25" align="right"><strong>用户状态：</strong></TD>
      <TD ColSpan=3><input type="radio" name="locked" value="0" <%if rsUser("locked")=0 then Response.Write "checked"%>>
        正常&nbsp;&nbsp;
        <input type="radio" name="locked" value="1" <%if rsUser("locked")=1 then Response.Write "checked"%>>
        锁定</TD>
    </TR>
    <TR>
      <TD height="30" colspan="4" align="center"><input name="Action" type="hidden" id="Action" value="SaveEdit">
          <input type=button class="ACT_btn" onclick=CheckForm()  name=Submit value="&nbsp;保存修改结果&nbsp;" >
          <input name="UserID" type="hidden" id="UserID" value="<%=rsUser("UserID")%>"></TD>
    </TR>
  </form>
</TABLE>
<SCRIPT language=javascript>
<!--
function CheckForm()
{ 
var form=document.tcjdxr;
   if (form.UserName.value=='')
    { Alert("请输入用户名!");   
	  form.UserName.focus();    
	   return false;
    }
		  
	 if (form.PassWord.value!=form.RPassWord.value)   
	   {    
	     Alert("两次输入的密码不一致!");   
		  form.PassWord.focus();   
		  return false;    
		  }
		form.Submit.value="正在提交数据,请稍等...";
		form.Submit.disabled=true;	
	    form.submit();
        return true;
}

//-->
</SCRIPT>
<% End Sub %></body>
</html>
