<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("cancheckmoney")="" Then
	ef=True
	ec="您没有此操作的权限。"
ElseIf Request.QueryString ("username")<>"" and RegExpTest("[^A-Za-z0-9]",Request.QueryString ("username")) Then
	ef=True
	ec="用户名非法字符！"
ElseIf Request.QueryString ("pingzheng")<>"" and Instr(Request.QueryString ("pingzheng"), "'")>0 Then
	ef=True
	ec="凭证非法字符！"
ElseIf Request.QueryString ("key")<>"" and Instr(Request.QueryString ("key"), "'")>0 Then
	ef=True
	ec="key非法字符！"
ElseIf Request.QueryString ("starttime")<>"" and Instr(Request.QueryString ("starttime"), "'")>0 Then
	ef=True
	ec="starttime非法字符！"
ElseIf Request.QueryString ("endtime")<>"" and Instr(Request.QueryString ("endtime"), "'")>0 Then
	ef=True
	ec="endtime非法字符！"
ElseIf Request.QueryString ("starttime")<>"" and not IsDate (Request.QueryString ("starttime")) then
	ef=True
	ec="不合法的日期！"
ElseIf Request.QueryString ("endtime")<>"" and not IsDate (Request.QueryString ("endtime")) then
	ef=True
	ec="不合法的日期！"
ElseIf Request.QueryString ("endtime")<>"" and Request.QueryString ("starttime")="" then
	ef=True
	ec="超始日期都要输入！"
ElseIf Request.QueryString ("starttime")<>"" and Request.QueryString ("endtime")="" then
	ef=True
	ec="起始与结束日期都要输入！"
end if
if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsmoney = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_moneylog where isdel is null order by id desc"
if Request.QueryString ("op") ="all" then Sql="Select * from FreeHost.FreeHost_moneylog where isdel is null and isnew is null order by id desc"
if Request.QueryString ("op") ="notget" then Sql="Select * from FreeHost.FreeHost_moneylog where isdel is null and isnew is null and haveget='否'"
if Request.QueryString ("op") ="notcheck" then Sql="Select * from FreeHost.FreeHost_moneylog where  isdel is null and isnew is null and havecheck='否'"

if Request.QueryString ("op") ="search" then
If Request.QueryString ("username")<>"" then Sql="Select * from FreeHost.FreeHost_moneylog where  isdel is null and isnew is null and (username='"&Request.QueryString ("username")&"' or opusername='"&Request.QueryString ("username")&"')  order by id desc" 
If Request.QueryString ("pingzheng")<>"" then Sql="Select * from FreeHost.FreeHost_moneylog where  isdel is null and isnew is null and (pingzheng='"&Request.QueryString ("pingzheng")&"') order by id desc" 
If Request.QueryString ("key")<>"" then Sql="Select * from FreeHost.FreeHost_moneylog where  isdel is null and isnew is null and (type1 like '%"&Request.QueryString ("key")&"%' or bank like '%"&Request.QueryString ("key")&"%' or forwhat like '%"&Request.QueryString ("key")&"%' or corewhat like '%"&Request.QueryString ("key")&"%' or whichProduct like '%"&Request.QueryString ("key")&"%'  )order by id desc" 
If Request.QueryString ("starttime")<>"" then Sql="Select * from FreeHost.FreeHost_moneylog where  isdel is null and isnew is null and (attime>'"&Request.QUERYSTRING ("starttime")&"' and attime<'"&Request.QUERYSTRING ("endtime")&"') order by id desc" 
end if
	dsmoney.PageSize = 25
if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsmoney.Open Sql,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
p9,body,td,p,br,input {  font-size: 9pt}
A:visited {	COLOR: white; TEXT-DECORATION: none}
A:hover { COLOR: red; TEXT-DECORATION: underline}
A:link { TEXT-DECORATION: none;COLOR: white;}
-->
</style>
<title>财务记录</title>
</head>
<body bgColor=#F5F5F5  leftmargin="0" topmargin="0" rightmargin="0" marginwidth="0" marginheight="0" BOTTOMMARGIN="0"><br>

<%
if dsmoney.Eof then
%>
<br>数据库中不存在款项操作记录。
<%
else
if Request.ServerVariables("QUERY_STRING")<>"" then
ask=Split(Request.ServerVariables("QUERY_STRING"), chr(38)&"pn")
else
ask=Split("freehost=1", "")
ask(0)="freehost=lsoft"
end if
	pn=1
if Request.QueryString ("pn")<>"" then pn=Request.QueryString ("pn")
If dsmoney.RecordCount <> 0 Then dsmoney.AbsolutePage = CLng(pn)  
    if clng(pn)<=10 then
    begini=1
      if dsmoney.PageCount<=10 then
       endini=dsmoney.PageCount 
       else
       endini=10
      end if
    end if
