<!-- #include file=../inc/BBSsetup.asp -->
<!-- #include file=../inc/User_setup.asp -->
<!-- #include file=../inc/Bank_setup.asp -->
<!-- #include file=../inc/Board_Popfun.asp -->
<!-- #include file=inc/UserTopic.asp -->
<!-- LeadBBS Bank v0.5 Reloaded -->
<!-- Coded By ashi -->
<%
'Time Stamp Begin
'0.5_1_10_859978_20050627184000
'Time Stamp End

'LeadBBS Bank v0.5 Reloaded
'
'Copyright(C) ashi Azure, All rights reserved.
'----------
'禁止任何人以任何形式在未经过ashi本人同意的情况下对此插件进行转载。

Response.Expires = 0
Response.ExpiresAbsolute = DEF_Now - 1
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", "private" 
Response.CacheControl = "no-cache"

DEF_BBS_HomeUrl = "../"

Dim Rs, SQL
Dim Points, SavePoints, MPoints, SaveMax, UserLevel
Dim SaveDate, BsnDate
Dim BankUserCount, BankUserSavePoints
Dim Form_SavePoints, Form_GetPoints, Form_MovePoints, Form_MovePointsTo, BK_Msg_Content, MovePointsMsgDivFlag
Dim BK_Msg_Str, BK_Msg_Content_Msg, BK_Time
Dim SubmitFlag, SuperUserFlag

SubmitFlag = Request.Form("SubmitFlag")
SuperUserFlag = CheckSupervisorUserName

BK_Time = Hour(DEF_Now)

BK_Msg_Str = ""
GBL_CHK_TempStr = ""

initDatabase

SiteHead(DEF_SiteNameString & " - 用户会员区")
UpdateOnlineUserAtInfo GBL_board_ID, "社区银行"
UserTopicTopInfo
DisplayUserNavigate("社区银行")


If GBL_CHK_Flag = 1 Then
	Response.Write "<table width=96% ><tr><td><br />"
	If GetBankData = 1 Then
		If SubmitFlag <> "" Then
			If GetBinarybit(GBL_CHK_UserLimit, 16) = 0 Then
				Select Case SubmitFlag
					Case "Settlement": Bank_Settlement
					Case "Save": Bank_Save
					Case "Get": Bank_Get
					Case "Move": Bank_Move
				End Select
			Else
				GBL_CHK_TempStr = GBL_CHK_TempStr & "对不起，您的帐号被冻结了，请联系您的管理员。<br />"
			End If
		End If
		If GBL_CHK_TempStr <> "" Then
			Response.Write "<p align=left><font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font><br />"
		End If
		If BK_Msg_Str = "" Then
			Bank
		Else
			Response.Write "<table cellspacing=0 cellpadding=0 width=100% border=0 height=5><tr><td colspan=2 height=0><img src=../images/BLANK.GIF width=1 height=1></td></tr></table>"
			Response.Write "<br /><table width=100% border=0 cellspacing=1 cellpadding=2 bgcolor=" & DEF_BBS_LightColor & " class=TBBG1><tbody>"
			Response.Write "<tr height=19 bgcolor=" & DEF_BBS_TableHeadColor & " class=TBfour>"
			Response.Write "<td align=center><img src=../images/BLANK.GIF width=1 height=3><br />社区银行操作反馈</td></tr>"
			Response.Write "<tr height=19 bgcolor=" & DEF_BBS_TableHeadColor & " class=TBBG9>"
			Response.Write "<td><table width=100% border=0 cellspacing=0 cellpadding=5><tr><td><img src=../images/BLANK.GIF width=1 height=3><br />"
			Response.Write BK_Msg_Str
			Response.Write "<br />系统将于10秒后返回到银行，如果您的浏览器没有自动跳转请<a href=userbank.asp>点击这里</a>。</td></tr></table></td></tr></table>"
			Response.Write "<meta http-equiv=""refresh"" content=""10;url=UserBank.asp"">"
			Set Rs = Con.ExeCute("SELECT Top 1 Points, SavePoints From LeadBBS_User Where id=" & GBL_UserID)
			GBL_DBNum = GBL_DBNum + 1
			UpdateSessionValue 4, Rs(0), 0
			'UpdateSessionValue 19, Rs(1), 0
			Rs.Close
			Set Rs = Nothing
		End If
	Else
		Response.Write "<b>" & GBL_CHK_TempStr & "</b>"
	End If
	Response.Write "</td></tr></table>"
Else
	GBL_CHK_TempStr = GBL_CHK_TempStr & "<font color=ff0000 class=RedFont><b>你没有登录</b></font><br />" & VbCrLf
	Response.Write "<p align=left>" & GBL_CHK_TempStr & "</p>"
End If

UserTopicBottomInfo
closeDataBase
SiteBottom
If GBL_ShowBottomSure = 1 Then Response.Write GBL_SiteBottomString

