<!--#include file="Admin_Const.asp"-->
<!--#include file="../inc/Cl_Md5.asp"-->
<%
if Not Cl.TrueOtherPurview("User") then
	Admin_ShowErr("<br><li>您无此操作权限！</li>")
end if
const MaxPerPage=20
dim rsAdmin,sqlAdmin
dim UserID,UserSearch,Keyword,strField
dim Action
dim ValidDays,tmpDays,BeginID,EndID
keyword		= Trim(request("keyword"))
strField	= Trim(request("Field"))
UserSearch	= Cl.ChkClng(request("UserSearch"))
Action		= Trim(request("Action"))
UserID		= Trim(Request("UserID"))
ComeUrl		= Request.ServerVariables("HTTP_REFERER")
strFileName	= "Admin_User.asp?UserSearch=" & UserSearch
CurrentPage	= Cl.ChkClng(request("page"))
if keyword<>"" then keyword=Cl.ReplaceBadChar(keyword)
Header
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" Class="border">
  <tr class="title"> 
    <td height="22" colspan=2 align=center><strong>注 册 用 户 管 理</strong></td>
  </tr>
<tr class=tdbg>
<td width="20%">注意事项</td>
<td width="80%"><li>①点删除按钮将删除所选定的用户，此操作是不可逆的；<li>②您可以批量移动用户到相应的组；<li>③点用户名进行相应的资料操作；<li>④点用户最后登陆IP可进行锁定IP操作；<li>⑤点用户Email将给该用户发送Email</td>
</tr>
    <tr class="tdbg"> 
      <td width="100" height="30"><strong>&nbsp;快速查找用户：</strong></td>
      <td width="687" height="30">
        <a href="Admin_User.asp">用户管理首页</a>&nbsp;|&nbsp;<a href="Admin_User.asp?UserSearch=10">所有管理员</a>&nbsp;|&nbsp;<a href="Admin_User.asp?UserSearch=9">所有VIP用户</a>&nbsp;|&nbsp;<a href="Admin_User.asp?UserSearch=8">所有收费用户</a>&nbsp;|&nbsp;<a href="Admin_User.asp?UserSearch=7">被锁住的用户</a>&nbsp;|&nbsp;<a href="Admin_User.asp?UserSearch=12">所有用户</a>&nbsp;|&nbsp;<a href="Admin_User.asp?Action=Add">添加新用户</a>[<a href="Admin_User.asp?Action=AddMore"><font color="blue">批量</font></a>]<br>
		<a href="Admin_User.asp?UserSearch=6">待管理员认证</a>&nbsp;|&nbsp;<a href="Admin_User.asp?UserSearch=5">待邮件验证</a>&nbsp;|&nbsp;<a href="Admin_User.asp?UserSearch=4">24小时内注册</a>&nbsp;|&nbsp;<a href="Admin_User.asp?UserSearch=3">24小时内登录</a>&nbsp;|&nbsp;<a href="Admin_User.asp?UserSearch=2">文章最少的100个</a>&nbsp;|&nbsp;<a href="Admin_User.asp?UserSearch=1">文章最多的100个</a>
	  </td>
    </tr>
</table>
<br>
<%
Select Case Action
Case "Add"
	call AddUser()
Case "SaveAdd"
	call SaveAdd()
Case "AddMore"
	call AddMoreUser()
Case "SaveAddMore"
	call SaveAddMore()
Case "Modify"
	call Modify()
Case "SaveModify"
	call SaveModify()
Case "Del"
	call DelUser()
Case "Lock"
	call LockUser()
Case "UnLock"
	call UnLockUser()
Case "Move"
	call MoveUser()
Case "Update"
	call UpdateUser()
Case "DoUpdate"
	call DoUpdate()
Case "AddMoney"
	call AddMoney()
Case "SaveAddMoney"
	call SaveAddMoney()
Case Else
	call main()
End Select
if FoundErr=True then Admin_ShowErr(ErrMsg)
Footer

Sub Main()
	if UserSearch=0 then
		Call ShowSearch()
	else
		dim strGuide ,sSQL
		strGuide="<table width='100%' align='center' border='0' cellpadding='0' cellspacing='1'><tr><td align='left'>您的位置：<a href='Admin_User.asp'>注册用户管理</a>&nbsp;&gt;&gt;&nbsp;"
		sSQL = " UserID," & Db.UserName & "," & Db.UserLevel & "," & Db.ChargeType & "," & Db.UserPoint & "," & Db.UserMoney & "," & Db.ValidNum & "," & Db.BeginDate & "," & Db.UserLastIP & "," & Db.UserLastLogin & "," & Db.UserLogins & "," & Db.UserLock & " "
		Select Case UserSearch
		Case 1
			sql="select top 100 "&sSQL&" from " & Db.UserTable & " order by " & Db.UserDataNum & " desc"
			strGuide=strGuide & "发表文章最多的前100个用户"
		Case 2
			sql="select top 100 "&sSQL&" from " & Db.UserTable & " order by " & Db.UserDataNum & ""
			strGuide=strGuide & "发表文章最少的100个用户"
		Case 3
			If IsSqlDataBase_U=1 Then
				sql="select "&sSQL&" from " & Db.UserTable & " Where datediff(hour," & Db.UserLastLogin & "," & SqlNowString_U & ")<25 order by " & Db.UserLastLogin & " desc"
			else
				sql="select "&sSQL&" from " & Db.UserTable & " Where datediff('h'," & Db.UserLastLogin & "," & SqlNowString_U & ")<25 order by " & Db.UserLastLogin & " desc"
			end if
			strGuide=strGuide & "最近24小时内登录的用户"
		Case 4
			If IsSqlDataBase_U=1 Then
				sql="select "&sSQL&" from " & Db.UserTable & " Where datediff(hour," & Db.UserJoinDate & "," & SqlNowString_U & ")<25 order by " & Db.UserJoinDate & " desc"
			else
				sql="select "&sSQL&" from " & Db.UserTable & " Where datediff('h'," & Db.UserJoinDate & "," & SqlNowString_U & ")<25 order by " & Db.UserJoinDate & " desc"
			end if
			strGuide=strGuide & "最近24小时内注册的用户"
		Case 5
			sql="select "&sSQL&" from " & Db.UserTable & " Where " & Db.UserLevel & "=7 order by UserID desc"
			strGuide=strGuide & "待邮件验证的用户"
		Case 6
			sql="select "&sSQL&" from " & Db.UserTable & " Where " & Db.UserLevel & "=6 order by UserID desc"
			strGuide=strGuide & "待管理员认证用户"
		Case 7
			sql="select "&sSQL&" from " & Db.UserTable & " Where " & Db.UserLock & "<>0 order by UserID desc"
			strGuide=strGuide & "所有被锁住的用户"
		Case 8
			sql="select "&sSQL&" from " & Db.UserTable & " Where " & Db.UserLevel & "=3 order by UserID desc"
			strGuide=strGuide & "所有收费用户"
		Case 9
			sql="select "&sSQL&" from " & Db.UserTable & " Where " & Db.UserLevel & "=2 order by UserID desc"
			strGuide=strGuide & "所有VIP用户"
		Case 10
			sql="select "&sSQL&" from " & Db.UserTable & " Where " & Db.UserLevel & "=1 order by UserID desc"
			strGuide=strGuide & "所有管理员"
		Case 11
			UserID = Cl.ChkClng(UserID)
			if UserID>0 then'ID
				Sql = "Select "&sSQL&" From "&Db.UserTable&" Where UserID="&UserID&""
			else''''ID
				Dim strsql
				strsql=""
				if request("username")<>"" then
					if request("usernamechk")="yes" then
						strsql=strsql & " username='"&request("username")&"'"
					else
						strsql=strsql &" username like '%"&request("username")&"%'"
					end if
				end if
				if cint(request("UserLevel"))>0 then
					if strsql="" then
						strsql=strsql & " "&Db.UserLevel&"="&request("UserLevel")&""
					else
						strsql=strsql & " and "&Db.UserLevel&"="&request("UserLevel")&""
					end if
					strFileName=strFileName&"&UserLevel="&request("UserLevel")&""
				end if
				if request("useremail")<>"" then
					if strsql="" then
						strsql=strsql & " "&Db.UserEmail&" like '%"&request("useremail")&"%'"
					else
						strsql=strsql & " and "&Db.UserEmail&" like '%"&request("useremail")&"%'"
					end if
					strFileName=strFileName&"&useremail="&request("useremail")&""
				end if
'======特殊搜索=======
				dim Tsqlstr
				if request("loginT")<>"" then
		   			if request("loginR")="more" then
						Tsqlstr=" "&Db.UserLogins&" >= "&request("loginT")&""
					else
						Tsqlstr=" "&Db.UserLogins&" <= "&request("loginT")&""
					end if 	
					if strsql="" then 
						strsql=Tsqlstr
					else
						strsql=strsql & " and" & Tsqlstr
					end if
					strFileName=strFileName&"&loginR="&request("loginR")&"&loginT="&request("loginT")
				end if

				if request("vanishT")<>"" then
		   			if request("vanishR")="more" then
						If IsSqlDataBase_U=1 Then
							Tsqlstr=" datediff(d,"&Db.UserLastLogin&","&SqlNowString_U&") >= "&request("vanishT")&""
						Else
							Tsqlstr=" datediff('d',"&Db.UserLastLogin&","&SqlNowString_U&") >= "&request("vanishT")&""
						End If
					else
						If IsSqlDataBase_U=1 Then
							Tsqlstr=" datediff(d,"&Db.UserLastLogin&","&SqlNowString_U&") <= "&request("vanishT")&""
						Else
							Tsqlstr=" datediff('d',"&Db.UserLastLogin&","&SqlNowString_U&") <= "&request("vanishT")&""
						End If
					end if 	
					if strsql="" then 
						strsql=Tsqlstr
					else
						strsql=strsql & " and" & Tsqlstr
					end if
					strFileName=strFileName&"&vanishR="&request("vanishR")&"&vanishT="&request("vanishT")
				end if

				if request("regT")<>"" then
		   			if request("regR")="more" then
						If IsSqlDataBase_U=1 Then
							Tsqlstr=" datediff(d,"&Db.UserJoinDate&","&SqlNowString_U&") >= "&request("regT")&""
						Else
							Tsqlstr=" datediff('d',"&Db.UserJoinDate&","&SqlNowString_U&") >= "&request("regT")&""
						End If
					else
						If IsSqlDataBase_U=1 Then
							Tsqlstr=" datediff(d,"&Db.UserJoinDate&","&SqlNowString_U&") <= "&request("regT")&""
						Else
							Tsqlstr=" datediff('d',"&Db.UserJoinDate&","&SqlNowString_U&") <= "&request("regT")&""
						End If
					end if 	
					if strsql="" then 
						strsql=Tsqlstr
					else
						strsql=strsql & " and" & Tsqlstr
					end if
					strFileName=strFileName&"&regR="&request("regR")&"&regT="&request("regT")
				end if

				if request("artcleT")<>"" then
		   			if request("artcleR")="more" then
						Tsqlstr=" "&Db.UserDataNum&" >= "&request("artcleT")&""
					else
						Tsqlstr=" "&Db.UserDataNum&" <= "&request("artcleT")&""
					end if 	
					if strsql="" then 
						strsql=Tsqlstr
					else
						strsql=strsql & " and" & Tsqlstr
					end if
					strFileName=strFileName&"&artcleR="&request("artcleR")&"&artcleT="&request("artcleT")
				end if
'======特殊搜索结束======
				If strsql = "" Then
					FoundErr=True
					ErrMsg=ErrMsg & "<br><li>请指定搜索参数！</li>"
					Exit Sub
				End If
				If Request("Searchmax") = "" Or Not Isnumeric(Request("Searchmax")) Then
					Sql = "Select top 1 "&sSQL&" From "&Db.UserTable&" Where " & strsql & " order by UserID Desc"
				Else
					Sql = "Select top "&Request("Searchmax")&" "&sSQL&" From "&Db.UserTable&" Where " & strsql & " order by UserID desc"
				End If
				strFileName=strFileName&"&Searchmax="&request("Searchmax")
			end if '''ID
			strGuide=strGuide & "查询结果："
		Case 12
			sql="Select "&sSQL&" From " & Db.UserTable & " Order by UserID Desc"
			strGuide=strGuide & "所有用户"
		Case Else
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>错误的参数！</li>"
		End Select
		strGuide=strGuide & "</td><td align='right'>"
		if FoundErr=True then Exit Sub
		Set rs=Server.CreateObject("Adodb.RecordSet")
		OpenConn_U : rs.Open sql,Conn_U,1,1
		if rs.eof and rs.bof then
			TotalPut=0
			Response.Write strGuide & "共找到 <font color=#ff6600>0</font> 个用户</td></tr></table>"
			rs.Close:set rs=Nothing
		else
			TotalPut=rs.recordcount
			Response.Write strGuide & "共找到 <font color=#ff6600>" & TotalPut & "</font> 个用户</td></tr></table>"
			if (TotalPut mod MaxPerPage)=0 then
				TotalPages = TotalPut \ MaxPerPage
			else
				TotalPages = TotalPut \ MaxPerPage + 1
			end if
			if CurrentPage > TotalPages then CurrentPage=TotalPages
			if CurrentPage < 1 then CurrentPage=1
			rs.move (CurrentPage-1)*MaxPerPage
			SQL = rs.GetRows(MaxPerPage)
			rs.Close:set rs=Nothing
			ShowContent
		end if
	end if
