query.asp
来自「投资管理系统, asp+ mssql server」· ASP 代码 · 共 325 行 · 第 1/2 页
ASP
325 行
<%
response.expires=-1
typet=trim(request("typet"))
if typet="" or typet="0" then
typet=1
end if
%>
<!--#include file="inc/permission.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/SearAtt.asp"-->
<%
LoginName=Session("LoginName")
TMoney1=""
TMoney2=""
if trim(request("sbumit"))<>"All" then
Attribute=int(request("Attribute"))
Attribute2=request("Attribute2")
if Attribute2="" then
Attribute2=0
else
Attribute2=int(Attribute2)
end if
SearchText=request("SearchText")
TMoney1=trim(request("TMoney1"))
if TMoney1="" then
TMoney1="0"
TMoney11=""
else
TMoney11=TMoney1
end if
TMoney2=trim(request("TMoney2"))
if TMoney2="" then
TMoney2="0"
TMoney22=""
else
TMoney22=TMoney2
end if
else
Attribute=0
Attribute2=0
SearchText=""
end if
if TMoney11="0" and TMoney22="0" then
TMoney11=""
TMoney22=""
end if
set rs=server.createobject("adodb.recordset")
set rsy=server.createobject("adodb.recordset")
Attribute3="("&Attribute&":"&Attribute2&")"
Sqlstr="select * from tblBase where State="&int(typet)&" and YeZhu='"&LoginName&"'"
if Attribute2<>0 then
Sqlstr=Sqlstr&" and Attribute like '%"&Attribute3&"%'"
end if
if TMoney1<>"0" or TMoney2<>"0" then
Sqlstr=Sqlstr&" and Money>="&TMoney1&" and Money<="&TMoney2
end if
Sqlstr=Sqlstr&" and Name like '%"&SearchText&"%' order by InputTime Desc"
rs.open Sqlstr,conn,1,1
if not rs.eof then
'**********************
TotalMoney=0
do while not rs.eof
TotalMoney=TotalMoney+rs("Money")
rs.movenext
loop
rs.movefirst
'**********************
rs.pagesize=20
pagesize=rs.pagesize
pagecount=rs.pagecount
absolutepage=trim(request("absolutepage"))
if absolutepage=empty then
absolutepage=1
else
rs.absolutepage=absolutepage
end if
total=rs.recordcount
end if
num=cint(absolutepage-1)*pagesize
%>
<HTML>
<HEAD>
<TITLE>投资项目管理查询系统</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK rel=stylesheet href="../css/main.css" type="text/css">
</HEAD>
<BODY bgColor=#CC9933 leftMargin=0 topMargin=0>
<TABLE cellPadding=0 width=773 align=center bgColor=#FFCC66 border=0 bordercolor="#FFFFFF">
<TR>
<TD
style="BORDER-RIGHT: #996600 1px solid; BORDER-TOP: #996600 1px solid; BORDER-LEFT: #996600 1px solid; BORDER-BOTTOM: #996600 1px solid"
vAlign=top align=center width="100%">
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 align=center>
<form name=searchform method=post action="query.asp">
<TR align="center" valign="middle">
<TD
style="BORDER-BOTTOM: #996600 1px solid" colspan="3" align=center><img src="../images/topmore.jpg" width="773" height="80"></TD>
</TR>
<TR bgcolor="#996600">
<TD style="BORDER-BOTTOM: #996600 1px solid"
align=right valign="middle" height="10" bgcolor="#996600" colspan="3">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="middle" align="center">
<td width=116 style="border-right:1 solid #FFCC33;border-bottom:1 solid #FFCC33;cursor:hand;color:'#ffffff'" onclick="javascript:location.href='Query.asp?typet=1&Attribute=<%=Attribute%>&Attribute2=<%=Attribute2%>&TMoney1=<%=TMoney1%>&TMoney2=<%=TMoney2%>&SearchText=<%=SearchText%>'" <%if typet="1" or typet="" then%>bgcolor="#FFCC33"<%else%>onmouseover="javascript:this.bgColor='#FFCC33'" onmouseout="javascript:this.bgColor='#996600';"<%end if%>><b>前期</b></td>
<td width=116 style="border-right:1 solid #FFCC33;border-bottom:1 solid #FFCC33;cursor:hand;color:'#ffffff'" onclick="javascript:location.href='Query.asp?typet=2&Attribute=<%=Attribute%>&Attribute2=<%=Attribute2%>&TMoney1=<%=TMoney1%>&TMoney2=<%=TMoney2%>&SearchText=<%=SearchText%>'" <%if typet="2" then%>bgcolor="#FFCC33"<%else%>onmouseover="javascript:this.bgColor='#FFCC33'" onmouseout="javascript:this.bgColor='#996600';"<%end if%>><b>争取开工</b></td>
<td width=116 style="border-right:1 solid #FFCC33;border-bottom:1 solid #FFCC33;cursor:hand;color:'#ffffff'" onclick="javascript:location.href='Query.asp?typet=3&Attribute=<%=Attribute%>&Attribute2=<%=Attribute2%>&TMoney1=<%=TMoney1%>&TMoney2=<%=TMoney2%>&SearchText=<%=SearchText%>'" <%if typet="3" then%>bgcolor="#FFCC33"<%else%>onmouseover="javascript:this.bgColor='#FFCC33'" onmouseout="javascript:this.bgColor='#996600';"<%end if%>><b>在建</b></td>
<td width=116 style="border-right:1 solid #FFCC33;border-bottom:1 solid #FFCC33;cursor:hand;color:'#ffffff'" onclick="javascript:location.href='Query.asp?typet=4&Attribute=<%=Attribute%>&Attribute2=<%=Attribute2%>&TMoney1=<%=TMoney1%>&TMoney2=<%=TMoney2%>&SearchText=<%=SearchText%>'" <%if typet="4" then%>bgcolor="#FFCC33"<%else%>onmouseover="javascript:this.bgColor='#FFCC33'" onmouseout="javascript:this.bgColor='#996600';"<%end if%>><b>竣工</b></td>
<td width=116 style="border-right:1 solid #FFCC33;border-bottom:1 solid #FFCC33;cursor:hand;color:'#ffffff'" onclick="javascript:location.href='Query.asp?typet=5&Attribute=<%=Attribute%>&Attribute2=<%=Attribute2%>&TMoney1=<%=TMoney1%>&TMoney2=<%=TMoney2%>&SearchText=<%=SearchText%>'" <%if typet="5" then%>bgcolor="#FFCC33"<%else%>onmouseover="javascript:this.bgColor='#FFCC33'" onmouseout="javascript:this.bgColor='#996600';"<%end if%>><b>停缓建</b></td>
<td width=120 style="border-bottom:1 solid #FFCC33;cursor:hand;color:'#ffffff'" onclick="javascript:location.href='Query.asp?typet=6&Attribute=<%=Attribute%>&Attribute2=<%=Attribute2%>&TMoney1=<%=TMoney1%>&TMoney2=<%=TMoney2%>&SearchText=<%=SearchText%>'" <%if typet="6" then%>bgcolor="#FFCC33"<%else%>onmouseover="javascript:this.bgColor='#FFCC33'" onmouseout="javascript:this.bgColor='#996600';"<%end if%>><b>撤消立项</b></td>
</tr>
</table>
</TD>
</tr>
<tr bgcolor="#996600">
<TD style="BORDER-BOTTOM: #996600 1px solid;border-top:1 solid #ffffff" align=left valign="top" height="10" colspan=2> <font color=white>查询条件:</font><select name="Attribute" onchange="javascript:ShowClass2(this[this.selectedIndex].value);"><%for i=0 to ubound(arrClass1,2)
if arrClass1(0,i)=Attribute then%>
<option value="<%=arrClass1(0,i)%>" selected><%=arrClass1(1,i)%>
<%else%>
<option value="<%=arrClass1(0,i)%>"><%=arrClass1(1,i)%>
<%end if
next%></select>
<select id=Class2 name="Attribute2">
<option value=""></option>
<%set rsx=server.createobject("adodb.recordset")
if Attribute="" or Attribute=0 then
Attribute=1
end if
rsx.open "select * from tblAttribute2 where AttributeID="&int(Attribute),conn,1,1
if not rsx.eof then
do while not rsx.eof
if rsx("daihao")=Attribute2 then%>
<option value="<%=rsx("daihao")%>" selected><%=trim(rsx("Attribute"))%></option>
<%else%>
<option value="<%=rsx("daihao")%>"><%=trim(rsx("Attribute"))%></option>
<%end if
rsx.movenext
loop
end if
rsx.close
set rsx=nothing%></select><font color=#ffffff>总投资在</font><input type=text name=TMoney1 value="<%=TMoney11%>" size=5><font color=#ffffff>与</font><input type=text name=TMoney2 value="<%=TMoney22%>" size=5><font color=#ffffff>之间</font>
<font color=#ffffff>项目名称</font><input type="text" name="SearchText" size="10" value="<%=SearchText%>"><input type=submit name=submit value="查询"><input type=button name=all value="全部" onclick="javascript:location.href('Query.asp?typet=<%=typet%>');">
<input type="hidden" name=typet value="<%=typet%>"></TD>
</tr>
<tr bgcolor="#996600">
<td align=left style="BORDER-BOTTOM: #996600 1px solid;border-top:1 solid #ffffff"> <font color=white><b>查询结果共:<u><%=total%></u> 项 总投资合计:<u><%=TotalMoney%></u> 万元</b></font></td>
<TD style="BORDER-BOTTOM: #996600 1px solid;border-top:1 solid #ffffff" align=right valign="middle" height="10"><a href="Yuebaobiao.asp?typet=<%=typet%>" target="Yuebaobiao"><font color="#ffffff"><b>月报表</b></font></a> </TD>
</TR>
</form>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="90%" border=0>
<TR>
<TD width="100%" align="center">共<%=rs.recordcount%>条/<%=rs.pagecount%>页 每页<%=rs.pagesize%>条,第<%=absolutepage%>页
<% if cint(absolutepage)>1 then %>
<a href="query.asp?typet=<%=typet%>&TMoney1=<%=TMoney1%>&TMoney2=<%=TMoney2%>&Attribute=<%=Attribute%>&Attribute2=<%=Attribute2%>&SearchText=<%=SearchText%>&absolutepage=1">第一页</a>
<% else %>
<font color=#888888>第一页</font>
<% end if %>
<% if cint(absolutepage)>1 then %>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?