Function GetBankData

	If GBL_CHK_OnlineTime < DEF_NeedOnlineTime and DEF_NeedOnlineTime > 0 and SuperUserFlag = 0 Then
		GBL_CHK_TempStr = "论坛限制在线时间(经验)" & Fix(DEF_NeedOnlineTime/60) & "分以上用户才能使用此功能。<br />" & VbCrLf
	End If

	If DEF_BK_SET_Open = 0 Then
		GBL_CHK_TempStr = GBL_CHK_TempStr & DEF_SiteNameString & " 社区银行结算中，请稍候再来，或联系系统管理员。 ：）<br />" &  DEF_BK_CloseInfo & "<br /><br />LeadBBS Bank 0.5 Reloaded" & VbCrLf
	ElseIf DEF_BK_SET_OpenAt > BK_Time or DEF_BK_SET_CloseAt < BK_Time Then
		GBL_CHK_TempStr = GBL_CHK_TempStr & DEF_SiteNameString & " 社区银行关门了，请稍候再来。<br /><br />营业时间：" & DEF_BK_SET_OpenAt & ":00:00 至 " & DEF_BK_SET_CloseAt & ":59:59 <br /><br />LeadBBS Bank 0.5 Reloaded" & VbCrLf
	End If

	If GBL_CHK_TempStr <> "" Then
		GetBankData = 0
		Exit Function
	End If

	Set Rs = Con.ExeCute("SELECT Top 1 Points, SavePoints, SaveDate, UserLevel From LeadBBS_User Where id=" & GBL_UserID)
	GBL_DBNum = GBL_DBNum + 1
	
	If Rs.Eof Then
		Rs.Close
		Set Rs = Nothing
		GBL_CHK_TempStr = GBL_CHK_TempStr & "发生意外错误<br />" & VbCrLf
		GetBankData = 0
		Exit Function		
	Else
		GetBankData = 1
	End If
	
	Points = Rs(0)
	SavePoints = Rs(1)
	SaveDate = RestoreTime(Rs(2))
	UserLevel = Rs(3)
	
	If SavePoints > 0 Then
		BsnDate = Fix(datediff("h", SaveDate, DEF_Now)/24)
		MPoints = Fix(SavePoints * DEF_UserPoints_Day * BsnDate)
	Else
		BsnDate = "未知"
		MPoints = 0
	End If
	SaveMax = 0
	
	If GetBinarybit(GBL_CHK_UserLimit, 15) = 1 Then
		DEF_UserSavePoints(UserLevel) = Fix(DEF_UserSavePoints(UserLevel) * DEF_UserPoints_VIP_m)
	End If
	
	If Points > 0 Then
		If DEF_UserSavePoints(UserLevel) > Points Then DEF_UserSavePoints(UserLevel) = Points
		SaveMax = DEF_UserSavePoints(UserLevel)
		If DEF_BK_SET_Limit_Total Then
			If SavePoints < DEF_UserSavePoints(UserLevel) Then
				SaveMax = DEF_UserSavePoints(UserLevel) - SavePoints - MPoints
			Else
				SaveMax = 0
			End If
		End If
	End If
	Rs.Close
	Set Rs = Nothing
	
	Set Rs = Con.ExeCute("SELECT Count(0), Sum(SavePoints) From LeadBBS_User Where SavePoints > 0")
	GBL_DBNum = GBL_DBNum + 1
	BankUserCount = Rs(0)
	BankUserSavePoints = Rs(1)
	Rs.Close
	Set Rs = Nothing
	
	If isNumeric(BankUserCount) = False Then BankUserCount = 0
	If isNumeric(BankUserSavePoints) = False Then BankUserSavePoints = 0
	
End Function