End Sub

Sub ShowContent()
%>
<script language=javascript>
function unselectall()
{
    if(document.myform.chkAll.checked){
	document.myform.chkAll.checked = document.myform.chkAll.checked&0;
    } 	
}

function CheckAll(form)
{
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.Name != "chkAll")
       e.checked = form.chkAll.checked;
    }
}
</script>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <form name="myform" method="Post" action="Admin_User.asp" onSubmit="return confirm('确定要执行选定的操作吗？');">
  <tr><td>
  <table border="0" cellspacing="1" align="center" width="100%" cellpadding="0" class="border">
          <tr class="title">
            <td width="30" align="center"><strong>选中</strong></td>
            <td width="30" align="center"><strong>ID</strong></td>
            <td width="80" height="22" align="center"><strong> 用户名</strong></td>
            <td height="22" align="center"><strong>所属用户组</strong></td>
            <td align="center"><strong>剩余<%=Cl.Web_Setting(28)%>/天数</strong></td>
            <td height="22" align="center"><strong>最后登录IP</strong></td>
            <td align="center"><strong>最后登录时间</strong></td>
            <td width="60" height="22" align="center"><strong>登录次数</strong></td>
            <td width="40" height="22" align="center"><strong> 状态</strong></td>
            <td width="120" height="22" align="center"><strong> 操作</strong></td>
          </tr>
          <%
		For i=0 To Ubound(SQL,2)
		%>
		  <tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#cccccc'" style="padding: 0px 2px;">
            <td width="30" align="center"><input name="UserID" type="checkbox" onclick="unselectall()" id="UserID" value="<%=SQL(0,i)%>"></td>
            <td width="30" align="center"><%=SQL(0,i)%></td>
            <td width="80" align="center"><%
			response.write "<a href='Admin_User.asp?Action=Modify&UserID=" & SQL(0,i) & "'>" & SQL(1,i) & "</a>"
			%>
			</td>
            <td align="center"><font color=blue><%=Cl.GetUserGroupName(SQL(2,i))%></font></td>
            <td align="center">
			<%
		if SQL(3,i)=1 then
			if SQL(4,i)<=0 then
				response.write "<font color=#ff6600>" & SQL(4,i) & "</font> "&Cl.Web_Setting(29)&""
			else
				if SQL(4,i)<=10 then
					response.write "<font color=blue>" & SQL(4,i) & "</font> "&Cl.Web_Setting(29)&""
				else
					response.write SQL(4,i) & " 点"
				end if
			end if
		else
			ValidDays=SQL(6,i)
			tmpDays = ValidDays-DateDiff("D",SQL(7,i),now())
	  		if tmpDays<=10 then
				response.write "<font color=#ff0033>" & tmpDays & "</font> 天"
			else
				response.write "<font color=#0000ff>" & tmpDays & "</font> 天"
			end if
		end if
		%></td>
            <td align="center"> <%
		if SQL(8,i)<>"" then
			response.write "<a href=Admin_LockIP.asp?action=add&userip="&SQL(8,i)&">"&SQL(8,i)&"</a>"
		else
			response.write "&nbsp;"
		end if%> </td>
            <td align="center"> <%=SQL(9,i)%> </td>
            <td width="60" align="center"><%=SQL(10,i)%> </td>
            <td width="40" align="center"><%
		if SQL(11,i)<>0 then
			response.write "<font color=#ff6600>已锁定</font>"
		else
	  		response.write "正常"
		end if%></td>
            <td width="120" align="center"><%
		response.write "<a href='Admin_User.asp?Action=Modify&UserID=" & SQL(0,i) & "'>修改</a>&nbsp;"
        if SQL(2,i)<>1 then  '管理员判断
			if SQL(11,i)=0 then
				response.write "<a href='Admin_User.asp?Action=Lock&UserID=" & SQL(0,i) & "'>锁定</a>&nbsp;"
			else
			    response.write "<a href='Admin_User.asp?Action=UnLock&UserID=" & SQL(0,i) & "'>解锁</a>&nbsp;"
			end if
			response.write "<a href='Admin_User.asp?Action=Del&UserID=" & SQL(0,i) & "' onClick='return confirm(""确定要删除此用户吗？"");'>删除</a>&nbsp;"
			response.write "<a href='Admin_User.asp?Action=AddMoney&UserID=" & SQL(0,i) & "'>续费</a>"
		end if
		%> </td>
          </tr>
	<%Next%>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
  <tr class="tdbg">
    <td width="200" height="30"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
              选中本页显示的所有用户</td>
            <td> <strong>操作：</strong> 
              <input name="Action" type="radio" value="Del" checked onClick="document.myform.UserLevel.disabled=true">删除&nbsp;&nbsp;&nbsp;&nbsp;
              <input name="Action" type="radio" value="Lock" onClick="document.myform.UserLevel.disabled=true">锁定 &nbsp;&nbsp;&nbsp;
              <input name="Action" type="radio" value="UnLock" onClick="document.myform.UserLevel.disabled=true">解锁 &nbsp;&nbsp;&nbsp; 
              <input name="Action" type="radio" value="Move" onClick="document.myform.UserLevel.disabled=false">移动到
              <select name="UserLevel" id="UserLevel" disabled>
                <%=Cl.UserGroup_Option(3)%>
              </select>
              &nbsp;&nbsp;
              <input type="Submit" name="Submit" value=" 执&nbsp;&nbsp;行 " > </td>
  </tr>
</table>
</td>
</tr></form></table>
<%=Cl.ShowPage(strFileName,TotalPut,MaxPerPage,"个","用户")%>
<%
End Sub

Sub ShowSearch()
%>
<form name="form2" method="post" action="Admin_User.asp">
<table width="100%" align="center" border="0" cellspacing="1" cellpadding="2" class="border">
<tr Class="title">
	<td align="left" colspan="2" height="23">高级查询</td>
</tr>
<tr class="tdbg">
	<td width="20%">注意事项</td>
	<td width="80%">在记录很多的情况下搜索条件越多查询越慢，请尽量减少查询条件；最多显示记录数也不宜选择过大</td>
</tr>
<tr class="tdbg">
	<td width="20%">最多查询记录数</td>
	<td width="80%"><input size="45" name="searchMax" type="text" value="100"></td>
</tr>
<tr class="tdbg">
	<td width="20%">用户ID</td>
	<td width="80%"><input size="45" name="userid" type="text"></td>
</tr>
<tr class="tdbg">
	<td width="20%">用户名</td>
	<td width="80%"><input size="45" name="username" type="text">&nbsp;<input type="checkbox" name="usernamechk" value="yes" checked>用户名完整匹配</td>
</tr>
<tr class="tdbg">
	<td width="20%">用户等级</td>
	<td width="80%">
	<select size="1" name="UserLevel">
	<option value="0" selected>任意</option>
	<%=Cl.UserGroup_Option(0)%>
	</select>
	</td>
</tr>
<tr class="tdbg">
	<td width="20%">Email包含</td>
	<td width="80%"><input size="45" name="UserEmail" type=text></td>
</tr>
</table>
<table width="100%" align="center" border="0" cellspacing="1" cellpadding="2" class="border">
<!--特殊搜索-->
<tr class="title">
	<td align="left" colspan="2" height="23">特殊查询&nbsp;（注意： <多于> 或 <少于> 已默认包含 <等于>；条件留空则不使用此条件 ）</td>
</tr>
<tr class="tdbg">
	<td width="50%">登录次数:<input type=radio value=more name="loginR" checked ID="Radio1">&nbsp;多于&nbsp;<input type=radio value=less name="loginR" ID="Radio2">&nbsp;少于&nbsp;&nbsp;<input size=5 name="loginT" type=text ID="Text1"> 次&nbsp;&nbsp;</td>
	<td width="50%">消失天数:<input type=radio value=more name="vanishR" checked ID="Radio3">&nbsp;多于&nbsp;<input type=radio value=less name="vanishR" ID="Radio4">&nbsp;少于&nbsp;&nbsp;<input size=5 name="vanishT" type=text ID="Text2"> 天&nbsp;&nbsp;</td>
</tr>
<tr class="tdbg">
	<td width="50%">注册天数:<input type=radio value=more name="regR" checked ID="Radio5">&nbsp;多于&nbsp;<input type=radio value=less name="regR" ID="Radio6">&nbsp;少于&nbsp;&nbsp;<input size=5 name="regT" type=text ID="Text3"> 天&nbsp;&nbsp;</td>
	<td width="50%">发表文章:<input type=radio value=more name="artcleR" checked ID="Radio7">&nbsp;多于&nbsp;<input type=radio value=less name="artcleR" ID="Radio8">&nbsp;少于&nbsp;&nbsp;<input size=5 name="artcleT" type=text ID="Text4"> 篇&nbsp;&nbsp;</td>
</tr>
<!--特殊搜索结束-->
<tr>
	<td width="100%" class="tdbg" align="center" colspan="7"><input name="Submit" type=Submit value="   搜  索   "></td>
</tr>
<input name="UserSearch" type="hidden" id="UserSearch" value="11">
</table>
</form>
<%
End Sub

Sub AddUser()
%>
<script language=javascript>
function CheckFrom()
{
  if(document.myform.UserName.value=="")
    {
      alert("用户名不能为空！");
	  document.myform.UserName.focus();
      return false;
    }

  if(document.myform.Question.value=="")
    {
      alert("密码问题不能为空！");
	  document.myform.Question.focus();
      return false;
    }
  if(document.myform.Answer.value=="")
    {
      alert("密码答案不能为空！");
	  document.myform.Answer.focus();
      return false;
    }
  if(document.myform.UserEmail.value=="")
    {
      alert("用户Email不能为空！");
	  document.myform.UserEmail.focus();
      return false;
    }
  if(document.myform.Password.value=="")
    {
      alert("密码不能为空！");
	  document.myform.Password.focus();
      return false;
    }
    
  if((document.myform.Password.value)!=(document.myform.PwdConfirm.value))
    {
      alert("初始密码与确认密码不同！");
	  document.myform.PwdConfirm.select();
	  document.myform.PwdConfirm.focus();	  
      return false;
    }
}
</script>
<script language="JavaScript" src="../Inc/Js/selectdate.js"></script>
<script language="JavaScript" src="../Inc/Js/selectcity.js"></script>
  <table width="100%" align="center" border=0 cellpadding=0 cellspacing=1 class="border">
<form name="myform" action="Admin_User.asp" method="post" onSubmit="return CheckFrom();">
    <TR align=center> 
      <TD height=22 colSpan=4 class='title'><font class=en><b>添 加 新 用 户</b></font></TD>
    </TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>用户名称：</strong></TD>
		<TD> <Input Name="UserName" type=text size=30 Value="" style="width:190" > <font color="red">*</font></TD>
		<TD width="80" height="25" align="right"><strong>真实姓名：</strong></TD>
		<TD> <Input Name="UserReName" type=text size=30 style="width:190" Value=""></TD>
	</TR>
		<TR Class="tdbg"> 
			<TD width="80" height="25" align="right"><strong>用户密码：</strong></TD>
			<TD height="25"><INPUT type="password" name="Password" style="width:190" value="" size="30" maxLength="12"> <font color="red">*</font></TD>
			<TD width="80" height="25" align="right"><strong>重复密码：</strong></TD>
			<TD height="25"><INPUT type="password" name="PwdConfirm" style="width:190" value="" size="30" maxLength="12"> <font color="red">*</font></TD>
		</TR>
    <TR class="tdbg" > 
		<TD width="80" height="25" align="right"><strong>密码问题：</strong></TD>
		<TD><INPUT   type=text maxLength=50 size=30 style="width:190" name="Question"> 
        <font color="#FF6600">*</font> </TD>
		<TD width="80" height="25" align="right"><strong>问题答案：</strong></TD>
		<TD><INPUT   type=text maxLength=20 size=30 style="width:190" name="Answer"> 
        <font color="#FF6600">*</font> </TD>
    </TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>用户性别：</strong></TD>
			<TD height="25"> <INPUT type=radio value="1" name=sex CHECKED> 男 &nbsp;&nbsp; <INPUT type=radio value="0" name=sex> 女</TD>
		<TD width="80" height="25" align="right"><strong>用户等级：</strong></TD>
		<TD> <select name="UserLevel" id="UserLevel" style="width:190">
          <%=Cl.UserGroup_Option(4)%>
        </select></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>用户邮箱：</strong></TD>
		<TD> <Input Name="UserEmail" type=text size=30 style="width:190" Value=""> <font color="#FF6600">*</font></TD>
		<TD width="80" height="25" align="right"><strong>用户主页：</strong></TD>
		<TD> <Input Name="UserHome" type=text size=30 style="width:190" Value=""></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>用户QQ：</strong></TD>
		<TD> <Input Name="UserQQ" type=text size=30 style="width:190" Value=""></TD>
		<TD width="80" height="25" align="right"><strong>用户ICQ：</strong></TD>
		<TD> <Input Name="UserICQ" type=text size=30 style="width:190" Value=""></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>用户MSN：</strong></TD>
		<TD> <Input Name="UserMSN" type=text size=30 style="width:190" Value=""></TD>
		<TD width="80" height="25" align="right"><strong>AIM号码：</strong></TD>
		<TD><Input Name="UserAIM" type=text size=30 style="width:190" Value=""></TD>
	</TR>
	<TR Class="tdbg" >
		<TD width="80" height="25" align="right"><strong>yahoo帐号：</strong></TD>
		<TD><Input Name="UserYahoo" type=text size=30 style="width:190" Value=""></TD>
		<TD width="80" height="25" align="right"><strong>UC号码：</strong></TD>
		<TD><Input Name="UserUC" type=text size=30 style="width:190" Value=""></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>国家/省/市：</strong></TD>
		<TD ColSpan=3><input type=text name=Country size=18 maxLength=50 value="中国"> / <input type=text name=Province size=10 maxLength=50 value="">
			<select name="selectp" onChange="selectcityarea('selectp','selectc','myform');myform.Province.value=this.value;">
			<option value="0" selected>请选择....</option>
			</select> / <input type=text name=City size=10 maxLength=50 value="">
			<select name="selectc" onChange="myform.City.value=this.value;">
			<option value="0" selected>请选择....</option>
			</select></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>出生日期：</strong></TD>
		<TD><Input Name="BirthDay" type=text size=30 style="width:190" Value="" onfocus="show_cele_date(BirthDay,'','',BirthDay)"></TD>
		<TD width="80" height="25" align="right"><strong>身份证号：</strong></TD>
		<TD><Input Name="IDCard" type=text size=30 style="width:190" Value=""></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>工作单位：</strong></TD>
		<TD><Input Name="UserWorking" type=text size=30 style="width:190" Value=""></TD>
		<TD width="80" height="25" align="right"><strong>教育程度：</strong></TD>
		<TD><select name="SchoolAge" style="width:190">
			<option value="" selected>请选择....</option>
			<option value="大专以下">大专以下</option>
			<option value="大专">大专</option>
			<option value="本科">本科</option>
			<option value="本科以上">本科以上</option>
			</select></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>住宅电话：</strong></TD>
		<TD><Input Name="UserHomePhone" type=text size=30 style="width:190" Value=""></TD>
		<TD width="80" height="25" align="right"><strong>手机号码：</strong></TD>
		<TD><Input Name="UserMobile" type=text size=30 style="width:190" Value=""></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>办公电话：</strong></TD>
		<TD><Input Name="UserTelePhone" type=text size=30 style="width:190" Value=""></TD>
		<TD width="80" height="25" align="right"><strong>邮政编码：</strong></TD>
		<TD><Input Name="ZipCode" type=text size=30 style="width:190" Value=""></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>联系地址：</strong></TD>
		<TD ColSpan=3><Input Name="UserAddRess" type=text size=88 Value=""></TD>
	</TR>
    <TR class="tdbg" >
		<TD width="80" height="25" align="right"><strong>计费方式：</strong></TD>
		<TD Colspan=3><input name="ChargeType" type="radio" value="1" checked>
        扣<%=Cl.Web_Setting(28)%><font color="#0066CC">（推荐）</font>：&nbsp;每阅读一篇收费文章，扣除相应<%=Cl.Web_Setting(28)%>。&nbsp;<br>
        <input type="radio" name="ChargeType" value="2">
        有效期：在有效期内，用户可以任意阅读收费内容</TD>
    </TR>
    <TR class="tdbg" >
		<TD width="80" height="25" align="right"><strong>有效期限：</strong></TD>
		<TD Colspan=3>开始日期：
        <input name="BeginDate" type="text" id="BeginDate" value="<%=FormatdateTime(now(),2)%>" size="20" maxlength="20"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;有 效 期：
      <input name="Valid_Num" type="text" id="Valid_Num" value="1" size="10" maxlength="10">
      <select name="Valid_Unit" id="Valid_Unit">
      <option value="1">天</option>
      <option value="2">月</option>
      <option value="3" selected>年</option>
      </select>
	  <br>
        若超过此期限，则用户不能阅读收费内容此功能只有当计费方式为“有效期限”时才有效
      </TD>
    </TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>用户<%=Cl.Web_Setting(28)%>：</strong></TD>
		<TD> <Input Name="UserPoint" type=text size=30 style="width:190" Value="0"></TD>
		<TD width="80" height="25" align="right"><strong>用户<%=Cl.Web_Setting(26)%>：</strong></TD>
		<TD> <Input Name="UserMoney" type=text size=30 style="width:190" Value="0"></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>备注：</strong></TD>
		<TD ColSpan=3><textarea Name="UserReMark" id="UserReMark" cols="80" rows="5"></textarea><br>
		<a href="javascript:admin_Size(-5,'UserReMark')"><img src="images/minus.gif" unselectable="on" border='0'></a> <a href="javascript:admin_Size(5,'UserReMark')"><img src="images/plus.gif" unselectable="on" border='0'></a></TD>
	</TR>
    <TR class="tdbg" > 
		<TD width="80" height="25" align="right"><strong>用户状态：</strong></TD>
		<TD ColSpan=3><input name="LockUser" type="radio" value="0" checked>
        正常&nbsp;&nbsp; <input type="radio" name="LockUser" value="1">
        锁定</TD>
    </TR>
    <TR align="center" class="tdbg" > 
      <TD colspan="4"><input name="Action" type="hidden" id="Action" value="SaveAdd">
        <input type="Submit" name="Submit" value=" 添&nbsp;&nbsp;加 " ></TD>
    </TR>
</form>
  </TABLE>
  <script language=javascript>
first("selectp","selectc","myform",0,0);
</script>
<%
End Sub

