<!--#include file="../fy.Function.asp"-->
<!--#include file="../../fy_inc/cls_pageview.asp"-->
<!doctype html>
<html>
<head>
<meta charset="gb2312">
<title>FY_cms_会员管理</title>
<link rel="stylesheet" type="text/css" href="../css/base.css">
<link rel="stylesheet" type="text/css" href="../css/content.css">
<script type='text/javascript' src='../../fy_inc/js/time/WdatePicker.js'></script>
</head>
<body>
<%
	If Not fycms.ChkAdmin() Then  Call fycms.Alert("对不起，您没有操作权限！","")

	Dim UserSearch,ShowErr,Action,UserID,Sql,ValidDays,tmpDays,EdaysFlag,UModeID,TableName,IF_NULL,i
	Action = Request("Action")
	UserID = Request("UserID")
 UModeID = ChkNumeric(Request("UModeID"))
 if UModeID=0   Then UModeID=1
	UserSearch = Request("UserSearch")
		
%>
<div class="content"> 
	<div class="breadnav">当前位置：<a href="#">后台首页</a> >> 会员管理</div>
    <div class="opers">
<A href="?UModeID=<%=UModeID%>" class="btn <%If UserSearch="" Then echo " btn_primary" %>">所有用户</A>
<A href="fy.e.asp?UModeID=<%=UModeID%>" class="btn">添加用户</A>
<A href="?UserSearch=1" class="btn <%If UserSearch="1" Then echo " btn_primary" %>">被锁住的用户</A>
<A href="?UserSearch=2" class="btn <%If UserSearch="2" Then echo " btn_primary" %>">待审批会员</A>
<A href="?UserSearch=3" class="btn <%If UserSearch="3" Then echo " btn_primary" %>">待邮件验证</A>
<A href="?UserSearch=4" class="btn <%If UserSearch="4" Then echo " btn_primary" %>">24小时内登录</A>
<A href="?UserSearch=5" class="btn <%If UserSearch="5" Then echo " btn_primary" %>">24小时内注册</A>

    </div>

	<% 
	  TableName=fycms.ACT_U(UModeID,2) 
  	Select Case Action
 			Case "Del"
				Call Del()
			Case "Lock"
				Call Locked()
			Case "UnLock"
				Call UnLocked()
			Case "Move"
				Call MoveUser()
			Case "UserSearch"
				Call UserSearch()
		    Case "AddZJ"
				Call AddZJ()
		    Case "SaveAddZJ"
				Call SaveAddZJ()
			Case "AddMoney"
				Call AddMoney()
			Case "SaveAddMoney"
				Call SaveAddMoney()
 			Case Else
				Call Main()
	End Select
	
	
	

		Sub SaveAddMoney()
			dim UserID,ChargeType,Point,Edays,rsUser,sqlUser,Reason,ErrMsg
			Dim Money:Money=Request("Money")
			If Not IsNumeric(Money) Then 
 				Call fycms.ActErr("减去的资金有误","","1")
				exit sub
			End if
			Action=Trim(request("Action"))
			UserID=ChkNumeric(request("UserID"))
			if UserID=0 then
 				Call fycms.ActErr("参数不足","","1")
				exit sub
			end if
			ChargeType=Trim(request("ChargeType"))
			Point=ChkNumeric(Trim(request("Point")))
			Edays=ChkNumeric(Trim(request("Edays")))
			Reason=Request("Reason")
		
			if ChargeType="" then
				ChargeType=1
			else
				ChargeType=Clng(ChargeType)
			end if
			
			if ChargeType=1 and Point=0 then
 				Call fycms.ActErr("请输入要追加的用户点数","","1")
			end if
			if ChargeType=2 and Edays=0 then
 				Call fycms.ActErr("请输入要追加的天数","","1")
			end if
		    if Reason="" Then
 				Call fycms.ActErr("请输入操作原因","","1")
 			end if
 			Set rsUser=Server.CreateObject("Adodb.RecordSet")
			sqlUser="select * from User_fy where UserID=" & UserID
			rsUser.Open sqlUser,Conn,1,3
			if rsUser.bof and rsUser.eof then
 				rsUser.close:set rsUser=Nothing
 				Call fycms.ActErr("找不到指定的用户","","1")
				exit sub
			end if
			If Round(rsUser("Money"))<Round(Money) Then
			  rsUser.close:set rsUser=Nothing
 				Call fycms.ActErr("该用户的可用资金不足","","1")
			 exit sub
			End If
			'rsUser("Money")=rsUser("Money")-Money
			if ChargeType<>"1" then
 				ValidDays=rsUser("Edays")
				tmpDays=ValidDays-DateDiff("D",rsUser("BeginDate"),now())
				if tmpDays>0 then
					rsUser("Edays")=rsUser("Edays")+Edays
				else
					rsUser("BeginDate")=now
					rsUser("Edays")=Edays
				end if
			end if
			rsUser.update
			
			'消费记录
			If Money>0 Then
			 if ChargeType=2 Then
			  Call fycms.MoneyInOrOut(rsUser("UserID"),rsUser("RealName"),Money,4,2,now,0,RSQL(Trim(Request.Cookies(fycmsN)("AdminName"))),"用于兑换有效天数",0,0)
			 else
			  Call fycms.MoneyInOrOut(rsUser("UserID"),rsUser("RealName"),Money,4,2,now,0,RSQL(Trim(Request.Cookies(fycmsN)("AdminName"))),"用于兑换点券",0,0)
			 end if
			end if
			
			if ChargeType=1 then
			 Call fycms.PointInOrOut(0,0,rsUser("UserID"),1,Point,RSQL(Trim(Request.Cookies(fycmsN)("AdminName"))),Reason,0)
			else
			 Call fycms.EdaysInOrOut(rsUser("UserID"),1,Edays,RSQL(Trim(Request.Cookies(fycmsN)("AdminName"))),Reason)
			end if
			rsUser.Close:set rsUser=Nothing
			Call fycms.ActErr("操作成功","User/index.asp","")
 			rsUser.Close:set rsUser=Nothing
 			Response.End
		end sub
		
 	
	
		'添加会员资金
		Sub AddZJ()
		dim rsUser,sqlUser
			UserID=ChkNumeric(UserID)
			if UserID=0 then echo("<script>alert('参数不足！');history.back();</script>")
			Set rsUser=Conn.Execute("select * from User_fy where UserID=" & UserID)
			if rsUser.bof and rsUser.eof then
				rsUser.close:set rsUser=Nothing
				Call fycms.ActErr("找不到指定的用户","","1")
				exit sub
			end if
		%>


		<FORM name="myform" action="?" method="post">
    <div class="divtable"> 
        <dl>
            <dt>用户名：</dt>
            <dd>
                <%=rsUser("UserName")%>
            </dd>
         </dl>
        
        <dl>
            <dt>可用资金：</dt>
            <dd>
               <%=rsUser("Money")%> 元
             </dd>
         </dl>
        <dl>
            <dt>用户级别：</dt>
            <dd>
               <%=fycms.act_g(rsUser("GroupID"),7) %>
             </dd>
         </dl>
        <dl>
            <dt>资金来源：</dt>
            <dd>
               <input name="MoneyType" type="radio" id="ChargeType" checked onclick="document.all.Remark.value='银行汇款';" value="2">银行汇款
			      <input name="MoneyType" type="radio" id="ChargeType" onclick="document.all.Remark.value='现金收取';" value="1">其它（如：现金）
             </dd>
         </dl>
        <dl>
            <dt>汇款日期：</dt>
            <dd>
               <input name="PayTime" type="text" id="PayTime"  onClick="WdatePicker()"  value="<%=formatdatetime(now,2)%>" size="15" class="Ainput">
             </dd>
         </dl>
        <dl>
            <dt>续费金额：</dt>
            <dd>
               <input name="Money" type="text" id="Money" value="100" size="15" class="Ainput">
			  元
             </dd>
         </dl>
        <dl>
            <dt>备注：</dt>
            <dd>
               <input name="Remark" type="text" id="Remark" value="银行汇款" size="55" class="Ainput">
             </dd>
         </dl>
 
            <dl>
            <dt class="vhid">提交：</dt>
            <dd><input name="Action" type="hidden" id="Action" value="SaveAddZJ"> 
			<input name="UserID" type="hidden" id="UserID" value="<%=rsUser("UserID")%>">
			<input name="Submit"  class='btn btn_primary' type="submit" id="Submit" value="&nbsp;保存续费结果&nbsp;" >
                
            </dd>
         </dl>
     </div>
    </form>
  		<%
			rsUser.close : set rsUser=Nothing
		End Sub	
	
	
	
	
			'保存续费
		sub SaveAddZJ()
			dim UserID,MoneyType,Money,PayTime,Remark,sqlUser,rsUser
			Action=Trim(request("Action"))
			UserID=ChkNumeric(request("UserID"))
			if UserID=0 then
				Call fycms.ActErr("参数不足","","1")
				exit sub
			end if
			MoneyType=Trim(request("MoneyType"))
			Money=fycms.s("Money")
			PayTime=fycms.s("PayTime")
			Remark=fycms.s("Remark")
            If Not IsDate(PayTime) Then
				Call fycms.ActErr("汇款日期格式有误","","1")
			end if
			if ChkNumeric(Money)=0 then
				Call fycms.ActErr("请输入要续费金额","","1")
			end if
		    if Remark="" Then
				Call fycms.ActErr("请输入备注","","1")
			end if
			Set rsUser=Server.CreateObject("Adodb.RecordSet")
			sqlUser="select * from User_fy where UserID=" & UserID
			rsUser.Open sqlUser,Conn,1,3
			if rsUser.bof and rsUser.eof then
				Call fycms.ActErr("找不到指定的用户","","1")
				rsUser.close:set rsUser=Nothing
				exit sub
			end if
				'rsUser("Money")=rsUser("Money")+Money
			rsUser.update
			
			Call fycms.MoneyInOrOut(rsUser("UserID"),rsUser("RealName"),Money,MoneyType,1,PayTime,"0",RSQL(Trim(Request.Cookies(fycmsN)("AdminName"))),Remark,0,0)
			Call fycms.ActErr("操作成功","User/index.asp","")
		end sub
	
	
	
	
	
	
	
	Sub Del()'删除
	Dim rs
		IF UserID = "" Then
			ShowErr = "<li>请指定要删除的用户</li>"
			Call fycms.ActErr(ShowErr,"","1")
			Response.End
		End IF
		If instr(UserID,",")>0 then
			UserID=replace(UserID," ","")

			Set rs=fycms.actexe("select UModeID,UserID from User_fy where UserID in (" & rsql(UserID)& ") ")
			If Not rs.eof Then 
				Do While Not rs.eof 
					fycms.actexe("delete from "&fycms.ACT_U(rs("UModeID"),2)&" where UserID=" & rs("UserID"))
					fycms.actexe("delete from User_fy where UserID=" & ChkNumeric(rs("UserID"))) 
				rs.movenext
				loop
			End If 
  		Else
			Set rs=fycms.actexe("select UModeID,UserID from User_fy where UserID=" & ChkNumeric(UserID))
			If Not rs.eof Then 
				fycms.actexe("delete from "&fycms.ACT_U(rs("UModeID"),2)&" where UserID=" & rs("UserID"))
				fycms.actexe("delete from User_fy where UserID=" & ChkNumeric(UserID)) 
			End If 
		End if
  		Call fycms.ActErr("用户删除成功","User/index.asp","")
 		Response.End
    End Sub
	Sub Locked()'锁定
		IF UserID = "" Then
 			Call fycms.ActErr("请指定要锁定的用户","","1")
 			Response.End
		End IF
		If instr(UserID,",")>0 then
			UserID=replace(UserID," ","")
			Sql="Update User_fy set locked=1 where UserID in (" & UserID & ")"
		Else
			Sql="Update User_fy set locked=1 where UserID=" & ChkNumeric(UserID)
		End if
		Conn.Execute sql:Set Conn=nothing
 		Call fycms.ActErr("用户锁定成功","User/index.asp?UModeID="&UModeID&"","")
 		Response.End
    End Sub
	Sub UnLocked()'解锁
		IF UserID = "" Then
			ShowErr = "<li>请指定要解锁的用户</li>"
			Call fycms.ActErr("请指定要解锁的用户","","")
 			Response.End
		End IF
		If instr(UserID,",")>0 then
			UserID=replace(UserID," ","")
			Sql="Update User_fy set locked=0 where UserID in (" & UserID & ")"
		Else
			Sql="Update User_fy set locked=0 where UserID=" & ChkNumeric(UserID)
		End if
		Conn.Execute sql:Set Conn=nothing
		Call fycms.ActErr("用户解锁成功","User/index.asp?UModeID="&UModeID&"","")
  		Response.End
    End Sub
	Sub MoveUser()'移动
	Dim GroupID, RsGroup
		GroupID = ChkNumeric(Request("GroupID"))
		IF UserID = "" Then
 			 Call fycms.ActErr("请指定要移动的用户","","1")
 			Response.End
		End IF
		IF GroupID = 0 Then echo "目标用户组不存在":Response.end
		UserID=replace(UserID," ","")
		Set RsGroup=Conn.Execute("Select GroupSetting,GroupName From Group_fy Where GroupID="&GroupID&"")
		If Not (RsGroup.Bof and RsGroup.Eof) then
			IF IsSqlDataBase = 1 Then
				Conn.Execute("Update User_fy set GroupID=" & GroupID & " where UserID in (" & UserID & ")")
			Else
				Conn.Execute("Update User_fy set GroupID=" & GroupID & " where UserID in (" & UserID & ")")
			End IF
		Else
			ShowErr = "<li>请指定目标用户组</li>"
			Call fycms.ActErr(ShowErr,"","1")
			Response.End
			Exit Sub
		End if
  		Call fycms.ActErr("<li>已经成功将选定用户设为“<font color=red>"&RsGroup(1)&"</font>","User/index.asp?UModeID="&UModeID&"","")
 		RsGroup.Close : Set RsGroup=Nothing
		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 arrinfo, i
	Dim sql, sqlCount,Sqls,pages,StrGuide
	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 = "&  ChkNumeric(Request.QueryString("GroupID"))&" "
			StrGuide = "查询结果"
			pages = "UserSearch="&Request.QueryString("UserSearch")&"&GroupID="&ChkNumeric(Request.QueryString("GroupID"))&"&page"
		Case 7
			StrGuide = "查询结果"
			pages = "UserSearch="&Request("UserSearch")&"&Email="&Request("Email")&"&usernamechk="&Request("usernamechk")&"&username="&Request("username")&"&GroupID="&ChkNumeric(Request("GroupID"))&"&page"
			UserID =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 ChkNumeric(request("userid"))<>"0" then
								Sqls=Sqls & " userid="&ChkNumeric(request("userid"))&" "
						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&" and Umodeid= "&UModeID&"   "			
		Case Else
	  Sqls = "  where Umodeid= "&UModeID&"  "	
			pages = "page"
			StrGuide = "所有用户"
	End Select
	sql = "SELECT [UserID], [GroupID], [UserName],[Locked], [Loginip],[LoginNumber],[LoginTime],ChargeType,[Umodeid]" & _
		" FROM [User_fy]" &Sqls& _
		"ORDER BY [UserID] DESC"
   	sqlCount = "SELECT Count([UserID])" & _
			" FROM [User_fy]"&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		
		arrinfo = clsRecordInfo.arrinfo
		strPageInfo = clsRecordInfo.strPageInfo
		Set clsRecordInfo = nothing
