<!--#include file="conn.asp" -->
<% adm_power_page=5 '分配本页的用户访问权限 %>
<!--#include file="admin_dn.asp" -->
<%




if Trim(Request.QueryString("w"))="del1" then
 sql="delete from memo where id="&request("id")
 conn.execute(sql)
 %><script language="VBScript" type="text/VBScript">
msgbox "日志删除成功"
</script>

 
 <%
 end if
dim mo1(12),da1(31),mo2(12),da2(31)


 
if Trim(Request("w"))="search" then
  if Trim(Request("select"))="dat" then
   sql="select * from memo where dat=#"&request("search")&"# order by id desc"
 end if
 if Trim(Request("select"))="userid" then
   sql="select * from memo where userid='"&request("search")&"' order by id desc" 
end if 
 
else
if session("sql_14")=empty then
 sql="select * from memo where mid(dat,1,10)=date() order by id desc"
else
 sql=session("sql_14")
end if 
end if

if Trim(Request("w"))="searchd" then

da3=Trim(Request.Form("year1"))&"-"&Trim(Request.Form("month1"))&"-"&Trim(Request.Form("day1"))
da4=Trim(Request.Form("year2"))&"-"&Trim(Request.Form("month2"))&"-"&Trim(Request.Form("day2"))+1
'Response.Write(da3)
'Response.Write(da4)
 sql="select * from memo where dat between #"&da4&"# and #"&da3&"#"
'sql="select * from memo where dat between #2003-4-1# and #2003-5-1#"
end if

'Response.Write(sql)
 %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>:::管理页面:::</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>

<body leftmargin="2" topmargin="0">
<p align="left">财务日志管理</p>
<form name="form1" method="post" action="adm_14.asp?w=search">
  <table width="86%" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr> 
      <td width="15%">关键字：</td>
      <td width="85%"><input name="search" type="text" id="search" size="15">
        搜索类目： <select name="select">
          <option value="userid" selected>用户名</option>
          <option value="dat">日期</option>
        </select> <font color="#FF0000"> 
        <input type="submit" name="Submit" value="查询">
        日期以 年-月-日</font></td>
    </tr>
  </table>
</form>
<form name="form2" method="post" action="adm_14.asp?w=searchd">
  <p align="center">按日期搜索： 
    <input name="year1" type="text" id="year1" value="<%=year(now)%>" size="4">
    年 
    <select name="month1" id="month1">
      <% for i= 1 to 12
	  
 if i=month(now)-1 then
 mo1(i)="selected"
 else
 mo1(i)=""
 end if
	   %>
      <option value="<%= i%>" <%= mo1(i) %>><%= i %></option>
      <% next %>
    </select>
    月 
    <select name="day1" id="day1">
      <% for i= 1 to 31 
	  if i=day(now) then
 da1(i)="selected"
 else
 da1(i)=""
 end if
 %>
      <option value="<%= i%>" <%= da1(i) %>><%= i %></option>
      <% next %>
    </select>
    日 <font color="#FF0000">至</font> 
    <input name="year2" type="text" id="year2" value="<%=year(now)%>" size="4">
    年 
    <select name="month2" id="month2">
      <% for i= 1 to 12
	  
 if i=month(now) then
 mo1(i)="selected"
 else
 mo1(i)=""
 end if
	   %>
      <option value="<%=i%>" <%= mo1(i) %>><%= i %></option>
      <% next %>
    </select>
    月 
    <select name="day2" id="day2">
      <% for i= 1 to 31 
	  if i=day(now) then
 da1(i)="selected"
 else
 da1(i)=""
 end if
 %>
      <option value="<%= i%>" <%= da1(i) %>><%= i %></option>
      <% next %>
    </select>
    日 <font color="#FF0000"> 
    <input type="submit" name="Submit2" value="查询">
    </font></p>