Sub Modify()
	dim rsUser,sqlUser,sSex
	UserID=Cl.ChkClng(UserID)
	if UserID=0 then Admin_ShowErr("<br><li>参数不足！</li>")
	sqlUser="select * from " & Db.UserTable & " Where UserID=" & UserID
	Set rsUser=Cl.Execute_U(sqlUser)
	if rsUser.bof and rsUser.eof then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>找不到指定的用户！</li>"
		rsUser.close:set rsUser=Nothing
		exit Sub
	end if
		dim UserIM,homepage,QQ,icq,msn,Aim,yahoo,UC,sCityInfo
		IF UserTableType="Bbsxp" then
			homepage=rsUser(Db.UserHomePage)
			UserIM=split(rsUser(Db.UserIM),"\")
			QQ=UserIM(0):icq=UserIM(1):msn=UserIM(4)
			Aim=UserIM(3):yahoo=UserIM(5):UC=UserIM(2)
			if rsUser(Db.UserSex)="male" then
				sSex="男"
			else
				sSex="女"
			end if
		Else
			UserIM=split(rsUser(Db.UserIM),"|||")
			homepage=UserIM(0):QQ=UserIM(1):icq=UserIM(2):msn=UserIM(3)
			Aim=UserIM(4):yahoo=UserIM(5):UC=UserIM(6)
			if rsUser(Db.UserSex)=1 then
				sSex="男"
			else
				sSex="女"
			end if
		End if
		sCityInfo=Split(rsUser("CityInfo"),"|||")
		if Ubound(sCityInfo)<2 then Redim sCityInfo(2)
%>
<script language=javascript>
function CheckFrom()
{
	if(document.myform.Question.value=="")
    {
		alert("密码问题不能为空！");
		document.myform.Question.focus();
		return false;
    }
	if(document.myform.Answer.value=="")
    {
		alert("密码答案不能为空！");
		document.myform.Answer.focus();
		return false;
    }
	if(document.myform.UserEmail.value=="")
    {
		alert("用户Email不能为空！");
		document.myform.UserEmail.focus();
		return false;
    }
	if((document.myform.Password.value)!=(document.myform.PwdConfirm.value))
    {
		alert("初始密码与确认密码不同！");
		document.myform.PwdConfirm.select();
		document.myform.PwdConfirm.focus();
		return false;
    }
	if (document.myform.IsReName.checked==true)
	{
		if (document.myform.UserName.value=="<%=rsUser(Db.UserName)%>")
		{
			alert("新用户名不能和旧用户名相同，请重新输入！");
			document.myform.UserName.focus();
			return false;
		}
	}
}
function ChkReName()
{
	if (document.myform.IsReName.checked==true)
	{
	document.myform.UserName.disabled=false;
	}
	else
	{
	document.myform.UserName.disabled=true;
	}
}
</script>
<script language="JavaScript" src="../Inc/Js/selectdate.js"></script>
<script language="JavaScript" src="../Inc/Js/selectcity.js"></script>
  <table width="100%" align="center" border="0" cellspacing="1" cellpadding="0" class="border">
<form name="myform" action="Admin_User.asp" method="post" onSubmit="return CheckFrom();">
    <TR> 
      <TD height=22 colSpan=4 align="center" class='title'><b>修改注册用户信息</b></TD>
    </TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>用户名称：</strong></TD>
		<TD> <Input Name="UserName" type=text size=30 style="width:190" Value="<%=rsUser(Db.UserName)%>" Disabled> <font color="red">*</font>&nbsp;<input type="checkbox" name="IsReName" value="yes" onclick="ChkReName();"> 更改</TD>
		<TD width="80" height="25" align="right"><strong>真实姓名：</strong></TD>
		<TD> <Input Name="UserReName" type=text size=30 style="width:190" Value="<%=rsUser("UserReName")%>"></TD>
	</TR>
		<TR Class="tdbg"> 
			<TD width="80" height="25" align="right"><strong>用户密码：</strong></TD>
			<TD height="25"><INPUT type="password" name="Password" value="" style="width:190" size="30" maxLength="12"><br><font color="#FF6600">如果不想修改，请留空</font></TD>
			<TD width="80" height="25" align="right"><strong>重复密码：</strong></TD>
			<TD height="25"><INPUT type="password" name="PwdConfirm" value="" style="width:190" size="30" maxLength="12"><br><font color="#FF6600">如果不想修改，请留空</font></TD>
		</TR>
    <TR class="tdbg" > 
		<TD width="80" height="25" align="right"><strong>密码问题：</strong></TD>
		<TD><INPUT type=text maxLength=50 size=30 name="Question" style="width:190" value="<%=rsUser(Db.UserQuestion)%>">
        <font color="#FF6600">*</font> </TD>
		<TD width="80" height="25" align="right"><strong>问题答案：</strong></TD>
		<TD><INPUT type=text maxLength=20 size=30 style="width:190" name="Answer" value="<%=rsUser(Db.UserAnswer)%>"> <font color="#FF6600">*</font></TD>
    </TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>用户性别：</strong></TD>
			<TD height="25"> <INPUT type=radio value="1" name=sex  <%if sSex="男" then response.write "CHECKED"%>> 男 &nbsp;&nbsp; <INPUT type=radio value="0" name=sex <%if sSex<>"男" then response.write "CHECKED"%>> 女</TD>
		<TD width="80" height="25" align="right"><strong>用户等级：</strong></TD>
		<TD> <select name="UserLevel" id="UserLevel" style="width:190">
		<%=Cl.UserGroup_Option(rsUser(Db.UserLevel))%>
        </select></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>用户邮箱：</strong></TD>
		<TD> <Input Name="UserEmail" type=text size=30 style="width:190" Value="<%=rsUser(Db.UserEmail)%>"><br><a href="mailto:<%=rsUser(Db.UserEmail)%>">给此用户发一封电子邮件</a></TD>
		<TD width="80" height="25" align="right"><strong>用户主页：</strong></TD>
		<TD> <Input Name="UserHome" type=text size=30 style="width:190" Value="<%=Homepage%>"></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>用户QQ：</strong></TD>
		<TD> <Input Name="UserQQ" type=text size=30 style="width:190" Value="<%=QQ%>"></TD>
		<TD width="80" height="25" align="right"><strong>用户ICQ：</strong></TD>
		<TD> <Input Name="UserICQ" type=text size=30 style="width:190" Value="<%=ICQ%>"></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>用户MSN：</strong></TD>
		<TD> <Input Name="UserMSN" type=text size=30 style="width:190" Value="<%=MSN%>"></TD>
		<TD width="80" height="25" align="right"><strong>AIM号码：</strong></TD>
		<TD><Input Name="UserAIM" type=text size=30 style="width:190" Value="<%=AIM%>"></TD>
	</TR>
	<TR Class="tdbg" >
		<TD width="80" height="25" align="right"><strong>yahoo帐号：</strong></TD>
		<TD><Input Name="UserYahoo" type=text size=30 style="width:190" Value="<%=Yahoo%>"></TD>
		<TD width="80" height="25" align="right"><strong>UC号码：</strong></TD>
		<TD><Input Name="UserUC" type=text size=30 style="width:190" Value="<%=UC%>"></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>国家/省/市：</strong></TD>
		<TD ColSpan=3><input type=text name=Country size=18 maxLength=50 value="<%=sCityInfo(0)%>"> / <input type=text name=Province size=10 maxLength=50 value="<%=sCityInfo(1)%>">
			<select name="selectp" onChange="selectcityarea('selectp','selectc','myform');myform.Province.value=this.value;">
			<option value="0" selected>请选择....</option>
			</select> / <input type=text name=City size=10 maxLength=50 value="<%=sCityInfo(2)%>">
			<select name="selectc" onChange="myform.City.value=this.value;">
			<option value="0" selected>请选择....</option>
			</select></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>出生日期：</strong></TD>
		<TD><Input Name="BirthDay" type=text size=30 style="width:190" Value="<%=rsUser("UserBirthDay")%>" onfocus="show_cele_date(BirthDay,'','',BirthDay)"></TD>
		<TD width="80" height="25" align="right"><strong>身份证号：</strong></TD>
		<TD><Input Name="IDCard" type=text size=30 style="width:190" Value="<%=rsUser("IDCard")%>"></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>工作单位：</strong></TD>
		<TD><Input Name="UserWorking" type=text size=30 style="width:190" Value="<%=rsUser("UserWorking")%>"></TD>
		<TD width="80" height="25" align="right"><strong>教育程度：</strong></TD>
		<TD><select name="SchoolAge" style="width:190">
			<option value="" <%if rsUser("SchoolAge")="" then%>selected<%end if%>>请选择....</option>
			<option value="大专以下" <%if rsUser("SchoolAge")="大专以下" then%>selected<%end if%>>大专以下</option>
			<option value="大专" <%if rsUser("SchoolAge")="大专" then%>selected<%end if%>>大专</option>
			<option value="本科" <%if rsUser("SchoolAge")="本科" then%>selected<%end if%>>本科</option>
			<option value="本科以上" <%if rsUser("SchoolAge")="本科以上" then%>selected<%end if%>>本科以上</option>
			</select></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>住宅电话：</strong></TD>
		<TD><Input Name="UserHomePhone" type=text size=30 style="width:190" Value="<%=rsUser("UserHomePhone")%>"></TD>
		<TD width="80" height="25" align="right"><strong>手机号码：</strong></TD>
		<TD><Input Name="UserMobile" type=text size=30 style="width:190" Value="<%=rsUser("UserMobile")%>"></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>办公电话：</strong></TD>
		<TD><Input Name="UserTelePhone" type=text size=30 style="width:190" Value="<%=rsUser("UserTelePhone")%>"></TD>
		<TD width="80" height="25" align="right"><strong>邮政编码：</strong></TD>
		<TD><Input Name="ZipCode" type=text size=30 style="width:190" Value="<%=rsUser("ZipCode")%>"></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>联系地址：</strong></TD>
		<TD ColSpan=3><Input Name="UserAddRess" type=text size=88 Value="<%=rsUser("UserAddRess")%>"></TD>
	</TR>
    <TR class="tdbg" >
		<TD width="80" height="25" align="right"><strong>计费方式：</strong></TD>
		<TD Colspan=3><input name="ChargeType" type="radio" value="1" <%if rsUser(Db.ChargeType)=1 then response.write " checked"%>>
        扣<%=Cl.Web_Setting(28)%><font color="#0066CC">（推荐）</font>：&nbsp;每阅读一篇收费文章，扣除相应<%=Cl.Web_Setting(28)%>。&nbsp;<br>
        <input type="radio" name="ChargeType" value="2" <%if rsUser(Db.ChargeType)=2 then response.write " checked"%>>
        有效期：在有效期内，用户可以任意阅读收费内容</TD>
    </TR>
    <TR class="tdbg" >
		<TD width="80" height="25" align="right"><strong>有效期限：</strong></TD>
		<TD Colspan=3>开始日期：
        <input name="BeginDate" type="text" id="BeginDate" value="<%=FormatDateTime(rsUser(Db.BeginDate),2)%>" size="20" maxlength="20"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;有 效 期：
      <input name="Valid_Num" type="text" id="Valid_Num" value="<%=rsUser(Db.ValidNum)%>" size="10" maxlength="10">  天
	  <br>
        若超过此期限，则用户不能阅读收费内容此功能只有当计费方式为“有效期限”时才有效
      </TD>
    </TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>用户<%=Cl.Web_Setting(28)%>：</strong></TD>
		<TD> <Input Name="UserPoint" type=text size=30 style="width:190" Value="<%=rsUser(Db.UserPoint)%>"></TD>
		<TD width="80" height="25" align="right"><strong>用户<%=Cl.Web_Setting(26)%>：</strong></TD>
		<TD> <Input Name="UserMoney" type=text size=30 style="width:190" Value="<%=rsUser(Db.UserMoney)%>"></TD>
	</TR>
    <TR class="tdbg" > 
		<TD width="80" height="25" align="right"><strong>用户数据：</strong></TD>
		<TD><INPUT name="DataCount" value="<%=RsUser(Db.UserDataNum)%>" size=10 maxLength=10> 篇</TD>
		<TD width="80" height="25" align="right"><strong></strong></TD>
		<TD> </TD>
    </TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>备注：</strong></TD>
		<TD ColSpan=3><textarea Name="UserReMark" id="UserReMark" cols="80" rows="5"><%=rsUser("UserReMark")%></textarea><br>
		<a href="javascript:admin_Size(-5,'UserReMark')"><img src="images/minus.gif" unselectable="on" border='0'></a> <a href="javascript:admin_Size(5,'UserReMark')"><img src="images/plus.gif" unselectable="on" border='0'></a></TD>
	</TR>
    <TR class="tdbg" > 
		<TD width="80" height="25" align="right"><strong>用户状态：</strong></TD>
		<TD ColSpan=3><input type="radio" name="LockUser" value="0" <%if rsUser(Db.UserLock)=0 then response.write "checked"%>>
        正常&nbsp;&nbsp; <input type="radio" name="LockUser" value="1" <%if rsUser(Db.UserLock)=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="SaveModify"> 
        <input name=Submit   type=Submit id="Submit" value="&nbsp;保存修改结果&nbsp;" > <input name="UserID" type="hidden" id="UserID" value="<%=rsUser("UserID")%>"></TD>
    </TR>
</form>
  </TABLE>
<script language=javascript>
first("selectp","selectc","myform",0,0);
</script>
<%
	rsUser.close : set rsUser=Nothing
End Sub

Sub AddMoney()
	dim rsUser,sqlUser
	UserID=Cl.ChkClng(UserID)
	if UserID=0 then Admin_ShowErr("<br><li>参数不足！</li>")
	Set rsUser=Cl.Execute_U("select * from " & Db.UserTable & " Where UserID=" & UserID)
	if rsUser.bof and rsUser.eof then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>找不到指定的用户！</li>"
		rsUser.close:set rsUser=Nothing
		exit Sub
	end if
	if rsUser(Db.UserLevel)=4 then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>此用户是普通用户，无需续费！</li>"
		rsUser.close:set rsUser=Nothing
		exit Sub
	end if
%>
  <table width="100%" align="center" border="0" cellspacing="1" cellpadding="0" class="border">
<FORM name="myform" action="Admin_User.asp" method="post">
    <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.UserLevel))%></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="Valid_Num" type="text" id="Valid_Num" 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="&nbsp;保存续费结果&nbsp;" > <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.ChkClng(request("EndID"))+1
		StrEndID=StrBeGinID+(Cl.ChkClng(request("EndID"))-Cl.ChkClng(request("BeginID")))
	else
		StrBeGinID=1
		StrEndID=1000
	end if
