📄 quary.asp
字号:
<%@ Language=VBScript %>
<%Response.Buffer=true%>
<HTML>
<HEAD>
</HEAD>
<BODY>
<!--#include FILE="myconst.inc" -->
<%
fstr=Request.Form("fyear") & "-" & Request.Form("fmonth") & "-" &_
Request.Form("fday") & " 00:00"
tstr=Request.Form("tyear") & "-" & Request.Form("tmonth") & "-" &_
Request.Form("tday" ) & " 23:59"
response.write fstr&"<br>" 'mjj
response.write tstr&"<br>" 'mjj
'pagesize=8
'Response.Write "pagesize:" & mpagesize&"mjj"
'response.end
sqlstr= "select * from buyinfo where stime>= '" &_
fstr &"' and stime <= '" &tstr &"'"
response.write "the quary's clause is: "&sqlstr&"<br>"
response.write request.form("itype")&"<br>"
if trim(Request.Form("itype"))="供" or trim(Request.Form("itype"))="求" then
sqlstr= sqlstr & " and itype = '" & Request.Form("itype") & "'"
end if 'if is not 所有,then add another where clause
response.write sqlstr
'following to judge which city the user select,add another clause
if request("city")<>"所有" then 'when not all city, then add clause
if trim(request("ocity"))="" and trim(request("city"))<>"所有" then
sqlstr=sqlstr & " and city= '" & Request.Form("city") & "'"
response.write "<br>"&sqlstr&"mjj"&"<br>"
else
sqlstr=sqlstr & " and city= '" & Request.Form("ocity") & "'"
response.write "<br>"&sqlstr&"city"&"<br>"
end if
end if
'the following to filter the type info: cat field
cat=Request.Form("radio1")
response.write "<br>"&cat
if not(clng(cat)=0) then
'not 0 means not all catogories, then add a clause
if clng(right(cat,7))=0 then 'when xxx'xxx'0000 is select
sqlstr=sqlstr+ " and substring([cat],1,3) = '" & left(cat,3) & "'"
elseif cint(right(cat,4))=0 then
sqlstr=sqlstr+ " and substring([cat],1,6) = '" & left(cat,6) & "'"
else 'when a single cat is selected
sqlstr=sqlstr+ " and [cat] = '" & cat & "'"
end if
end if
if not (trim(Request.Form("kword"))="" or trim(Request.Form("kword"))="<所有信息>") then
'when the key word is not empty and not the original value
'sqlstr=sqlstr & " and CONTAINS (*, '" & Request.Form("kword") & "')"
sqlstr=sqlstr & " and (pname like '%" & trim(request.form("kword")) & "%' or pname like '%" &_
trim(request.form("kword")) & "%')"
end if
'add time order
sqlstr=sqlstr+ " order by stime desc"
'Response.Write(sqlstr) 'for debug use
Response.Redirect ( "./pagequary.asp?currentPage=1&sqlstr="&Server.URLEncode(sqlstr))
%>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -