<!-- #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/bbsmanage_Fun.asp -->
<%
DEF_BBS_HomeUrl = "../../"
Const MaxLinkNum = 100
Dim GBL_ID
initDatabase
GBL_CHK_TempStr = ""
GBL_ID = checkSupervisorPass

Dim XmlFlag, XML, XmlCount

SiteHead(DEF_SiteNameString & " - 管理员")
UserTopicTopInfo
DisplayUserNavigate("LeadBBS Bank 0.5 日志察看")
If GBL_CHK_Flag=1 Then
	CheckXML
	SiteLink
Else%>
	<table width=96%>
	<tr>
	<td>
	<%
	If Request("submitflag")="" Then
		Response.Write "<br><b>请先登录</b>"
	Else
		Response.Write "<br><p align=left><font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font>"
	End If
	DisplayLoginForm
	Response.Write "</p>"%>
	</td>
	</tr>
	</table>
<%End If
UserTopicBottomInfo
closeDataBase
SiteBottom
If GBL_ShowBottomSure = 1 Then Response.Write GBL_SiteBottomString

Function SiteLink

	%>
	<p>银行操作察看</p>
	<table border=0 cellpadding=5 cellspacing=1 width="100%" bgcolor="<%=DEF_BBS_LightColor%>" class=TBBG1>
		<tr bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
			<td>用户</td>
			<td>操作</td>
			<td>转帐目标</td>
			<td>请求金额</td>
			<td>除税金额</td>
			<td>服务金额</td>
			<td>时间</td>
			<td>IP</td>
		</tr>
		<%
		If DEF_BK_SET_WriteLog = 0 Or XmlFlag = 0 Then
			Response.write "<tr><td colspan=8>对不起，您的银行没有开启日志功能。</td></tr>"
		ElseIf xmlCount = 0 Then
			Response.Write "<tr><td colspan=8>对不起，您的银行日志里没有信息。</td></tr>"
		Else
			ShowList()
		End If
		%>
	</table>
	<%
End Function

Sub ShowList
	
	Dim itemcount, pagecount, Node, curpage, i0, i1, LastNode, a(7)
	Set Xml = Server.CreateObject("MSXML2.DOMDocument.3.0")
	Xml.Load(Server.MapPath(Replace(Replace(DEF_BBS_HomeUrl & DEF_BK_LogPath, "/", "\"), "\\", "\")))
	Set Node = Xml.SelectNodes("//actions/a")
	itemcount = xmlcount
	pageCount = itemcount \ DEF_MaxListNum
	If itemcount mod DEF_MaxListNum > 0 Then pagecount = pagecount + 1
	curpage = Request.Form("p")
	If isNumeric(curpage) = False Then curpage = pagecount
	curpage = clng(curpage)
	If curpage < 1 Then curpage = 1
	If curpage > pagecount Then curpage = pagecount
	LastNode = curpage * DEF_MaxListNum
	If lastnode > itemcount then lastnode = itemcount
	lastnode = lastnode - 1
	For i0 = (curpage - 1) * DEF_MaxListNum To LastNode
		For i1 = 0 To 6
			a(i1) = Node.item(i0).attributes(i1).text
		Next
		If a(1) = "转帐" Then a(7) = Node.item(i0).attributes(7).text
		Response.Write "<tr><td>" & a(0) & "</td><td>" & a(1) & "</td><td>" & a(7) & "</td><td>" & a(2) & "</td>" & _
				"<td>" & a(3) & "</td><td>" & a(4) & "</td><td>" & a(5) & "</td><td>" & a(6) & "</td></tr>"
	Next
	If pagecount > 1 Then Response.write "<tr><form action=banklog.asp method=post name=f><td colspan=7 align=center>跳转页 " & _
						"<input type=text size=4 name=p value=" & curpage & " class=fminpt /> / <span style=cursor:hand onclick=f.p.value=" & pagecount & ">" & pagecount & "</span></td><td>" & _
						"<input type=submit value=确认 class=fmbtn></td></form></tr>"
	
End Sub

Function CheckLinkValue

	GetFormValue
	
End Function

Function CheckXML
	
	'On Error Resume Next
	XMLFlag = 1
	Set Xml = Server.CreateObject("MSXML2.DOMDocument.3.0")
	If Err <> 0 Then
		Err.Clear
		XmlFlag = 0
	Else
		Xml.Load(Server.MapPath(Replace(Replace(DEF_BBS_HomeUrl & DEF_BK_LogPath, "/", "\"), "\\", "\")))
		If Xml.parseError <> 0 And DEF_BK_SET_WriteLog Then
			Xml.LoadXml("<?xml version=""1.0"" encoding=""utf-8""?><actions />")
			Xml.Save(Server.MapPath(Replace(Replace(DEF_BBS_HomeUrl & DEF_BK_LogPath, "/", "\"), "\\", "\")))
		End If
		XmlCount = Xml.SelectNodes("//actions/a").length
	End If
	Set Xml = Nothing
	
End Function
%>