%>
<table width="100%" align="center" border="0" cellspacing="1" cellpadding="0" class="border">
<FORM name="myform" action="Admin_User.asp" method="post">
  <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="&nbsp;更新用户数据&nbsp;" > <input name="Action" type="hidden" id="Action" value="DoUpdate"></td>
  </tr>
</form>
</table>
<%
End Sub

Sub SaveAdd()
	dim UserName,UserReName,Password,PwdConfirm,Question,Answer,Sex,UserEmail,UserHome,UserQQ,UserMSN,UserLevel,LockUser,ChargeType,UserPoint,UserMoney,BeginDate,Valid_Num,Valid_Unit
	dim UserTelePhone,UserAddRess,UserReMark
	dim IDCard,BirthDay,CityInfo,ZipCode
	Dim SchoolAge,UserWorking,UserHomePhone,UserMobile
	UserName		= Trim(request("UserName"))
	UserReName		= Trim(request("UserReName"))
	Password		= Trim(request("Password"))
	PwdConfirm		= Trim(request("PwdConfirm"))
	Question		= Trim(request("Question"))
	Answer			= Trim(request("Answer"))
	Sex				= Trim(Request("Sex"))
	UserEmail		= Trim(request("UserEmail"))
	UserHome		= Trim(request("UserHome"))
	UserQQ			= Trim(request("UserQQ"))
	UserMSN			= Trim(request("UserMSN"))
	UserLevel		= Trim(request("UserLevel"))
	LockUser		= Trim(request("LockUser"))
	ChargeType		= Trim(request("ChargeType"))
	UserPoint		= Cl.ChkClng(request("UserPoint"))
	UserMoney		= Cl.ChkClng(request("UserMoney"))
	BeginDate		= Trim(request("BeginDate"))
	Valid_Num		= Cl.ChkClng(request("Valid_Num"))
	UserTelePhone	= Trim(request("UserTelePhone"))
	UserAddRess		= Trim(request("UserAddRess"))
	UserReMark		= Trim(request("UserReMark"))
	IDCard			= Trim(request("IDCard"))
	BirthDay		= Trim(request("BirthDay"))
	CityInfo		= sRIM(Trim(request("Country")))&"|||"&sRIM(Trim(request("Province")))&"|||"&sRIM(Trim(request("City")))
	CityInfo		= Server.HTMLencode(CityInfo)
	ZipCode			= Trim(Request("ZipCode"))
	SchoolAge		= Trim(request("SchoolAge"))
	UserWorking		= Trim(request("UserWorking"))
	UserHomePhone	= Trim(request("UserHomePhone"))
	UserMobile		= Trim(request("UserMobile"))
	if UserName="" or Cl.strLength(UserName)>14 or Cl.strLength(UserName)<4 then
		founderr=true
		errmsg=errmsg & "<br><li>请输入用户名(不能大于14小于4)</li>"
	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+"<br><li>用户名中含有非法字符</li>"
			founderr=true
		end if
	end if
	if Password="" or Cl.strLength(Password)>12 or Cl.strLength(Password)<6 then
		founderr=true
		errmsg=errmsg & "<br><li>请输入密码(不能大于12小于6)</li>"
	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+"<br><li>密码中含有非法字符</li>"
			founderr=true
		end if
	end if
	if PwdConfirm="" then
		founderr=true
		errmsg=errmsg & "<br><li>请输入确认密码(不能大于12小于6)</li>"
	else
		if Password<>PwdConfirm then
			founderr=true
			errmsg=errmsg & "<br><li>密码和确认密码不一致</li>"
		end if
	end if
	if Question="" then
		founderr=true
		errmsg=errmsg & "<br><li>密码提示问题不能为空</li>"
	end if
	if Answer="" then
		founderr=true
		errmsg=errmsg & "<br><li>密码答案不能为空</li>"
	end if
	if Sex="" then
		founderr=true
		errmsg=errmsg & "<br><li>性别不能为空</li>"
	else
		sex=cint(sex)
		if Sex<>0 and Sex<>1 then
			Sex=1
		end if
	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 UserLevel="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定用户级别！</li>"
	else
		UserLevel=CLng(UserLevel)
	end if
	if LockUser<>0 then LockUser=1
	if ChargeType="" then
		ChargeType=1
	else
		ChargeType=Clng(ChargeType)
	end if
	if BeginDate="" then
		BeginDate=Now()
	else
		BeginDate=Cdate(BeginDate)
	end if
	if BirthDay<>"" then
		if Not IsDate(BirthDay) 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 Founderr=True then Admin_ShowErr(ErrMsg)
	dim sqlReg,rsReg
	sqlReg="select * from " & Db.UserTable & " Where " & Db.UserName & "='" & Username & "'"
	set rsReg=server.createobject("adodb.recordset")
	OpenConn_U : rsReg.open sqlReg,Conn_U,1,3
	if not(rsReg.bof and rsReg.eof) then
		Admin_ShowErr("<br><li>你注册的用户已经存在！请换一个用户名再试试！</li>")
	else
		rsReg.addnew
		rsReg(Db.UserName)		= UserName
		rsReg("UserReName")		= UserReName
		rsReg(Db.UserPassword)	= md5(Password,16)
		rsReg(Db.UserEmail)		= UserEmail
        if UserTableType = "Bbsxp" then
			rsReg(Db.UserHomePage)=UserHome
			rsReg(Db.UserIM)	=""& Trim(request("UserQQ")) &"\"& Trim(request("UserIcq")) &"\"& Trim(request("UserUC")) &"\"& Trim(request("UserAim")) &"\"& Trim(request("UserMsn")) &"\"& Trim(request("UserYahoo")) &""
			if Sex=0 then
				Sex="female"
			else
				Sex="male"
			end if
		else
			rsReg(Db.UserIM)	=""& Trim(request("Userhome")) &"|||"& Trim(request("UserQQ")) &"|||"& Trim(request("UserIcq")) &"|||"& Trim(request("UserMsn")) &"|||"& Trim(request("UserAim")) &"|||"& Trim(request("UserYahoo")) &"|||"& Trim(request("UserUC")) &""
		end if
		rsReg(Db.UserSex)		= Sex
		rsReg(Db.UserLevel)		= UserLevel
		rsReg(Db.UserLock)		= LockUser
		rsReg("UserBirthday")	= Birthday
		rsReg(Db.UserQuestion)	= Question
		rsReg(Db.UserAnswer)	= md5(Answer,16)
		rsReg(Db.UserJoinDate)	= Now()
		rsReg(Db.ChargeType)	= ChargeType
		rsReg(Db.UserPoint)		= UserPoint
		rsReg(Db.UserMoney)		= UserMoney
		rsReg(Db.BeginDate)		= BeginDate
		rsReg(Db.ValidNum)		= Valid_Num
		rsReg(Db.UserFace)		= ""
		rsReg(Db.UserFaceWidth) = 60
		rsReg(Db.UserFaceHeight)= 60
		rsReg("UserTelePhone")	= UserTelePhone
		rsReg("UserHomePhone")	= UserHomePhone
		rsReg("UserMobile")		= UserMobile
		rsReg("CityInfo")		= CityInfo
		rsReg("UserAddRess")	= UserAddRess
		rsReg("UserWorking")	= UserWorking
		rsReg("IDCard")			= IDCard
		rsReg("ZipCode")		= ZipCode
		rsReg("SchoolAge")		= SchoolAge
		rsReg("UserReMark")		= UserReMark
		rsReg.update
	end if
	rsReg.close : set rsReg=Nothing
	Cl.SaveAdminLog
	Call Cl.OutMsg("恭喜您，添加成功！请按确定返回！","Admin_User.asp")
	'esponse.Redirect "Admin_User.asp"
End Sub

Sub AddMoreUser()
%>
<script language=javascript>
function CheckFrom()
{
  if(document.myform.UserName.value=="")
    {
      alert("用户名不能为空！");
	  document.myform.UserName.focus();
      return false;
    }

  if(document.myform.Question.value=="")
    {
      alert("密码问题不能为空！");
	  document.myform.Question.focus();
      return false;
    }
  if(document.myform.Answer.value=="")
    {
      alert("密码答案不能为空！");
	  document.myform.Answer.focus();
      return false;
    }
  if(document.myform.UserEmail.value=="")
    {
      alert("用户Email不能为空！");
	  document.myform.UserEmail.focus();
      return false;
    }
  if(document.myform.Password.value=="")
    {
      alert("密码不能为空！");
	  document.myform.Password.focus();
      return false;
    }
    
  if((document.myform.Password.value)!=(document.myform.PwdConfirm.value))
    {
      alert("初始密码与确认密码不同！");
	  document.myform.PwdConfirm.select();
	  document.myform.PwdConfirm.focus();	  
      return false;
    }
}
</script>
<script language="JavaScript" src="../Inc/Js/selectdate.js"></script>
<script language="JavaScript" src="../Inc/Js/selectcity.js"></script>
  <table width="100%" align="center" border=0 cellpadding=0 cellspacing=1 class="border">