Function SaveLog(SL_Do, SL_PointsTo, SL_Points, SL_FPoints)
	
	Dim XML, Obj, path
	Set xml = Server.CreateObject("MSXML2.DOMDocument.3.0")
	path = Server.MapPath(Replace(Replace(DEF_BBS_HomeUrl & DEF_BK_LogPath, "/", "\"), "\\", "\"))
	xml.load(path)
	Set Obj = Xml.createElement("a")
	With Obj
	.setAttribute "u", GBL_CHK_User
	.setAttribute "a", SL_Do
	.setAttribute "q", SL_Points
	.setAttribute "f", SL_FPoints
	.setAttribute "x", SL_Points - SL_FPoints
	.setAttribute "m", DEF_Now
	.setAttribute "i", GBL_IPAddress
	If SL_Do = "转帐" Then .setAttribute "t", SL_PointsTo
	End With
	Xml.documentElement.AppendChild(Obj)
	Set Obj = Nothing
	Xml.Save(path)
	Set Xml = Nothing
	
End Function

Function CheckIsRestSpaceTime

	If DateDiff("s", SaveDate, DEF_Now) < 0 Then
		CheckIsRestSpaceTime = 0
		Exit Function
	End If
	Con.ExeCute("UPDATE LeadBBS_User Set SaveDate=" & GetTimeValue(DEF_Now) & " Where id=" & GBL_UserID)
	GBL_DBNum = GBL_DBNum + 1
	If DateDiff("s", SaveDate, DEF_Now) < DEF_RestSpaceTime Then
		CheckIsRestSpaceTime = 0
	Else
		CheckIsRestSpaceTime = 1
	End If
	
End Function

Function UpdateUserLaseWriteTime

	If SuperUserFlag = 1 Then Exit Function
	UpdateSessionValue 13, GetTimeValue(DEF_Now), 0
	UpdateUserLaseWriteTime = ", LastWriteTime=" & GetTimeValue(DEF_Now)

End Function

Function CheckRndNumber

	Dim RndNumber
	RndNumber = Left(Session(DEF_MasterCookies & "RndNum") & "", 4)
	If RndNumber = "" or isNumeric(RndNumber) = 0 Then
		'RndNumber = 0
		Randomize
		RndNumber = Fix(Rnd*9999)+1
		Session(DEF_MasterCookies & "RndNum") = RndNumber
	End If
	RndNumber = cCur(RndNumber)
	
	Dim ForumNumber
	ForumNumber = Left(Request.Form("ForumNumber"), 4)
	If isNumeric(ForumNumber) = False Then ForumNumber = 0
	ForumNumber = Fix(cCur(ForumNumber))
	If RndNumber = ForumNumber and RndNumber > 0 Then
		CheckRndNumber = 1
	Else
		CheckRndNumber = 0
	End If
	Randomize
	Session(DEF_MasterCookies & "RndNum") = Fix(Rnd*9999)+1

End Function

Function Bank_Settlement

	If DEF_BK_SET_Default = 0 Then
		GBL_CHK_TempStr = GBL_CHK_TempStr & "错误，论坛当前禁止结算!<br />"
		Exit Function
	End If
	If Mpoints = 0 Then
		GBL_CHK_TempStr = GBL_CHK_TempStr & "你没有利息需要结算!<br />"
		Exit Function
	End If

	Con.ExeCute("UPDATE LeadBBS_User Set SavePoints=SavePoints+" & Fix(MPoints * DEF_UserPoints_Tax) & ", SaveDate=" & GetTimeValue(DEF_Now) & UpdateUserLaseWriteTime & " Where id=" & GBL_UserID)
	GBL_DBNum = GBL_DBNum + 1
	
	BankMessage "", "", 0, 0
	
End Function

Function Bank_Save

	If DEF_BK_SET_Default = 0 Then
		GBL_CHK_TempStr = GBL_CHK_TempStr & "错误，论坛当前禁止存款!<br />"
		Exit Function
	End If

	Form_SavePoints = CheckFormValue(Left(Trim(Request.Form("Form_SavePoints")), 8), SaveMax, 0)
	If GBL_CHK_TempStr <> "" Then Exit Function
	
	Con.ExeCute("UPDATE LeadBBS_User Set SavePoints=SavePoints+" & Fix(MPoints * DEF_UserPoints_Tax) + Form_SavePoints & ", Points=Points-" & Form_SavePoints & ", SaveDate=" & GetTimeValue(DEF_Now) & UpdateUserLaseWriteTime & " Where id=" & GBL_UserID)
	GBL_DBNum = GBL_DBNum + 1

	If DEF_BK_SET_WriteLog Then SaveLog "存入", "", Form_SavePoints, Form_SavePoints
	BankMessage "存入", "现金", Form_SavePoints, 0

End Function

Function Bank_Get

	If DEF_BK_SET_Default = 0 Then
		GBL_CHK_TempStr = GBL_CHK_TempStr & "错误，论坛当前禁止取款!<br />"
		Exit Function
	End If
	
	Form_GetPoints = CheckFormValue(Left(Trim(Request.Form("Form_GetPoints")), 8), SavePoints+MPoints, 0)
	If GBL_CHK_TempStr <> "" Then Exit Function
	
	Con.ExeCute("UPDATE LeadBBS_User Set SavePoints=SavePoints+" & Fix(MPoints * DEF_UserPoints_Tax) - Form_GetPoints & ", Points=Points+" & Form_GetPoints & ", SaveDate=" & GetTimeValue(DEF_Now) & UpdateUserLaseWriteTime & " Where id=" & GBL_UserID)
	GBL_DBNum = GBL_DBNum + 1
	
	If DEF_BK_SET_WriteLog Then SaveLog "取出", "", Form_GetPoints, Form_GetPoints
	BankMessage "取出", "存款", Form_GetPoints, 0
	
End Function

Function Bank_Move

	If DEF_BK_SET_Move = 0 Then
		GBL_CHK_TempStr = GBL_CHK_TempStr & "错误，论坛当前禁止转帐!<br />"
		Exit Function
	End If

	Form_MovePoints = Left(Trim(Request.Form("Form_MovePoints")), 8)
	Form_MovePointsTo = Left(Trim(Request.Form("Form_MovePointsTo")), 14)
	MovePointsMsgDivFlag = Left(Trim(Request.Form("MovePointsMsgDivFlag")), 8)
	BK_Msg_Content = Left(Request.Form("BK_Msg_Content"), DEF_MaxTextLength/2-100)
	If BK_Msg_Content <> "" Then MovePointsMsgDivFlag = "Show"
	Form_MovePoints = CheckFormValue(Form_MovePoints, SavePoints+MPoints, 0)
	If GBL_CHK_TempStr <> "" Then Exit Function
	BK_Msg_Content = CheckFormValue(BK_Msg_Content, 0, 1)
	If GBL_CHK_TempStr <> "" Then Exit Function

	Con.ExeCute("UPDATE LeadBBS_User Set SavePoints=SavePoints+" & Fix(MPoints * DEF_UserPoints_Tax) - Form_MovePoints & ", SaveDate=" & GetTimeValue(DEF_Now) & UpdateUserLaseWriteTime & " Where id=" & GBL_UserID)
	GBL_DBNum = GBL_DBNum + 1

	If DEF_BK_SET_WriteLog Then SaveLog "转帐", Form_MovePointsTo, Form_MovePoints, Fix(Form_MovePoints * DEF_UserPoints_Move)
	If DEF_UserPoints_Move<1 Then
		Form_MovePoints = Fix(Form_MovePoints * DEF_UserPoints_Move) & " (已缴税 " & Fix(Form_MovePoints * (1-DEF_UserPoints_Move)) & ") " 
	End If
	BankMessage "转帐", "存款", Form_MovePoints, 1
	
End Function

Function BankMessage(n, n1, n2, Tmp)

	If MPoints > 0 Then
		BK_Msg_Str = BK_Msg_Str & "<font color=Green class=GreenFont><b>操作成功，此次操作：</b></font>"
		BK_Msg_Str = BK_Msg_Str & "<br /><br />"
		BK_Msg_Str = BK_Msg_Str & "<li>结算利息：" & Fix(MPoints * DEF_UserPoints_Tax) & " "
		If DEF_UserPoints_Tax<1 Then
			BK_Msg_Str = BK_Msg_Str & "(已缴税 " & Fix(MPoints * (1-DEF_UserPoints_Tax)) & ") " 
		End If
		BK_Msg_Str = BK_Msg_Str & DEF_PointsName & "</li>"
		BK_Msg_Str = BK_Msg_Str & "<br /><br />"
		If DEF_BK_SET_WriteLog Then SaveLog "结算", "", MPoints, Fix(MPoints * DEF_UserPoints_Tax)
	End If
	If n1 <> "" and n2 <> "" Then
		BK_Msg_Str = BK_Msg_Str & "<font color=Green class=GreenFont><b>操作成功，此次操作" & n & "：</b></font>"
		BK_Msg_Str = BK_Msg_Str & "<br /><br />"
		BK_Msg_Str = BK_Msg_Str & "<li>" & n1 & "：" & n2 & " " & DEF_PointsName
		If Tmp = 1 Then
			BK_Msg_Str = BK_Msg_Str & " 到 " & Form_MovePointsTo
		End If
		BK_Msg_Str = BK_Msg_Str & "</li>"
		If Tmp = 1 Then
			BK_Msg_Str = BK_Msg_Str & "<li>" & BK_Msg_Content_Msg & "</li>"
		End If
		BK_Msg_Str = BK_Msg_Str & "<br /><br />"
	End If
	
End Function

Function CheckFormValue(n, n1, n2)

	CheckFormValue = n
	If n2 = 0 Then
	
		If DEF_EnableAttestNumber > 2 Then
			If CheckRndNumber = 0 Then
				GBL_CHK_TempStr = GBL_CHK_TempStr & "验证码填写错误!<br />"
				Exit Function
			End If
		End If
		If IsNumeric(n) = 0 then
			GBL_CHK_TempStr = GBL_CHK_TempStr & "你的金额必须是数字!<br />"
			Exit Function
		End If
		n = Fix(cCur(n))
		If n > n1 or n <= 0 then
			GBL_CHK_TempStr = GBL_CHK_TempStr & "你的金额有问题!<br />"
			Exit Function
		End If
		If CheckIsRestSpaceTime = 0 and SuperUserFlag = 0 Then
			GBL_CHK_TempStr = GBL_CHK_TempStr & "不能连续进行操作，请休息" & DEF_RestSpaceTime & "秒钟后再操作!<br />"
			Exit Function
		End If
		If GBL_CHK_LastWriteTime < DEF_WriteEventSpace Then
			GBL_CHK_TempStr = GBL_CHK_TempStr & "您在修改资料的过程中提交得太频，请稍候再作提交! <br />"
			Exit Function
		End If
		
	ElseIf n2 = 1 Then
	
		Dim BK_Msg_ToUser, BK_Msg_ToUserID, BK_Msg_ToUserLimit
		If Form_MovePointsTo = "" Then
			GBL_CHK_TempStr = GBL_CHK_TempStr & "你的转帐对象有问题!<br />"
			Exit Function
		End If
		If LCase(Form_MovePointsTo) = LCase(GBL_CHK_User) Then
			GBL_CHK_TempStr = GBL_CHK_TempStr & "不能给自己转帐!<br />"
			Exit Function
		End If
		Set Rs = Con.ExeCute("SELECT Top 1 ID, UserName, UserLimit From LeadBBS_User Where username='" & Replace(Form_MovePointsTo, "'", "''") & "'")
		GBL_DBNum = GBL_DBNum + 1
		If Rs.Eof Then
			Rs.Close
			Set Rs = Nothing
			GBL_CHK_TempStr = GBL_CHK_TempStr & "未找到请求的用户<br />"
			Exit Function
		End If
		BK_Msg_ToUserID = Rs(0)
		BK_Msg_ToUser = Rs(1)
		BK_Msg_ToUserLimit = Rs(2)
		
		Rs.Close
		Set Rs = Nothing
		
		Con.ExeCute("UPDATE LeadBBS_User Set MessageFlag=1, Points=Points+" & Fix(Form_MovePoints * DEF_UserPoints_Move) & " Where ID=" & BK_Msg_ToUserID)
		GBL_DBNum = GBL_DBNum + 1
		
		If DEF_BK_SET_Massage and n <> "" Then
			If GetBinaryBit(BK_Msg_ToUserLimit, 13) = 1 Then
				Set Rs = Con.ExeCute("SELECT Top 1 ID From LeadBBS_FriendUser Where FriendUserID=" & GBL_UserID & " and UserID=" & BK_Msg_ToUserID)
				GBL_DBNum = GBL_DBNum + 1
				If Rs.Eof Then
					BK_Msg_Content_Msg = "<font color=Red class=RedFont><b>对方已经设置成仅允许接收好友的短消息，未能发送自定义转帐信息。</b></font></li><li>"
					BK_Msg_Content_Msg = BK_Msg_Content_Msg & "<font color=Green class=GreenFont><b>操作成功，已经成功发送系统转帐信息。</b></font>"
				Else
					n = "转帐消息：" & VbCrLf & Replace(n & "", "\" & VbCrLf, "\\" & VbCrLf & VbCrLf) & VbCrLf & VbCrLf
				End If				
				Rs.Close
				Set Rs = Nothing
			End If
		End If
		
		If BK_Msg_Content_Msg = "" Then
			BK_Msg_Content_Msg = "<font color=Green class=GreenFont><b>操作成功，已经成功发送系统转帐信息。</b></font>"
		End If
		
		n = n & GBL_CHK_User & " 将 " & Fix(Form_MovePoints * DEF_UserPoints_Move) & " " & DEF_PointsName & " 转账到您的现金。 -- " & Replace(DEF_SiteNameString, "'", "''") & " 社区银行"
		SQL = "inSert into LeadBBS_InfoBox(FromUser, ToUser, Title, Content, IP, SendTime, ReadFlag)" & _
		" Values('" & Replace(GBL_CHK_User, "'", "''") & "', '" & Replace(BK_Msg_ToUser, "'", "''") & "', '" & Replace(DEF_SiteNameString, "'", "''") & " 社区银行转帐信息'" & _
		", '" & Replace(n, "'", "''") & "', '" & GBL_IPAddress & "', " & GetTimeValue(DEF_Now) & ", 0)"
		
		Con.Execute(SQL)
		GBL_DBNum = GBL_DBNum + 1
		
	End If
	CheckFormValue = n
	
End Function

Function Bank%>
	<table cellspacing=0 cellpadding=0 width=100% border=0 height=5><tr><td>
	<img src=../images/Blank.GIF width=1 height=1 /></td></tr></table>
	<b title="<%=DEF_SiteNameString%> 社区银行">欢迎光临 <%=DEF_SiteNameString%> 社区银行</b>
	<table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="<%=DEF_BBS_LightColor%>" class="TBBG1">
		<tr height="19" bgcolor="<%=DEF_BBS_TableHeadColor%>" class="TBfour">
			<td align="center" colspan="4">
			<img src="../images/BLANK.GIF" width="1" height="3" /><br />
			您的信息</td>
		</tr>
		<tr class="TBBG9" height="19">
			<td width="22%" align="right">您的储户姓名为：</td>
			<td colspan="3">&nbsp;<%=GBL_CHK_User%></td>
		</tr>
		<tr class="TBBG9" height="19">
			<td width="22%" align="right">您当前的存款为：</td>
			<td width="28%">&nbsp;<b><%=SavePoints%></b> <%=DEF_PointsName%></td>
			<td width="22%" align="right">您当前的现金为：</td>
			<td width="28%">&nbsp;<%
			If Points >= 0 then
				Response.Write "<b>" & Points & "</b>"
			Else
				Response.Write "<b><font color=red class=redfont>" & Points & "</font></b>"
			End If
			Response.Write " " & DEF_PointsName%></td>
		</tr>
		<tr class="TBBG9" height="19">
			<td width="22%" align="right">您当前的利息为：</td>
			<td width="28%">&nbsp;<%=MPoints & " " & DEF_PointsName%><%If DEF_UserPoints_Tax<1 Then Response.Write "(含税)"%></td>
			<td width="22%" align="right">您当前的存期为：</td>
			<td width="28%">&nbsp;<%=BsnDate%> 天</td>
		</tr>
		<tr class="TBBG9" height="19">
			<td width="22%" align="right">您存款的日期是：</td>
			<td width="28%">&nbsp;<%
			If SavePoints > 0 Then
				Response.Write SaveDate
			Else
				Response.Write "未知"
			End If
			%></td>
			<td width="22%" align="right">您当前的等级为：</td>
			<td width="28%">&nbsp;<img src="<%=DEF_BBS_HomeUrl & "images/" & GBL_DefineImage & "lvstar/level" & UserLevel%>.gif" align="absmiddle" width="110" height="11" /></td>
		</tr>
	</table>
	<br />
	<table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="<%=DEF_BBS_LightColor%>" class="TBBG1">
		<tr height="19" bgcolor="<%=DEF_BBS_TableHeadColor%>" class="TBfour">
			<td align="center" colspan="4">
			<img src="../images/BLANK.GIF" width="1" height="3" /><br />
			银行信息</td>
		</tr>
		<tr class="TBBG9" height="19">
			<td width="22%" align="right">本行用户数量为：</td>
			<td colspan="3">&nbsp;<%=FormatNumber(BankUserCount, 0, True)%> 人</td>
		</tr>
		<tr class="TBBG9" height="19">
			<td width="22%" align="right">本行用户存款为：</td>
			<td colspan="3">&nbsp;<%=FormatNumber(BankUserSavePoints, 0, True) & " " & DEF_PointsName%></td>
		</tr><%
		If DEF_UserPoints_Day>0 Then%>
		<tr class="TBBG9" height="19">
			<td width="22%" align="right">当前的日利率为：</td>
			<td colspan="3">&nbsp;<%=FormatNumber(DEF_UserPoints_Day*100, 2, True) & " %"%></td>
		</tr><%
		End If
		If DEF_UserPoints_Move<1 Then%>
		<tr class="TBBG9" height="19">
			<td width="22%" align="right">当前的转帐税为：</td>
			<td colspan="3">&nbsp;<%=FormatNumber((1-DEF_UserPoints_Move)*100, 2, True) & " %"%></td>
		</tr><%
		End If
		If DEF_UserPoints_Tax<1 Then%>
		<tr class="TBBG9" height="19">
			<td width="22%" align="right">当前的利息税为：</td>
			<td colspan="3">&nbsp;<%=FormatNumber((1-DEF_UserPoints_Tax)*100, 2, True) & " %"%></td>
		</tr><%
		End If%>
	</table>
	<br /><%
	If (SavePoints > 0 and (DEF_BK_SET_Default=1 or DEF_BK_SET_Move=1)) or (SaveMax > 0 and DEF_BK_SET_Default=1) Then%>
	<table width="100%" border="0" cellspacing="1" cellpadding="2" bordercolor="#000000" bgcolor="<%=DEF_BBS_LightColor%>" class="TBBG1">
		<tr height="19" bgcolor="<%=DEF_BBS_TableHeadColor%>" class="TBfour">
			<td align="center" colspan="2">
			<img src="../images/BLANK.GIF" width="1" height="3"><br />
			银行服务</td>
		</tr><%
		If GetBinarybit(GBL_CHK_UserLimit, 16) = 0 Then%>
		<script language="javascript">
		function isnum(str)
		{
			rset="";
			for(i=0;i<str.length;i++){if(str.charAt(i)>="0" && str.charAt(i)<="9"){}else{return 0;}}
			return 1;
		}
		function Check(obj, form, msg, max)
		{
			ValidationPassed = true;
			<%If DEF_EnableAttestNumber > 2 Then%>
			if(ForumNumber.value=="")
			{
				alert("请输入验证码!\n");
				ValidationPassed = false;
				ForumNumber.focus();
				return;
			}
			else
			{
				obj.ForumNumber.value=ForumNumber.value
			}
			<%End If%>
			if(form.value=="" || !isnum(form.value) || form.value=="0")
			{
				alert("你输入的金额有问题哦!\n");
				ValidationPassed = false;
				form.focus();
				return;
			}
			if (form.value>max)
			{
				alert("喂, 你的"+msg+"不够哦!\n");
				ValidationPassed = false;
				form.focus();
				return;
			}
		}
		</script><%
			If DEF_EnableAttestNumber > 2 Then%>
		<tr class="TBBG9" height="30">
			<td width="12%" align="right">验证：</td>
			<td>
			<table cellpadding="1" cellspacing="3" border="0" width="100%">
				<tr>
					<td>
					<input name="ForumNumber" maxlength="4" size="4" class="fminpt">
					<font color="blue" class="bluefont">请在框中输入</font>
					<img src="<%=DEF_BBS_HomeUrl%>User/number.asp?n=<%=timer%>" align="absmiddle">
					</td>
				</tr>
			</table>
			</td>
		</tr><%
			End If
			If DEF_BK_SET_Default=1 Then
				If Mpoints > 0 Then%>
		<form action="UserBank.asp" method="post" name="LeadBBSBankSe" onsubmit="Check(this, this.Form_Se, '利息', <%=Mpoints%>); return ValidationPassed">
			<tr class="TBBG9" height="30">
				<td width="12%" align="right">结算：</td>
				<td>
				<input type="hidden" name="SubmitFlag" value="Settlement">
				<input type="hidden" name="Form_Se" value="1">
				<%If DEF_EnableAttestNumber > 2 Then Response.Write "<input type=hidden name=ForumNumber>"%>
				<table cellpadding="1" cellspacing="3" border="0" width="100%">
					<tr>
						<td width="82%">
						<font color="blue" class="bluefont"><%=MPoints&" "&DEF_PointsName%><%If DEF_UserPoints_Tax<1 Then Response.Write "(含税)"%></font>
						</td>
						<td align="right" width="18%">
						<input name="submit" type="submit" value=" 结 算 " class="fmbtn"><img src=../images/BLANK.GIF width=20 height=1>
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</form><%
				End If
				If SaveMax > 0 Then%>
		<form action="UserBank.asp" method="post" name="LeadBBSBankS" onsubmit="Check(this, this.Form_SavePoints, '现金或权限', <%=SaveMax%>); return ValidationPassed">
			<tr class="TBBG9" height="30">
				<td width="12%" align="right">存款：</td>
				<td>
				<input type="hidden" name="SubmitFlag" value="Save">
				<%If DEF_EnableAttestNumber > 2 Then Response.Write "<input type=hidden name=ForumNumber>"%>
				<table cellpadding="1" cellspacing="3" border="0" width="100%">
					<tr>
						<td width="82%">
						<input class="fminpt" maxlength="8" name="Form_SavePoints" size="8" value="<%=htmlencode(Form_SavePoints)%>">
						<%=DEF_PointsName%>
						<font color="blue" class="bluefont"><span style="cursor:hand" onclick="LeadBBSBankS.Form_SavePoints.value=<%=SaveMax%>">最多 <%=SaveMax&" "&DEF_PointsName%></span></font>
						</td>
						<td align="right" width="18%">
						<input name="submit" type="submit" value=" 存 入 " class="fmbtn"><img src=../images/BLANK.GIF width=20 height=1>
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</form><%
				End If
				If SavePoints > 0 Then%>
		<form action="UserBank.asp" method="post" name="LeadBBSBankG" onsubmit="Check(this, this.Form_GetPoints, '存款', <%=SavePoints + MPoints%>); return ValidationPassed">
			<tr class="TBBG9" height="30">
				<td width="12%" align="right">取款：</td>
				<td>
				<input type="hidden" name="SubmitFlag" value="Get"><%
				If DEF_EnableAttestNumber > 2 Then Response.Write "<input type=hidden name=ForumNumber>"%>
				<table cellpadding="1" cellspacing="3" border="0" width="100%">
					<tr>
						<td width="82%">
						<input class="fminpt" maxlength="8" name="Form_GetPoints" size="8" value="<%=htmlencode(Form_GetPoints)%>">
						<%=DEF_PointsName%>
						<font color="blue" class="bluefont"><span style="cursor:hand" onclick="LeadBBSBankG.Form_GetPoints.value=<%=SavePoints + MPoints%>">最多 <%=SavePoints + MPoints & " " & DEF_PointsName%></span></font>
						</td>
						<td align="right" width="18%">
						<input name="submit" type="submit" value=" 取 出 " class="fmbtn"><img src=../images/BLANK.GIF width=20 height=1>
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</form><%
				End If
			End If
			If SavePoints > 0 and DEF_BK_SET_Move=1 Then%>
		<form action="UserBank.asp" method="post" name="LeadBBSBankM" onsubmit="Check(this, this.Form_MovePoints, '存款', <%=SavePoints + MPoints%>); return ValidationPassed">
			<tr class="TBBG9" height="30">
				<td width="12%" align="right">转帐：</td>
				<td>
				<input type="hidden" name="SubmitFlag" value="Move"><%
				If DEF_EnableAttestNumber > 2 Then Response.Write "<input type=hidden name=ForumNumber>"%>
				<table cellpadding="1" cellspacing="3" border="0" width="100%">
					<tr>
						<td width="82%">
						<input class="fminpt" maxlength="8" name="Form_MovePoints" size="8" value="<%=htmlencode(Form_MovePoints)%>">
						<%=DEF_PointsName%> 到 
						<input class="fminpt" maxlength="14" name="Form_MovePointsTo" size="14" value="<%=htmlencode(Form_MovePointsTo)%>">
						<font color="blue" class="bluefont"><span style="cursor:hand" onclick="LeadBBSBankM.Form_MovePoints.value=<%=SavePoints + MPoints%>">最多 <%=SavePoints + MPoints & " " & DEF_PointsName%></span></font>
						</td>
						<td align="right" width="18%">
						<input name="submit" type="submit" value=" 转 帐 " class="fmbtn"><img src=../images/BLANK.GIF width=7 height=1><%
						If DEF_BK_SET_Massage Then
							Response.Write "<img src=../images/" & GBL_DefineImage & "frame/plus.gif id=MovePointsMsgDivT name=MovePointsMsgDivT style=cursor:hand onclick=MovePointsMsgDivSH()>"
						Else
							Response.Write "<img src=../images/BLANK.GIF width=10 height=1>"
						End If
						%><img src=../images/BLANK.GIF width=3 height=1>
						</td>
					</tr><%
					If DEF_BK_SET_Massage Then%>
					<tr id="MovePointsMsgDiv" name="MovePointsMsgDiv" class="TBBG9" <%If movepointsmsgdivflag <> "Show" then response.write "style=display:none"%>>
						<td colspan="2">
						<input type="hidden" name="MovePointsMsgDivFlag" value="<%=MovePointsMsgDivFlag%>">
						<img src="../images/BLANK.GIF" width="1" height="3"><br />
						<font corlor="blue" class="bluefont">转帐消息：</font><br />
						<script language="javascript">
						function storeCaret(textEl)
						{
							if (textEl.createTextRange) 
							textEl.caretPos = document.selection.createRange().duplicate(); 
						}
						function MovePointsMsgDivSH()
						{
							if(LeadBBSBankM.MovePointsMsgDivFlag.value=="Show")
							{
								LeadBBSBankM.MovePointsMsgDivFlag.value="";
								MovePointsMsgDiv.style.display="none";
								document.MovePointsMsgDivT.src="../images/<%=GBL_DefineImage%>frame/plus.gif";
							}
							else
							{
								LeadBBSBankM.MovePointsMsgDivFlag.value="Show";
								MovePointsMsgDiv.style.display="block";
								document.MovePointsMsgDivT.src="../images/<%=GBL_DefineImage%>frame/minus.gif";
							}
						}
						</script>
						<textarea cols="58" name="BK_Msg_Content" rows="10" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" class="fmtxtra"><%If BK_Msg_Content<>"" Then Response.Write VbCrLf & Htmlencode(BK_Msg_Content)%></textarea>
						<%
						If DEF_UBBiconNumber > 0 Then
						%><br />
						<img src="../images/BLANK.GIF" width="1" height="6"><br />
						<script language="javascript">
						for(var a=1;a<=<%=DEF_UBBiconNumber%>;a++){if(a<10){a="0"+a};document.write("<img src=../images/UBBicon/em"+a+".GIF width=20 height=20 align=absmiddle style=cursor:hand onclick=smilie('[em"+a+"]')> ");}
						function smilie(smilietext)
						{
							smilietext=smilietext;
							if (document.LeadBBSBankM.BK_Msg_Content.createTextRange && document.LeadBBSBankM.BK_Msg_Content.caretPos)
							{
								var caretPos = document.LeadBBSBankM.BK_Msg_Content.caretPos;
								caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? smilietext + ' ' : smilietext;document.LeadBBSBankM.BK_Msg_Content.focus();
							}
							else
							{
								document.LeadBBSBankM.BK_Msg_Content.value+=smilietext;document.LeadBBSBankM.BK_Msg_Content.focus();
							}
						}
						</script><br />
						<img src="../images/BLANK.GIF" width="1" height="6"><br /><%
						Response.Write "最长 " & DEF_MaxTextLength/2-100 & " 字超过截断。"
						End If%></td>
					</tr><%
					End If%></table>
				</td>
			</tr>
		</form><%
			End If
		Else
			Response.Write "<tr class=TBBG9 height=19 align=center><td><font color=Red class=RedFont>对不起，您的帐号被冻结了，请联系您的管理员。</font></td></tr>"
		End If%>
	</table><%
	End If
	If SuperUserFlag = 1 Then
		Response.Write "<p><b>管理：</b></p><p>"
		Response.Write "1. <a href=""" & DEF_BBS_HomeUrl & DEF_ManageDir & "/user/banksetup.asp"">银行管理</a><br />"
		Response.Write "2. <a href=""" & DEF_BBS_HomeUrl & DEF_ManageDir & "/user/banklog.asp"">银行日志察看</a><br />"	
		Response.Write "3. <a href=""" & DEF_BBS_HomeUrl & DEF_ManageDir & "/user/SendGroupMessage.asp"">群发发钱</a><br />"	
		Response.Write "4. <a href=""sendmessage.asp"">单用户奖励</a><br />"
		Response.Write "</p>"
	End If
	
	Response.Write "<p><b>说明：</b></p><p>"
	Response.Write "1."
	If DEF_BK_SET_Limit_Total = 0 Then
		Response.write "每次"
	End If
	Response.Write "存款极限和您的等级有关，具体请查看<a href=help/help.asp#UserLevel>系统帮助</a>。<br />"
	Response.Write "2.转帐时请认真填写用户名，和存款数。<br />"
	If GetBinarybit(GBL_CHK_UserLimit, 15) = 1 Then
		Response.Write "3.您拥有 VIP 用户 特权，存款极限为普通用户的 " & DEF_UserPoints_VIP_m & " 倍。<br />"
	End If
	Response.Write "</p>"
	Response.Write "<p><b>注意：</b></p>"
	Response.Write "营业时间：" & DEF_BK_SET_OpenAt & ":00:00 至 " & DEF_BK_SET_CloseAt & ":59:59"
	Response.Write "<p color=red class=redfont>"
	If DEF_BK_SET_Default=0 then Response.write "论坛当前禁止存款取款。<br />"
	If DEF_BK_SET_Move=0 then Response.write "论坛当前禁止转帐。"
	Response.Write "</p>"
	Response.Write "<p>LeadBBS Bank v0.5 Reloaded - LeadBBS 3.14 Plus! Powered By ashi</p>"
	
End Function
%>