%>
    <form name="form2" method="post" action="index.asp">
 <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
      <td align="center" class="bg_tr">快速搜索</td>
    </tr>
    <tr>
      <td><strong>用户ID：</strong>
      <input name="userid" type="text" class="Ainput" id="userid" size="10" value="<%=request("userid")%>">
	  <strong>用户名：</strong>
      <input name="username" type="text" class="Ainput" id="username" size="20" value="<%=request("username")%>">
       <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>
        <%=fycms.GetGroup_select(3)%>
      </select>
		   <input name="UserSearch" type="hidden" id="UserSearch" value="7">
		  <input name="Submit" class="btn btn_primary" type="button" value="  快速搜索   " onclick="CheckInfo1()"></td>
    </tr>
</table> </form> 
  <form name="Userform" method="Post" action="index.asp" onSubmit="return confirm('确定要执行选定的操作吗？');">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
	<thead>
      <tr>
		  <th>选中</th>
		  <th>ID</th>
		  <th>所属模型</th>
		  <th>用户名</th>
		  <th>所属用户组</th>
		  <th>最后登录IP</th>
		  <th>最后登录时间</th>
		  <th>登录次数</th>
		  <th>状态</th>
		  <th>管理操作</th>
		  <th>删除</th>
	  </tr>
    </thead>

	 <%
		Dim bgColor
		If IsArray(arrinfo) Then
			For i = 0 to UBound(arrinfo, 2)
	%>
    <tr>
      <td><input name="UserID" type="checkbox" id="UserID" value="<%= arrinfo(0,i) %>"></td>
      <td><%= arrinfo(0,i) %></td>
      <td><%=fycms.ACT_U(arrinfo(8,i),1) %></td>
      <td><%=fycms.Highlight(arrinfo(2,i),request("username")) %></td>
      <td><%=fycms.ACT_G(arrinfo(1,i),7)%></td>
      <td><%=arrinfo(4,i)%></td>
      <td><%=arrinfo(6,i)%></td>
      <td><%=arrinfo(5,i)%></td>
      <td><% IF arrinfo(3,i) = 0 Then echo "正常" Else echo "<font color=red>已锁定</font>" %></td>
      <td>
	
       <a href="fy.E.ASP?Action=Edit&UserID=<%=arrinfo(0,i)  %>" >修改</a>
	 <% IF arrinfo(3,i) = 0 Then %>
	   <a href="?Action=Lock&UserID=<%= arrinfo(0,i) %>">锁定</a>
	 <%  Else%>
	 <a href="?Action=UnLock&UserID=<%= arrinfo(0,i) %>">解锁</a>
	<%End If 
	
	 If arrinfo(7,i)=1 Then
	   echo "<a href='?Action=AddMoney&UserID=" & arrinfo(0,i) & "'>续点数</a>"
	 ElseIf arrinfo(7,I)=2 Then
	   echo "<a href='?Action=AddMoney&UserID=" & arrinfo(0,i) & "'>续天数</a>"
	 End IF
	
	 %>
    
     <a href="?Action=AddZJ&UserID=<%= arrinfo(0,i) %>">续费</a>
     </td>
      <td  align="center"><a href="?Action=Del&UserID=<%= arrinfo(0,i) %>" onClick="return confirm('确认删除此用户吗?')">删除</a></td>
    </tr>
	<% 
	Next
	End If
	%>
    <tr >
      <td height="25" colspan="12">
        <input name="ChkAll" type="checkbox" id="ChkAll" onClick="CheckAll(this.form)" value="checkbox"><label for="chkAll">选中本页显示的所有用户</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>
					  <%=fycms.GetGroup_select(3)%>
					  </select>
				&nbsp;&nbsp;
	  <input type="submit" name="Submit"  class="btn btn_primary"  value=" 执&nbsp;&nbsp;行 " >	  </td>
    </tr>
	
	</table> </form>
    <div class="pagelist">
    	<%= strPageInfo%>
   </div>
	<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;  
		   }  
	  }
 


		</script>