<form name="myform" action="Admin_User.asp" method="post" onSubmit="return CheckFrom();">
    <TR align=center> 
      <TD height=22 colSpan=4 class='title'><font class=en><b>添 加 新 用 户</b></font></TD>
    </TR>
	<TR class="tdbg">
		<TD width="80" height="25" align="right"><strong>用户名称：</strong></TD>
		<TD Colspan=3><textarea Name="UserName" id="UserName" cols="80" rows="10"></textarea><br>
		<a href="javascript:admin_Size(-5,'UserName')"><img src="images/minus.gif" unselectable="on" border='0'></a> <a href="javascript:admin_Size(5,'UserName')"><img src="images/plus.gif" unselectable="on" border='0'></a> 注：每一个用户用回车分隔，用户名与真实姓名之间用|分隔</TD>
	</TR>
		<TR Class="tdbg"> 
			<TD width="80" height="25" align="right"><strong>用户密码：</strong></TD>
			<TD height="25"><INPUT type="password" name="Password" style="width:190" value="" size="30" maxLength="12"> <font color="red">*</font></TD>
			<TD width="80" height="25" align="right"><strong>重复密码：</strong></TD>
			<TD height="25"><INPUT type="password" name="PwdConfirm" style="width:190" value="" size="30" maxLength="12"> <font color="red">*</font></TD>
		</TR>
    <TR class="tdbg" > 
		<TD width="80" height="25" align="right"><strong>密码问题：</strong></TD>
		<TD><INPUT   type=text maxLength=50 size=30 style="width:190" name="Question"> 
        <font color="#FF6600">*</font> </TD>
		<TD width="80" height="25" align="right"><strong>问题答案：</strong></TD>
		<TD><INPUT   type=text maxLength=20 size=30 style="width:190" name="Answer"> 
        <font color="#FF6600">*</font> </TD>
    </TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>用户性别：</strong></TD>
			<TD height="25"> <INPUT type=radio value="1" name=sex CHECKED> 男 &nbsp;&nbsp; <INPUT type=radio value="0" name=sex> 女</TD>
		<TD width="80" height="25" align="right"><strong>用户等级：</strong></TD>
		<TD> <select name="UserLevel" id="UserLevel" style="width:190">
          <%=Cl.UserGroup_Option(4)%>
        </select></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>用户邮箱：</strong></TD>
		<TD> <Input Name="UserEmail" type=text size=30 style="width:190" Value=""> <font color="#FF6600">*</font></TD>
		<TD width="80" height="25" align="right"><strong>用户主页：</strong></TD>
		<TD> <Input Name="UserHome" type=text size=30 style="width:190" Value=""></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>用户QQ：</strong></TD>
		<TD> <Input Name="UserQQ" type=text size=30 style="width:190" Value=""></TD>
		<TD width="80" height="25" align="right"><strong>用户ICQ：</strong></TD>
		<TD> <Input Name="UserICQ" type=text size=30 style="width:190" Value=""></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>用户MSN：</strong></TD>
		<TD> <Input Name="UserMSN" type=text size=30 style="width:190" Value=""></TD>
		<TD width="80" height="25" align="right"><strong>AIM号码：</strong></TD>
		<TD><Input Name="UserAIM" type=text size=30 style="width:190" Value=""></TD>
	</TR>
	<TR Class="tdbg" >
		<TD width="80" height="25" align="right"><strong>yahoo帐号：</strong></TD>
		<TD><Input Name="UserYahoo" type=text size=30 style="width:190" Value=""></TD>
		<TD width="80" height="25" align="right"><strong>UC号码：</strong></TD>
		<TD><Input Name="UserUC" type=text size=30 style="width:190" Value=""></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>国家/省/市：</strong></TD>
		<TD ColSpan=3><input type=text name=Country size=18 maxLength=50 value="中国"> / <input type=text name=Province size=10 maxLength=50 value="">
			<select name="selectp" onChange="selectcityarea('selectp','selectc','myform');myform.Province.value=this.value;">
			<option value="0" selected>请选择....</option>
			</select> / <input type=text name=City size=10 maxLength=50 value="">
			<select name="selectc" onChange="myform.City.value=this.value;">
			<option value="0" selected>请选择....</option>
			</select></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>出生日期：</strong></TD>
		<TD><Input Name="BirthDay" type=text size=30 style="width:190" Value="" onfocus="show_cele_date(BirthDay,'','',BirthDay)"></TD>
		<TD width="80" height="25" align="right"><strong>身份证号：</strong></TD>
		<TD><Input Name="IDCard" type=text size=30 style="width:190" Value=""></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>工作单位：</strong></TD>
		<TD><Input Name="UserWorking" type=text size=30 style="width:190" Value=""></TD>
		<TD width="80" height="25" align="right"><strong>教育程度：</strong></TD>
		<TD><select name="SchoolAge" style="width:190">
			<option value="" selected>请选择....</option>
			<option value="大专以下">大专以下</option>
			<option value="大专">大专</option>
			<option value="本科">本科</option>
			<option value="本科以上">本科以上</option>
			</select></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>住宅电话：</strong></TD>
		<TD><Input Name="UserHomePhone" type=text size=30 style="width:190" Value=""></TD>
		<TD width="80" height="25" align="right"><strong>手机号码：</strong></TD>
		<TD><Input Name="UserMobile" type=text size=30 style="width:190" Value=""></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>办公电话：</strong></TD>
		<TD><Input Name="UserTelePhone" type=text size=30 style="width:190" Value=""></TD>
		<TD width="80" height="25" align="right"><strong>邮政编码：</strong></TD>
		<TD><Input Name="ZipCode" type=text size=30 style="width:190" Value=""></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>联系地址：</strong></TD>
		<TD ColSpan=3><Input Name="UserAddRess" type=text size=88 Value=""></TD>
	</TR>
    <TR class="tdbg" >
		<TD width="80" height="25" align="right"><strong>计费方式：</strong></TD>
		<TD Colspan=3><input name="ChargeType" type="radio" value="1" checked>
        扣<%=Cl.Web_Setting(28)%><font color="#0066CC">（推荐）</font>：&nbsp;每阅读一篇收费文章，扣除相应<%=Cl.Web_Setting(28)%>。&nbsp;<br>
        <input type="radio" name="ChargeType" value="2">
        有效期：在有效期内，用户可以任意阅读收费内容</TD>
    </TR>
    <TR class="tdbg" >
		<TD width="80" height="25" align="right"><strong>有效期限：</strong></TD>
		<TD Colspan=3>开始日期：
        <input name="BeginDate" type="text" id="BeginDate" value="<%=FormatdateTime(now(),2)%>" size="20" maxlength="20"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;有 效 期：
      <input name="Valid_Num" type="text" id="Valid_Num" value="1" size="10" maxlength="10">
      <select name="Valid_Unit" id="Valid_Unit">
      <option value="1">天</option>
      <option value="2">月</option>
      <option value="3" selected>年</option>
      </select>
	  <br>
        若超过此期限，则用户不能阅读收费内容此功能只有当计费方式为“有效期限”时才有效
      </TD>
    </TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>用户<%=Cl.Web_Setting(28)%>：</strong></TD>
		<TD> <Input Name="UserPoint" type=text size=30 style="width:190" Value="0"></TD>
		<TD width="80" height="25" align="right"><strong>用户<%=Cl.Web_Setting(26)%>：</strong></TD>
		<TD> <Input Name="UserMoney" type=text size=30 style="width:190" Value="0"></TD>
	</TR>
	<TR class="tdbg"> 
		<TD width="80" height="25" align="right"><strong>备注：</strong></TD>
		<TD ColSpan=3><textarea Name="UserReMark" id="UserReMark" cols="80" rows="5"></textarea><br>
		<a href="javascript:admin_Size(-5,'UserReMark')"><img src="images/minus.gif" unselectable="on" border='0'></a> <a href="javascript:admin_Size(5,'UserReMark')"><img src="images/plus.gif" unselectable="on" border='0'></a></TD>
	</TR>
    <TR class="tdbg" > 
		<TD width="80" height="25" align="right"><strong>用户状态：</strong></TD>
		<TD ColSpan=3><input name="LockUser" type="radio" value="0" checked>
        正常&nbsp;&nbsp; <input type="radio" name="LockUser" value="1">
        锁定</TD>
    </TR>
    <TR align="center" class="tdbg" > 
      <TD colspan="4"><input name="Action" type="hidden" id="Action" value="SaveAddMore">
        <input type="Submit" name="Submit" value=" 添&nbsp;&nbsp;加 " ></TD>
    </TR>
</form>
  </TABLE>
  <script language=javascript>