</form>
<p align="center">&nbsp;</p>
<p align="center">－<a href="adm_14_all.asp">显示所有财务管日</a>－　-<a href="adm_14.asp">显示今天财务日志</a>-</p>
<table width="100%" height="55" border="0" cellpadding="0" cellspacing="1">
  <tr bgcolor="#000066"> 
    <td width="7%" height="12"> 
      <div align="center"><font color="#FFFFFF">用户名</font></div></td>
    <td width="9%"> 
      <div align="center"><font color="#FFFFFF">操 作</font></div></td>
    <td width="29%"> 
      <div align="center"><font color="#FFFFFF">项 目</font></div></td>
    <td width="11%"> 
      <div align="center"><font color="#FFFFFF">备 注</font></div></td>
    <td width="8%"> 
      <div align="center"><font color="#FFFFFF">入 账</font></div></td>
    <td width="10%"> 
      <div align="center"><font color="#FFFFFF">支 出</font></div></td>
    <td width="11%"> 
      <div align="center"><font color="#FFFFFF">余 额</font></div></td>
    <td width="15%"> 
      <div align="center"><font color="#FFFFFF">交易日期</font></div>
      <div align="center"><font color="#FFFFFF"></font></div></td>
  </tr>
  <% 		  

session("sql_14")=sql

pp=30
rs.open sql,conn,1,1 
if not rs.eof then
  count=rs.recordcount
    if count=empty then
      count=0
    end if
    if count/pp>(count\pp) then
        totalpage=(count\pp)+1
  else
   totalpage=(count\pp)
    end if
end if 
 pagecount=cint(request.querystring("topage"))                              
 if pagecount<=0 then pagecount=1
 if pagecount>totalpage then pagecount=totalpage
 
 
 
if not rs.eof then
  rs.movefirst
 rs.move (pagecount-1)*pp
 i=0
 while not rs.eof and i<pp
 i=I+1
			  
			   %>
  <tr bgcolor="#EEF7FF" onmouseover="this.style.backgroundColor='#FFF0F0';return true;" onmouseout="this.style.backgroundColor='#EEF7FF';"> 
    <td height="21"> <div align="center"><font color="#FF0000"><a href=adm_10.asp?w=search&select=userid&search=<%= rs("userid") %>><%= rs("userid") %></a></font></div></td>
    <td> <div align="center"><font color="#FF0000"><%= rs("log") %></font></div></td>
    <td> <%= rs("body") %></td>
    <td><div align="center"><a href="#" title=<%=rs("bak")%>>备注</a> 
      </div></td>
    <td> <div align="center"><font color="#000066"> 
        <% if rs("je")<0 then 
				 Response.Write("/")
				 else 
				 Response.Write(rs("je"))
				 end if%>
        </font></div></td>
    <td> <div align="center"><font color="#000066"> 
        <% if rs("je")>=0 then 
				 Response.Write("/")
				 else 
				 Response.Write(rs("je"))
				 end if%>
        </font></div></td>
    <td> <div align="center"><font color="#000099"><%= rs("zje") %></font></div></td>
    <td> <div align="center"><font color="#FF0000"><%= rs("dat") %></font></div>
      <div align="center"></div></td>
  </tr>
  <% 
			  rs.movenext
			  wend
			  end if
			  rs.close %>
  <tr bgcolor="#000066"> 
    <td height="18" colspan="8"><font color="#FFFFFF">一共有:<%= count %> 条　一共:<%= totalpage %> 页 当前: <%= pagecount %> 页</font>d　<font color="#FFFFFF"> 
      <% 
	  if totalpage>1 then
	     if totalpage-pagecount>0 then
	  %>
      <a href="adm_14.asp?topage=<%=pagecount+1%>"><font color=#FFFFFF>下一页</font></a> 
      <% 
	   
	  end if
	  if pagecount<>1 and totalpage-pagecount>0 then 
	   response.write "<font color=#FFFFFF>/</font>"
	   end if
	   
	   if pagecount<>"1" then %>
      <a href="adm_14.asp?topage=<%=pagecount-1%>"><font color=#FFFFFF>上一页</font></a>　 
      <% 
	  end if
	  end if
	  %>
      　</font></td>
  </tr>
</table>
<p align="center">&nbsp;</p>
<p align="center">&nbsp;</p>
</body>
</html>