<% End Sub%>



 <script language="javascript">	
	function CheckInfo1()
		{
  	    form2.submit();	
		}
	</script>




	<% Sub AddMoney()
		Dim rsUser,sqlUser,tmpDays
		UserID=ChkNumeric(Request.QueryString("UserID"))
		 	 	

		If UserID=0 then  Call fycms.ActErr("参数不足","User/User_Admin.asp?ModeID="&ModeID&"","")
		Set rsUser=Conn.Execute("select * from User_fy where UserID=" & UserID)
		If rsUser.bof and rsUser.eof then
			rsUser.close:set rsUser=Nothing
			Call fycms.ActErr("找不到指定的用户","User/User_Admin.asp?ModeID="&ModeID&"","1")
 			Exit sub
		End if
		if rsUser("ChargeType")=3 Then
			  rsUser.Close:Set rsUser=Nothing
			  Call fycms.ActErr("无限期用户无需续费操作","User/User_Admin.asp?ModeID="&ModeID&"","1")
			  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="28" colspan="2" align="center"><b>用 户 续 费</b></TD>
		   </TR>
			<TR > 
			  <TD width="25%" height="28" align="right" ><b>用户名：</b></TD>
			  <TD width="75%" class="tl"><%=rsUser("UserName")%></TD>
			</TR>
			<TR > 
			  <TD width="25%" height="28" align="right" ><strong>用户级别：</strong></TD>
			  <TD width="75%" class="tl"> <%=fycms.act_g(rsUser("GroupID"),7) %></TD>
			</TR>
			<TR  >
			  <TD height="28" align="right" ><strong>计费方式：</strong></TD>
			  <TD class="tl"><%
			  if rsUser("ChargeType")=1 then
				echo "扣点数"
			  else
				echo "有效期"
			  end if
			  %>
				<input name="ChargeType" type="hidden" id="ChargeType" value="<%=rsUser("ChargeType")%>">			  </TD>
			</TR>
			<TR > 
			  <TD width="25%" height="28" align="right" ><strong>可用资金：</strong></TD>
			  <TD width="75%" class="tl"><%=rsUser("Money")%>元人民币</TD>
			</TR>
			<%if rsUser("ChargeType")=1 then%>
			<TR  >
			  <TD height="28" align="right" ><strong>目前的用户点数：</strong></TD>
			  <TD class="tl"><%=rsUser("Point")%> 点</TD>
			</TR>
			<TR  >
			  <TD height="28" align="right" ><strong>追加点数：</strong></TD>
			  <TD class="tl"> <input name="Point" class="Ainput"  type="text" id="Point" value="100" size="10" maxlength="10">
			  点</TD>
			</TR>
			<%else%>
			<TR >
			  <TD height="28" align="right" ><strong>目前的有效期限信息：</strong></TD>
			  <TD>
			  <%
			  echo "开始计算日期" & FormatDateTime(rsUser("BeginDate"),2) & "&nbsp;&nbsp;&nbsp;&nbsp;有 效 期：" & rsUser("Edays")
			 
				echo "天"
			 
			  echo "<br>"
			  tmpDays=rsUser("Edays")-DateDiff("D",rsUser("BeginDate"),now())
			  if tmpDays>=0 then
				echo "尚有 <font color=blue>" & tmpDays & "</font> 天到期"
			  else
				echo "已经过期 <font color=#ff6600>" & abs(tmpDays) & "</font> 天"
			  end if
			  %>			  </TD>
			</TR>
			<tr >
			  <td height="60" align="right" ><strong>追加天数：</strong><br></td>
			  <td class="tl">
			  <input name="Edays" class="Ainput"  type="text" id="Edays" value="100" size="10" maxlength="10">
			  天<br />
			  若目前用户尚未到期，则追加相应天数<br />