%>
<%if clng(pn)<=10 then%>最新 <%for i=begini to endini
    if clng(pn)=i then%><font color=red>[<%=i%>]</font><%else%><a href="?<%=ask(0)%>&pn=<%=i%>"><font color="#000000">[<%=i%>]</font></a><%end if%>　<%next%> 
        <%else%>　<a href="?<%=ask(0)%>&pn=1"><font color="#000000">最新[1]--[10]</font></a>　　现在是第<font color=red>[<%=pn%>]</font>页 
        　共<%=dsmoney.PageCount%>页　<%end if%><%If Clng(pn)>1 Then%><a href="?<%=ask(0)%>&pn=<%=pn-1%>"><font color="#000000">上一页</font></a>
        <%End If%>|<%If Clng(pn)<dsmoney.PageCount Then%><a href="?<%=ask(0)%>&pn=<%=pn+1%>"><font color="#000000">下一页</font></a>
        <%End If%>
<table width="100%"  border="0" cellspacing="1" bgcolor="#000000">
  <tr bgcolor="#CCCCCC">
    <td width="4%" align="center">编号</td>    
    <td width="8%" align="center">用户名</td>
	<td width="9%" align="center" bgcolor="#CCCCCC">操作人</td>
    <td width="6%" align="center" bgcolor="#CCCCCC">分类</td>
    <td width="8%" align="center">银行</td>
    <td width="9%" align="center">时间</td>
    <td width="7%" align="center">金额</td>
    <td width="12%" align="center">原因</td>
    <td width="13%" align="center">内部记录</td>
    <td width="8%" align="center">产品及ID</td>
    <td width="4%" align="center">到帐</td>
    <td width="4%" align="center">审核</td>
    <td width="3%" align="center">凭证</td>
    <td width="2%" align="center">删</td>
  </tr>
<%
For N=1 To dsmoney.PageSize 
					If dsmoney.RecordCount=0 Then Exit For
%>

  <tr bgcolor="<%if dsmoney("id") mod 2 =0 then%>#EEEEEE<%else%>yellow<%end if%>">
    <td width="4%" align="center"><%=dsmoney("id")%></td>
    <td width="8%" align="center"><a href="searchuser.asp?username=<%=dsmoney("username")%>" target="_blank"><font color="black"><%=dsmoney("username")%></font></a></td>
	<td width="9%" align="center"><a href="searchuser.asp?username=<%=dsmoney("opusername")%>" target="_blank"><font color="black"><%=dsmoney("opusername")%></font></a></td>
    <td width="6%" align="center"><%=dsmoney("type1")%></td>
    <td width="8%" align="center"><%=dsmoney("bank")%><br>    </td>
    <td width="9%" align="center"><%=dsmoney("attime")%></td>
    <td width="7%" align="center"><%=dsmoney("usermoney")%></td>
    <td width="12%" align="center"><%=dsmoney("forwhat")%></td>
    <td width="13%" align="center"><%=dsmoney("corewhat")%></td>
    <td align="center"><%=dsmoney("whichProduct")%><%if IsNumeric(dsmoney("pdid")) then
if	dsmoney("pdid")<>0 then%>(<%=dsmoney("pdid")%>)<%end if
end if%></td>
    <td width="4%" align="center"><a href="moneyallop.asp?qs=<%=server.URLEncode (request.QueryString)%>&id=<%=dsmoney("id")%>&op=get"><font color="<%if dsmoney("haveget")="否" then%>red<%else%>#000000<%end if%>"><%=dsmoney("haveget")%></font></a></td>
    <td width="4%" align="center"><a href="moneyallop.asp?qs=<%=server.URLEncode (request.QueryString)%>&id=<%=dsmoney("id")%>&op=check"><font color="<%if dsmoney("havecheck")="否" then%>red<%else%>#000000<%end if%>"><%=dsmoney("havecheck")%></font></a></td>
    <td width="3%" align="center"><%=dsmoney("pingzheng")%></td>
    <td width="2%" align="center"><a href="moneyallop.asp?qs=<%=server.URLEncode (request.QueryString)%>&id=<%=dsmoney("id")%>&op=del"><font color="#000000">删</font></a></td>
  </tr>
<%
If clng(pn)=dsmoney.PageCount Then
I = dsmoney.RecordCount - (dsmoney.PageCount-1) * dsmoney.PageSize
If N=I Then Exit For
End If
dsmoney.movenext
Next%>
<%
end if
dsmoney.close
set dsmoney=nothing%>
</table>
<br>
<br>
</body>
</html>
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