first("selectp","selectc","myform",0,0);
</script>
<%
End Sub
Sub SaveAddMore()
	dim UserName,UserReName,Password,PwdConfirm,Question,Answer,Sex,UserEmail,UserHome,UserQQ,UserMSN,UserLevel,LockUser,ChargeType,UserPoint,UserMoney,BeginDate,Valid_Num,Valid_Unit
	dim UserTelePhone,UserAddRess,UserReMark
	dim IDCard,BirthDay,CityInfo,ZipCode
	Dim SchoolAge,UserWorking,UserHomePhone,UserMobile
	UserName		= Trim(request("UserName"))
	UserReName		= Trim(request("UserReName"))
	Password		= Trim(request("Password"))
	PwdConfirm		= Trim(request("PwdConfirm"))
	Question		= Trim(request("Question"))
	Answer			= Trim(request("Answer"))
	Sex				= Trim(Request("Sex"))
	UserEmail		= Trim(request("UserEmail"))
	UserHome		= Trim(request("UserHome"))
	UserQQ			= Trim(request("UserQQ"))
	UserMSN			= Trim(request("UserMSN"))
	UserLevel		= Trim(request("UserLevel"))
	LockUser		= Trim(request("LockUser"))
	ChargeType		= Trim(request("ChargeType"))
	UserPoint		= Cl.ChkClng(request("UserPoint"))
	UserMoney		= Cl.ChkClng(request("UserMoney"))
	BeginDate		= Trim(request("BeginDate"))
	Valid_Num		= Cl.ChkClng(request("Valid_Num"))
	UserTelePhone	= Trim(request("UserTelePhone"))
	UserAddRess		= Trim(request("UserAddRess"))
	UserReMark		= Trim(request("UserReMark"))
	IDCard			= Trim(request("IDCard"))
	BirthDay		= Trim(request("BirthDay"))
	CityInfo		= sRIM(Trim(request("Country")))&"|||"&sRIM(Trim(request("Province")))&"|||"&sRIM(Trim(request("City")))
	CityInfo		= Server.HTMLencode(CityInfo)
	ZipCode			= Trim(Request("ZipCode"))
	SchoolAge		= Trim(request("SchoolAge"))
	UserWorking		= Trim(request("UserWorking"))
	UserHomePhone	= Trim(request("UserHomePhone"))
	UserMobile		= Trim(request("UserMobile"))
	if Password="" or Cl.strLength(Password)>12 or Cl.strLength(Password)<6 then
		founderr=true
		errmsg=errmsg & "<br><li>请输入密码(不能大于12小于6)</li>"
	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+"<br><li>密码中含有非法字符</li>"
			founderr=true
		end if
	end if
	if PwdConfirm="" then
		founderr=true
		errmsg=errmsg & "<br><li>请输入确认密码(不能大于12小于6)</li>"
	else
		if Password<>PwdConfirm then
			founderr=true
			errmsg=errmsg & "<br><li>密码和确认密码不一致</li>"
		end if
	end if
	if Question="" then
		founderr=true
		errmsg=errmsg & "<br><li>密码提示问题不能为空</li>"
	end if
	if Answer="" then
		founderr=true
		errmsg=errmsg & "<br><li>密码答案不能为空</li>"
	end if
	if Sex="" then
		founderr=true
		errmsg=errmsg & "<br><li>性别不能为空</li>"
	else
		sex=cint(sex)
		if Sex<>0 and Sex<>1 then
			Sex=1
		end if
	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 UserLevel="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定用户级别！</li>"
	else
		UserLevel=CLng(UserLevel)
	end if
	if LockUser<>0 then LockUser=1
	if ChargeType="" then
		ChargeType=1
	else
		ChargeType=Clng(ChargeType)
	end if
	if BeginDate="" then
		BeginDate=Now()
	else
		BeginDate=Cdate(BeginDate)
	end if
	if BirthDay<>"" then
		if Not IsDate(BirthDay) 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 Founderr=True then Admin_ShowErr(ErrMsg)
	dim sqlReg,rsReg
	Dim NameStr,Msg1,Msg2
	NameStr=Split(UserName,VbCrlf)
	Password= md5(Password,16)
	Answer	= md5(Answer,16)
	OpenConn_U
	For i=0 to Ubound(NameStr)
	NameStr(i)=Trim(NameStr(i))
	set rsReg=server.createobject("adodb.recordset")
	If NameStr(i)<>"" then
		if Instr(NameStr(i),"|")>0 then
			UserName=Trim(Split(NameStr(i),"|")(0))
			UserReName=Trim(Split(NameStr(i),"|")(1))
		else
			UserName=NameStr(i)
			UserReName=""
		end if
		sqlReg="Select * from " & Db.UserTable & " Where " & Db.UserName & "='" & Username & "'"
		rsReg.open sqlReg,Conn_U,1,3
		if not(rsReg.bof and rsReg.eof) then
			Msg2=Msg2 & "\n[" & Username & "]"
		else
			rsReg.addnew
			rsReg(Db.UserName)		= UserName
			rsReg("UserReName")		= UserReName
			rsReg(Db.UserPassword)	= Password
			rsReg(Db.UserEmail)		= UserEmail
			rsReg(Db.UserIM)	=""& Trim(request("Userhome")) &"|||"& Trim(request("UserQQ")) &"|||"& Trim(request("UserIcq")) &"|||"& Trim(request("UserMsn")) &"|||"& Trim(request("UserAim")) &"|||"& Trim(request("UserYahoo")) &"|||"& Trim(request("UserUC")) &""
			rsReg(Db.UserSex)		= Sex
			rsReg(Db.UserLevel)		= UserLevel
			rsReg(Db.UserLock)		= LockUser
			rsReg("UserBirthday")	= Birthday
			rsReg(Db.UserQuestion)	= Question
			rsReg(Db.UserAnswer)	= Answer
			rsReg(Db.UserJoinDate)	= Now()
			rsReg(Db.ChargeType)	= ChargeType
			rsReg(Db.UserPoint)		= UserPoint
			rsReg(Db.UserMoney)		= UserMoney
			rsReg(Db.BeginDate)		= BeginDate
			rsReg(Db.ValidNum)		= Valid_Num
			rsReg(Db.UserFace)		= ""
			rsReg(Db.UserFaceWidth) = 60
			rsReg(Db.UserFaceHeight)= 60
			rsReg("UserTelePhone")	= UserTelePhone
			rsReg("UserHomePhone")	= UserHomePhone
			rsReg("UserMobile")		= UserMobile
			rsReg("CityInfo")		= CityInfo
			rsReg("UserAddRess")	= UserAddRess
			rsReg("UserWorking")	= UserWorking
			rsReg("IDCard")			= IDCard
			rsReg("ZipCode")		= ZipCode
			rsReg("SchoolAge")		= SchoolAge
			rsReg("UserReMark")		= UserReMark
			rsReg.update
			Msg1=Msg1 & "\n[" & Username & "]"
		end if
		rsReg.close
	End if
	Next
	set rsReg=Nothing
	Cl.SaveAdminLog
	Call Cl.OutMsg("添加用户：" & Msg1 & "\n成攻!\n添加用户：" & Msg2 & "\n失败!","Admin_User.asp")
	'esponse.Redirect "Admin_User.asp"
End Sub		
Sub SaveModify()
	Dim rsUser,sqlUser
	Dim UserID,UserName,UserReName,Password,PwdConfirm,Question,Answer,Sex,UserEmail
	Dim UserLevel,LockUser,DataCount,ChargeType,UserPoint,UserMoney,BeginDate,Valid_Num,Valid_Unit
	Dim UserTelePhone,UserAddRess,UserReMark,IDCard,BirthDay,CityInfo,ZipCode
	Dim UserHome,UserQQ,UserMSN,SchoolAge,UserWorking,UserHomePhone,UserMobile,IsReName,OldUserName
	Action		= Trim(request("Action"))
	UserID		= Cl.ChkClng(request("UserID"))
	if UserID=0 then Admin_ShowErr("<br><li>参数不足！</li>")
	UserName	= Trim(request("UserName"))
	Password	= Trim(request("Password"))
	PwdConfirm	= Trim(request("PwdConfirm"))
	Question	= Trim(request("Question"))
	Answer		= Trim(request("Answer"))
	Sex			= Trim(Request("Sex"))
	UserEmail	= Trim(request("UserEmail"))
	UserHome	= Trim(request("UserHome"))
	UserQQ		= Trim(request("UserQQ"))
	UserMSN		= Trim(request("UserMSN"))
	UserLevel	= Cl.ChkClng(request("UserLevel"))
	LockUser	= Cl.ChkClng(request("LockUser"))
	DataCount	= Cl.ChkClng(request("DataCount"))
	ChargeType	= Cl.ChkClng(request("ChargeType"))
	UserPoint	= Cl.ChkClng(request("UserPoint"))
	UserMoney	= Cl.ChkClng(request("UserMoney"))
	BeginDate	= Trim(request("BeginDate"))
	Valid_Num	= Cl.ChkClng(request("Valid_Num"))
	UserReName	= Trim(request("UserReName"))
	UserTelePhone=Trim(request("UserTelePhone"))
	UserAddRess	= Trim(request("UserAddRess"))
	UserReMark	= Trim(request("UserReMark"))
	IDCard		= Trim(request("IDCard"))
	BirthDay	= Trim(request("BirthDay"))
	CityInfo	= Server.HTMLencode(sRIM(Trim(request("Country")))&"|||"&sRIM(Trim(request("Province")))&"|||"&sRIM(Trim(request("City"))))
	ZipCode		= Trim(Request("ZipCode"))
	SchoolAge	= Trim(request("SchoolAge"))
	UserWorking	= Trim(request("UserWorking"))
	UserHomePhone=Trim(request("UserHomePhone"))
	UserMobile	= Trim(request("UserMobile"))
	IsReName	= Trim(request("IsReName"))
	Set rsUser=Server.CreateObject("Adodb.RecordSet")
	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
		Admin_ShowErr("<br><li>找不到指定的用户！</li>")
	end if
	if Password<>"" then
		if Cl.strLength(Password)>12 or Cl.strLength(Password)<6 then 
			founderr=true 
			errmsg=errmsg & "<br><li>密码不能大于12小于6，如果你不想修改密码，请保持为空。</li>"
		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+"<br><li>密码中含有非法字符，如果你不想修改密码，请保持为空。</li>"
			founderr=true
		end if
	end if
	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 Sex="" then
		founderr=true
		errmsg=errmsg & "<br><li>性别不能为空</li>"
	else
		Sex=Cint(Sex)
		if Sex<>0 and Sex<>1 then Sex=1
	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 LockUser<>0 then LockUser=1
	if ChargeType=0 then ChargeType=1
	if BeginDate="" then
		BeginDate=Now()
	else
		BeginDate=Cdate(BeginDate)
	end if
	if BirthDay<>"" then
		if Not IsDate(BirthDay) 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 Founderr=True then Admin_ShowErr(ErrMsg)
	OldUserName=rsUser(Db.UserName)
	if UserName<>OldUserName and IsReName="yes" then
		if UserName="" then Admin_ShowErr("<br><li>用户名不能为空！</li>")
		Dim RsC
		Set RsC=Cl.Execute("Select " & Db.UserID & " From " & Db.UserTable & " Where " & Db.UserName & "='" & UserName & "'")
		if Not (RsC.Bof and RsC.Eof) then Admin_ShowErr("<br><li>数据库中已经存在着用户名“"&UserName&"”！</li>")
		RsC.Close : Set RsC=Nothing
		Cl.Execute("Update [Cl_Admin] Set AddUser='" & UserName & "' Where AddUser='" & OldUserName & "'")
		Cl.Execute("Update [Cl_Article] Set Editor='" & UserName & "' Where Editor='" & OldUserName & "'")
		Cl.Execute("Update [Cl_Soft] Set Editor='" & UserName & "' Where Editor='" & OldUserName & "'")
		Cl.Execute("Update [Cl_Photo] Set Editor='" & UserName & "' Where Editor='" & OldUserName & "'")
		Cl.Execute("Update [Cl_Movie] Set Editor='" & UserName & "' Where Editor='" & OldUserName & "'")
		Cl.Execute("Update [Cl_Product] Set Editor='" & UserName & "' Where Editor='" & OldUserName & "'")
		Cl.Execute("Update [Cl_Comment] Set UserName='" & UserName & "' Where UserName='" & OldUserName & "'")
		Cl.Execute("Update [Cl_Friend] Set F_username='" & UserName & "' Where F_username='" & OldUserName & "'")
		Cl.Execute("Update [Cl_Guest] Set GuestName='" & UserName & "' Where GuestName='" & OldUserName & "'")
		Cl.Execute("Update [Cl_UpFileLog] Set UserName='" & UserName & "' Where UserName='" & OldUserName & "'")
		Cl.Execute("Update [Cl_UserCz] Set UserName='" & UserName & "' Where UserName='" & OldUserName & "'") 
		Cl.Execute("Update [Cl_Favorite] Set UserName='" & UserName & "' Where UserName='" & OldUserName & "'")
		if SysTemVersion>2 then Cl.Execute("Update [Cl_Order] Set UserName='" & UserName & "' Where UserName='" & OldUserName & "'")
		rsUser(Db.UserName)	= UserName
	End if
	rsUser("UserReName")	= UserReName
	if Password<>"" then
		rsUser(Db.UserPassword)=md5(Password,16)
	end if
	rsUser(Db.UserQuestion)	= Question
	if Answer<>rsUser(Db.UserAnswer) then
		rsUser(Db.UserAnswer)=md5(Answer,16)
	end if
	rsUser(Db.UserEmail)	= UserEmail
    if UserTableType = "Bbsxp" then
	rsUser(Db.UserHomePage)	= UserHome
	rsUser(Db.UserIM)		= ""& Trim(request("UserQQ")) &"\"& Trim(request("UserIcq")) &"\"& Trim(request("UserUC")) &"\"& Trim(request("UserAim")) &"\"& Trim(request("UserMsn")) &"\"& Trim(request("UserYahoo")) &""
		if Sex=0 then
			Sex="female"
		else
			Sex="male"
		end if
	else
	rsUser(Db.UserIM)		= ""& Trim(request("Userhome")) &"|||"& Trim(request("UserQQ")) &"|||"& Trim(request("UserIcq")) &"|||"& Trim(request("UserMsn")) &"|||"& Trim(request("UserAim")) &"|||"& Trim(request("UserYahoo")) &"|||"& Trim(request("UserUC")) &""
	end if
	rsUser(Db.UserSex)		= Sex
	rsUser(Db.UserLevel)	= UserLevel
	rsUser(Db.UserLock)		= LockUser
	rsUser(Db.UserDataNum)	= DataCount
	rsUser(Db.ChargeType)	= ChargeType
	rsUser(Db.UserPoint)	= UserPoint
	rsUser(Db.UserMoney)	= UserMoney
	rsUser(Db.BeginDate)	= BeginDate
	rsUser(Db.ValidNum)		= Valid_Num
	rsUser("UserTelePhone")	= UserTelePhone
	rsUser("UserAddRess")	= UserAddRess
	rsUser("UserReMark")	= UserReMark
	rsUser("UserBirthday")	= Birthday
	rsUser("IDCard")		= IDCard
	rsUser("CityInfo")		= CityInfo
	rsUser("ZipCode")		= ZipCode
	rsUser("SchoolAge")		= SchoolAge
	rsUser("UserWorking")	= UserWorking
	rsUser("UserHomePhone") = UserHomePhone
	rsUser("UserMobile")	= UserMobile
	rsUser.update
	rsUser.Close : Set rsUser=Nothing
	Cl.SaveAdminLog
	Call Cl.OutMsg("恭喜您，修改成功！请按确定返回！",ComeUrl)
	'response.redirect ComeUrl'"Admin_User.asp"
