<!--#include file="check.asp"-->
<%
Call hrPower(8.2,0)
dim action
id=request.QueryString("id")
name=request.QueryString("name")
ip=request.QueryString("ip")
Nowpage=cint(request.QueryString("page"))
startdate=request("startdate")
if startdate="" or isnull(startdate) then startdate=date()
enddate=request("enddate")
if enddate="" or isnull(enddate) then enddate=date()

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>日志</title>
<link href="images/main.css" rel="stylesheet" type="text/css" media="all" />
<script src="js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
</head>
<!--#include file="top.asp"-->
<div id="systime"><p id="servertime"></p></div>
<div id="mainBody" >

<div class="space">&nbsp;</div>
<div class="list">

<script language="javascript">
try{
    var nav="H09";
    var subnav="L0902";
	
    document.getElementById(nav).className="current";
    document.getElementById(subnav).className="first current";
    document.getElementById(subnav).parentNode.parentNode.style.display="block";

}catch(e){
	document.getElementById("H09").className="current";
}
</script>





<td>
<input type="button" value="管理日志" class="button" onclick="location.href='?id=2'" />
</td>
<td>
<input type="button" value="代理日志" class="button" onclick="location.href='?id=1'" />
</td>
<td>
<input type="button" value="商户日志" class="button" onclick="location.href='?id=0'" />
</td>

<table class="listtable">
  <thead>
    <tr>
      <th scope="col">id</th>
	  <th scope="col">帐号</th>
	  <th scope="col">登录时间</th>
            <th scope="col">登录IP</th>
            <th scope="col">信息</th>

    </tr>
  </thead>
  <tbody> 




          <%

		   if name="" then name=request.form("name")
		   if id="" then id=request.form("id")
		   if ip="" then ip=request.form("ip")

		   if name<>"" then 
		   if not searchstr="" then searchstr=searchstr+" and "
 		   searchstr=searchstr+"username='"&name&"'"
		   end if

		   if id<>"" then 
		   if not searchstr="" then searchstr=searchstr+" and "
 		   searchstr=searchstr+"flag="&id&""
		   end if	


		   if ip<>"" then 
		   if not searchstr="" then searchstr=searchstr+" and "
 		   searchstr=searchstr+"ip='"&ip&"'"
		   end if


		   if isdate(startdate) then 
		      if not searchstr="" then searchstr=searchstr+" and "
 		      searchstr=searchstr+"datediff(d,logdate,'"&startdate&"')<=0"
		   end if

		   if isdate(enddate) then 
		      if not searchstr="" then searchstr=searchstr+" and "
		      searchstr=searchstr+"datediff(d,logdate,'"&enddate&"')>=0"
		   end if



		   if not searchstr="" then searchstr=" where "+searchstr	

  

		   set Rs=GrateRs("select * from login_log"&searchstr&" order by id desc",1)
		   Rs.PageSize=31
		   if not Rs.eof then 
		   If Nowpage=0 then Nowpage=1
		   Rs.AbsolutePage=Nowpage 
		   i=1
		   do while not Rs.eof and i<=Rs.pagesize
		   %>
<%if i mod 2 =0 then%>
         <tr class="listtr1" >
<%else%>
         <tr class="listtr2" >
<%end IF%>
                                            <td class="date"> <span class="large-orange"><%=rs("id")%></span></td>
                                            <td class="date"><%=rs("username")%></td>
                                            <td class="date"><%=rs("logdate")%></td>
                                            <td class="date"><%=rs("ip")%>(<%=showCountry(""&rs("ip")&"") %>)</td>
                                            <td class="date"><%=rs("Errstr")%></td>
            </tr>

          <%
		   i=i+1
		   Rs.movenext
		   loop
		   else
		   %>
<tr onmouseover="this.oldcolor=this.style.backgroundColor;this.style.backgroundColor='infobackground'" onmouseout="this.style.backgroundColor=this.oldcolor" style="color:#284775;background-color:White;">
            <td height="20" colspan="6">无日志</td>
            </tr>
		   <%
		   end if
		  %>
<tr onmouseover="this.oldcolor=this.style.backgroundColor;this.style.backgroundColor='infobackground'" onmouseout="this.style.backgroundColor=this.oldcolor" style="color:#284775;background-color:White;">
            <td height="26" colspan="6">&nbsp;<strong>&nbsp;&nbsp;翻页: :</strong>
                <%
				
  myurl="log.asp?id="&id&"&name="&name&"&ip="&ip&"&startdate="&startdate&"&enddate="&enddate&"&"
 response.write("共："&Rs.recordcount&"条记录，共:"&Rs.PageCount&"页,"&Rs.PageSize&"条/页,第"&NowPage&"页&nbsp;")
  response.write("<a href='"&myurl&"page=1'>"&"首页</a>&nbsp;")
  if NowPage>1 then response.write("<a href='"&myurl&"page="&Nowpage-1&"'>上一页</a>&nbsp;")
  if NowPage<Rs.PageCount then response.write("<a href='"&myurl&"page="&Nowpage+1&"'>下一页</a>&nbsp;")
  response.write("<a href='"&myurl&"page="&Rs.PageCount&"'>尾页</a>&nbsp;")
		%>
          &nbsp;</td>
          </tr>
            <form name="form1" method="post" action="">
<tr onmouseover="this.oldcolor=this.style.backgroundColor;this.style.backgroundColor='infobackground'" onmouseout="this.style.backgroundColor=this.oldcolor" style="color:#284775;background-color:White;">
              <td height="30" colspan="5" bgcolor="#FFFFFF">
                  <label>帐号&nbsp;&nbsp;
                  <input name="name" type="text" class="inputbox" value="<%=name%>" id="name" size="20">
IP&nbsp;&nbsp;
                  <input name="ip" type="text" class="inputbox" value="<%=ip%>" id="ip" size="20">
              &nbsp;&nbsp;&nbsp;开始时间&nbsp;&nbsp;              <input name="startdate" type="text" class="inputbox" id="startdate" size="20" value="<%=startdate%>" onClick="WdatePicker()" readonly>
              &nbsp;&nbsp;&nbsp;&nbsp;结束时间&nbsp;&nbsp;
              <input name="enddate" type="text" class="inputbox" id="enddate" value="<%=enddate%>" size="20" onClick="WdatePicker()" readonly>
&nbsp;&nbsp;&nbsp;&nbsp;
<input name="Submit" type="submit" class="inputbutton" value="  立即查询  ">
                  </label>
           
                </td>   </form>
              </tr>
          </table>
       </td>
      </tr>
	  

    </table></td>
  </tr>
</table>
</body>
</html>