若目前用户已经过了有效期，则有效期从续费之日起重新计数。</td>
			</tr>
			<%end if%>
			<tr >
			  <td height="30" align="right" ><strong>同时减去：</strong><br></td>
			  <td class="tl">
			  <input name="Money" type="text" class="Ainput"  id="Money" value="100" size="10" maxlength="10"> 元人民币
			  <font color=red>
			  <%if rsUser("ChargeType")=1 then %>
			   资金与点券的默认比率：<%=fycms.fycms_Sys(22)%>:1
			  <%else%>
			  资金与有效期的默认比率：<%=fycms.fycms_Sys(23)%>:1
			  <%end if%>
			  </font> 不想扣除资金，请输入0
			  </td>
			</tr>
			<TR >
			  <TD height="28" align="right" ><strong>请输入原因：</strong></TD>
			  <TD class="tl"> <input name="Reason" class="Ainput"  type="text" id="Reason" value="<%If rsUser("ChargeType")=1 Then echo "续点券操作" Else echo "续有效天数操作"%>" size="55"></TD>
			</TR>
			<TR > 
			  <TD height="40" colspan="2" align="center">
          <input name="Action" type="hidden" id="Action" value="SaveAddMoney"> 
 		   <input name="UserID" type="hidden" id="UserID" value="<%= rsUser("UserID") %>">
		   <input name="UModeID" type="hidden" id="UModeID" value="<%= UModeID %>">
		   <input type="submit" name="Submit2" class="btn btn_primary" value=" 保存 ">
	      <input type="reset" name="Submit3"  class="btn" value=" 重置 "></TD>
			</TR>
		</form>
	    </TABLE>
		<%
			rsUser.close : set rsUser=Nothing
End Sub 
 %>





</div>
</body>
</html>