End Sub

Sub SaveAddMoney()
	dim UserID,ChargeType,UserPoint,Valid_Num,Valid_Unit
	dim rsUser,sqlUser
	Action=Trim(request("Action"))
	UserID=Cl.ChkClng(request("UserID"))
	if UserID=0 then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>参数不足！</li>"
		exit Sub
	end if
	ChargeType	= Trim(request("ChargeType"))
	UserPoint	= Cl.ChkClng(request("UserPoint"))
	Valid_Num	= Cl.ChkClng(request("Valid_Num"))
	Valid_Unit	= Trim(request("Valid_Unit"))

	if ChargeType="" then
		ChargeType=1
	else
		ChargeType=Clng(ChargeType)
	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 & "<br><li>请输入要追加的用户"&Cl.Web_Setting(28)&"！</li>"
	end if
	if ChargeType=2 and Valid_Num=0 then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请输入要追加的天数</li>"
	end if

	if Founderr=true then Admin_ShowErr(ErrMsg)
	Set rsUser=Server.CreateObject("Adodb.RecordSet")
	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
		Admin_ShowErr("<br><li>找不到指定的用户！</li>")
	end if
	if ChargeType=1 then
		rsUser(Db.UserPoint)=rsUser(Db.UserPoint)+UserPoint
	else
		ValidDays	=rsUser(Db.ValidNum)
		tmpDays		=ValidDays-DateDiff("D",rsUser(Db.BeginDate),now())
		if tmpDays>0 then
			rsUser(Db.ValidNum)	=rsUser(Db.ValidNum)+Valid_Num
		else
			rsUser(Db.BeginDate)=SqlNowString_U
			rsUser(Db.ValidNum)	=Valid_Num
		end if
	end if
	rsUser.update
	rsUser.Close : Set rsUser=Nothing
	Cl.SaveAdminLog
	response.redirect "Admin_User.asp"
End Sub

Sub DelUser()
	if UserID="" then
		Admin_ShowErr("<br><li>请指定要删除的用户</li>")
	end if
	if instr(UserID,",")>0 then
		UserID=replace(UserID," ","")
		sql="delete * from " & Db.UserTable & " Where UserID in (" & UserID & ")"
	else
		UserID=Cl.ChkClng(UserID)
		sql="delete * from " & Db.UserTable & " Where UserID=" & UserID
	end if
	Cl.Execute_U sql
	Cl.SaveAdminLog
	response.redirect ComeUrl
End Sub

Sub LockUser()
	if UserID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请选择要锁定的用户</li>"
		exit Sub
	end if
	if instr(UserID,",")>0 then
		UserID=replace(UserID," ","")
		sql="Update " & Db.UserTable & " set " & Db.UserLock & "=1 Where UserID in (" & UserID & ")"
	else
		UserID=Cl.ChkClng(UserID)
		sql="Update " & Db.UserTable & " set " & Db.UserLock & "=1 Where UserID=" & UserID
	end if
	Cl.Execute_U sql
	Cl.SaveAdminLog
	response.redirect ComeUrl
End Sub

Sub UnLockUser()
	if UserID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定要解锁的用户</li>"
		exit Sub
	end if
	if instr(UserID,",")>0 then
		UserID=replace(UserID," ","")
		sql="Update " & Db.UserTable & " set " & Db.UserLock & "=0 Where UserID in (" & UserID & ")"
	else
		UserID=Cl.ChkClng(UserID)
		sql="Update " & Db.UserTable & " set " & Db.UserLock & "=0 Where UserID=" & UserID
	end if
	Cl.Execute_U sql
	Cl.SaveAdminLog
	response.redirect ComeUrl
End Sub

Sub MoveUser()
	Dim RsGroup
	Dim sGroupName,sChargeType,sValidDays,sGroupPoint
	Dim UserLevel
	if UserID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定要移动的用户</li>"
		Exit Sub
	end if
	UserLevel=Cl.ChkClng(request("UserLevel"))
	if UserLevel=0 then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定目标用户组</li>"
		Exit Sub
	end if
	UserID=replace(UserID," ","")
	Set RsGroup=Cl.Execute("Select GroupName,ChargeType,ValidDays,GroupPoint From Cl_UserGroup Where ID="&UserLevel&"")
	if Not (RsGroup.Bof and RsGroup.Eof) then
		sGroupName	= RsGroup(0)
		sChargeType	= RsGroup(1)
		sValidDays	= RsGroup(2)
		sGroupPoint	= RsGroup(3)
	else
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定目标用户组</li>"
		Exit Sub
	end if
	RsGroup.Close : Set RsGroup=Nothing
	ErrMsg = "&nbsp;&nbsp;&nbsp;&nbsp;已经成功将选定用户设为“<font color=blue>"&sGroupName&"</font>”！并且按照用户组中预设值给设定了这些用户的计费方式、初始"&Cl.Web_Setting(28)&"、有效期等数据。"
	ErrMsg = ErrMsg & "<br><br>计费方式："
	if sChargeType=1 then
		ErrMsg = ErrMsg & "扣"&Cl.Web_Setting(28)&"<br>初始"&Cl.Web_Setting(28)&"：" & sGroupPoint & ""&Cl.Web_Setting(29)&""
	else
		ErrMsg = ErrMsg & "有效期<br>开始日期：" & now() & "<br>有 效 期：" & sValidDays & "天"
	end if
	Cl.Execute_U("Update " & Db.UserTable & " set " & Db.UserLevel & "=" & UserLevel & "," & Db.ChargeType & "=" & sChargeType & "," & Db.UserPoint & "=" & sGroupPoint & "," & Db.BeginDate & "=#" & formatdatetime(now(),2) & "#," & Db.ValidNum & "=" & sValidDays & " Where UserID in (" & UserID & ")")
	Cl.SaveAdminLog
	Response.Write Cl.ShowSuc(ErrMsg)
End Sub

Sub DoUpdate()
	dim sqlUser,rsUser,trs,sN
	BeginID=Trim(request("BeginID"))
	EndID=Trim(request("EndID"))
	if BeginID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定开始ID</li>"
	else
		BeginID=Clng(BeginID)
	end if
	if EndID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定结束ID</li>"
	else
		EndID=Clng(EndID)
	end if
	
	if FoundErr=True then exit Sub
	OpenConn_U
	Set rsUser=Server.CreateObject("Adodb.RecordSet")
	sqlUser="select * from " & Db.UserTable & " Where UserID>=" & BeginID & " and UserID<=" & EndID
	rsUser.Open sqlUser,Conn_U,1,3
	if rsUser.bof and rsUser.eof then
		Response.Write Cl.ShowSuc("所有用户已经更新完成！")
		Response.end
	end if
	do while not rsUser.eof
		sN=0
		set trs=Cl.Execute("select count(ArticleID) from Cl_Article Where Editor='" & rsUser(Db.UserName) & "'")
		if Not isNull(trs(0)) then sN=sN+trs(0)
		set trs=Cl.Execute("select count(SoftID) from Cl_Soft Where Editor='" & rsUser(Db.UserName) & "'")
		if Not isNull(trs(0)) then sN=sN+trs(0)
		set trs=Cl.Execute("select count(PhotoID) from Cl_Photo Where Editor='" & rsUser(Db.UserName) & "'")
		if Not isNull(trs(0)) then sN=sN+trs(0)
		set trs=Cl.Execute("select count(MovieID) from Cl_Movie Where Editor='" & rsUser(Db.UserName) & "'")
		if Not isNull(trs(0)) then sN=sN+trs(0)
		set trs=Cl.Execute("select count(ProductID) from Cl_Product Where Editor='" & rsUser(Db.UserName) & "'")
		if Not isNull(trs(0)) then sN=sN+trs(0)
		rsUser(Db.UserDataNum)=sN
		rsUser.update
		rsUser.movenext
	loop
	rsUser.close:set rsUser=Nothing
	Cl.SaveAdminLog
%>
<table width="100%" align="center" border="0" cellspacing="1" cellpadding="0" class="border">
  <tr class="tdbg"> 
      <td><strong>已经成功将ID(<%=BeginID%>-->ID(<%=EndID%>)的用户数据进行了更新！</strong></td>
  </tr>
</table>
<br>
<%
	Call UpdateUser()
End Sub

Function sRIM(s)
	Dim w
	w=Trim(s)
	If w<>"" and Not IsNull(w) Then 
		w=Replace(w,"|","")
		w=Replace(w,"\","")
	End If
	sRIM=w
End Function
%>
<%
'<!--
'┌───────────────────────────────────────────────────────┐
'│														 │
'│		CreateLive CMS Version 3.1						 │
'│　　　　　　　　				Powered by Aspoo.CN	 	 │
'│　		　　　　　　　　　　						 │
'│　	邮箱: aspoo@126.com			Info@aspoo.cn　　	 │
'│		ＱＱ: 3315263				596197794			 │
'│		网站: www.aspoo.cn			www.aspoo.com		 │
'│		论坛: bbs.aspoo.cn			bbs.aspoo.com		 │
'│														 │
'│	Copyright (C) 2005 Aspoo.CN All Rights Reserved.	 │
'└───────────────────────────────────────────────────────┘
'-->
%>
