📄 sql_function.asp
字号:
<%
Public Page_QueryStr
Dim Per_Page:Per_Page=CheckStr(Trim(Rst("CnPerBBrPage")))
if isNum(Per_Page) then Session("CnPerBBrPage")=Per_Page
if isNum(Session("CnPerBBrPage")) then JsPerPage=Clng(Session("CnPerBBrPage"))
Dim CurDispInfoType:CurDispInfoType=0
Dim DispInfoType:DispInfoType=CheckStr(Trim(Rst("DispInfoType")))
if isNum(DispInfoType) then Session("DispInfoType")=DispInfoType
if isNum(Session("DispInfoType")) then CurDispInfoType=Clng(Session("DispInfoType"))
Dim BBR_AucName
BBR_AucName=Trim(Rst("BBR_AucName"))
BBR_AucName=Replace(Replace(Replace(Replace(Replace(BBR_AucName,",","|||"),",","|||")," ","|||"),";","|||"),";","|||")
BBR_AucName=InterceptString(CheckStr(BBR_AucName),45)
Dim BBR_AucOwner
BBR_AucOwner=CheckStr(Trim(Rst("BBR_AucOwner")))
if Not isNum(BBR_AucOwner) then
if BBR_AucOwner="" then
BBR_AucOwner=0
else
Dim RsU1
Sql="select RegId,RegUserName from users where RegUserName='"&BBR_AucOwner&"'"
Set RsU1=Server.CreateObject("Adodb.RecordSet")
RsU1.Open Sql,conn,1,1
if RsU1.Eof or RsU1.Bof then
BBR_AucOwner=0
else
BBR_AucOwner=RsU1("RegId")
end if
RsU1.Close
Set RsU1=nothing
end if
else
BBR_AucOwner=Clng(BBR_AucOwner)
end if
Dim BBR_AucPrice_Small,BBR_AucPrice_Large
BBR_AucPrice_Small=CheckStr(Trim(Rst("BBR_AucPrice_Small")))
BBR_AucPrice_Large=CheckStr(Trim(Rst("BBR_AucPrice_Large")))
if Not isNum(BBR_AucPrice_Small) then BBR_AucPrice_Small=0
if Not isNum(BBR_AucPrice_Large) then BBR_AucPrice_Large=0
Dim BBR_S1,BBR_S2,BBR_S3,BBR_S4,BBR_ClassPath,cnBBR_ClassPath
BBR_S1=CheckStr(Trim(Rst("S1")))
BBR_S2=CheckStr(Trim(Rst("S2")))
BBR_S3=CheckStr(Trim(Rst("S3")))
BBR_S4=CheckStr(Trim(Rst("S4")))
if Not isNum(BBR_S1) then BBR_S1=0
if Not isNum(BBR_S2) then BBR_S2=0
if Not isNum(BBR_S3) then BBR_S3=0
if Not isNum(BBR_S4) then BBR_S4=0
BBR_ClassPath=Cstr(BBR_S1&"|"&BBR_S2&"|"&BBR_S3&"|"&BBR_S4)
BBR_ClassPath=Replace(BBR_ClassPath,"|0","")
cnBBR_ClassPath=CheckStr(Trim(Rst("BBRpath")))
cnBBR_ClassPath=Replace(cnBBR_ClassPath,"|0","")
if len(cnBBR_ClassPath)>0 then BBR_ClassPath=cnBBR_ClassPath
if Cstr(BBR_ClassPath)="0" then BBR_ClassPath=""
Dim BBR_AucPlace_Prov,BBR_AucPlace_City,BBR_AucPlace
BBR_AucPlace_Prov=CheckStr(Trim(Rst("TPL_prov")))
BBR_AucPlace_City=CheckStr(Trim(Rst("TPL_City")))
BBR_AucPlace=CheckStr(Trim(Rst("Place")))
Dim BBR_AucOldNew
BBR_AucOldNew=CheckStr(Trim(Rst("BBR_AucOldNew")))
Dim BBR_AucZhiFu
BBR_AucZhiFu=CheckStr(Trim(Rst("BBR_AucZhiFu")))
Dim BBR_AucType
BBR_AucType=CheckStr(Trim(Rst("BBR_AucType")))
BBR_AucType=Replace(BBR_AucType," ","")
Dim BBR_AucAvailDate
BBR_AucAvailDate=CheckStr(Trim(Rst("BBR_AucAvailDate")))
if Not isNum(BBR_AucAvailDate) then
BBR_AucAvailDate=0
else
BBR_AucAvailDate=Clng(BBR_AucAvailDate)
end if
Dim BBR_AucCloseDate
BBR_AucCloseDate=CheckStr(Trim(Rst("BBR_AucCloseDate")))
if Not isNum(BBR_AucCloseDate) then
BBR_AucCloseDate=0
else
BBR_AucCloseDate=Clng(BBR_AucCloseDate)
end if
Dim BBR_AucOrder
BBR_AucOrder=CheckStr(Trim(Rst("CnAucBBrOrder")))
if Not isNum(BBR_AucOrder) then
BBR_AucOrder=0
else
Session("CnAucBBrOrder")=Clng(BBR_AucOrder)
end if
if isNum(Session("CnAucBBrOrder")) then BBR_AucOrder=Session("CnAucBBrOrder")
Dim Sql_SearchStr
Sql_SearchStr="Select a.AucID,a.AucItemTitle,a.AucItemOwner,a.AucCurrentBid,a.AucCloseDate,a.BidTimes,a.YkjBidTimes,a.AucType,a.BBR_AdminCommend,a.BBR_AlipayStatus,b.RegId,b.RegUserName,b.RegState,b.RegCity,b.UserQQ,b.BBR_UserQQSkins,b.BBR_UserQQMsg from Auctions as a Left Join Users as b On a.AucItemOwner=b.RegID Where a.aucEnded='N' and a.AucType in ("& SYS_MODEL &") and b.RegAdmin='N'"
Dim TempTs
if instr(BBR_AucName,"|||")>1 then
Dim TempT,TempT2,Tii
TempT=BBR_AucName
TempT=Split(TempT,"|||")
For Tii=0 to Ubound(TempT)
TempT2=TempT2 &" and a.AucItemTitle like '%"& TempT(Tii) &"%'"
Next
TempTs=TempT2
else
TempTs=" and a.AucItemTitle like '%"& BBR_AucName &"%'"
end if
Sql_SearchStr=Sql_SearchStr & TempTs
if BBR_AucOwner<>0 then Sql_SearchStr=Sql_SearchStr &" and a.AucItemOwner="& BBR_AucOwner
if cdbl(BBR_AucPrice_Small)<>0 then Sql_SearchStr=Sql_SearchStr &" and a.AucCurrentBid>="& BBR_AucPrice_Small
if cdbl(BBR_AucPrice_Large)<>0 then Sql_SearchStr=Sql_SearchStr &" and a.AucCurrentBid<="& BBR_AucPrice_Large
if len(BBR_ClassPath)>0 then Sql_SearchStr=Sql_SearchStr &" and a.BBR_ClassPath like ('"& BBR_ClassPath &"%')"
if Cstr(BBR_AucPlace_Prov)<>"" then Sql_SearchStr=Sql_SearchStr & " and b.RegState like '%"& BBR_AucPlace_Prov &"%'"
if Cstr(BBR_AucPlace_City)<>"" then Sql_SearchStr=Sql_SearchStr & " and b.RegCity like '%"& BBR_AucPlace_City &"%'"
if Cstr(BBR_AucPlace)<>"" then Sql_SearchStr=Sql_SearchStr & " and (b.RegState like '%"& BBR_AucPlace &"%' or b.RegCity like '%"& BBR_AucPlace &"%')"
if Cstr(BBR_AucOldNew)<>"" then Sql_SearchStr=Sql_SearchStr & " and a.OldNew='"& BBR_AucOldNew &"'"
if Cstr(BBR_AucZhiFu)<>"" then Sql_SearchStr=Sql_SearchStr & " and a.ZhiFu='"& BBR_AucZhiFu &"'"
if IsSqlDataBase=1 then
if BBR_AucAvailDate<>0 then Sql_SearchStr=Sql_SearchStr & " and DateDiff('d',a.aucAvailDate,"&SqlNowString&")<"&BBR_AucAvailDate
if BBR_AucCloseDate<>0 then Sql_SearchStr=Sql_SearchStr & " and DateDiff('d',"&SqlNowString&",a.aucCloseDate)<"&BBR_AucCloseDate
else
if BBR_AucAvailDate<>0 then Sql_SearchStr=Sql_SearchStr & " and DateDiff(""d"",a.aucAvailDate,"&SqlNowString&")<"&BBR_AucAvailDate
if BBR_AucCloseDate<>0 then Sql_SearchStr=Sql_SearchStr & " and DateDiff(""d"","&SqlNowString&",a.aucCloseDate)<"&BBR_AucCloseDate
end if
if Cstr(BBR_AucType)<>"" then
BBR_AucType=Replace(BBR_AucType,"|",",")
Sql_SearchStr=Sql_SearchStr &" and a.AucType In ("& BBR_AucType &")"
else
Sql_SearchStr=Sql_SearchStr &" and a.Auctype In (" & SYS_MODEL & ")"
end if
Select Case BBR_AucOrder
Case 1: Sql_SearchStr=Sql_SearchStr &" order by a.BBR_AdminCommend Desc,a.AucCurrentBid Asc"
Case 2: Sql_SearchStr=Sql_SearchStr &" order by a.BBR_AdminCommend Desc,a.AucCurrentBid Desc"
Case 3: Sql_SearchStr=Sql_SearchStr &" order by a.BBR_AdminCommend Desc,a.AucCloseDate Asc"
Case 4: Sql_SearchStr=Sql_SearchStr &" order by a.BBR_AdminCommend Desc,a.AucCloseDate Desc"
Case 5: Sql_SearchStr=Sql_SearchStr &" order by a.BBR_AdminCommend Desc,a.AucClick Desc"
Case else: Sql_SearchStr=Sql_SearchStr &" order by a.BBR_AdminCommend Desc,a.AucID Desc"
End Select
Page_QueryStr="BBR_AucName="& BBR_AucName &"&BBR_AucOwner="& BBR_AucOwner
Page_QueryStr=Page_QueryStr &"&BBR_AucPrice_Small="& BBR_AucPrice_Small
Page_QueryStr=Page_QueryStr &"&BBR_AucPrice_Large="& BBR_AucPrice_Large
Page_QueryStr=Page_QueryStr &"&BBRPath="& BBR_ClassPath
Page_QueryStr=Page_QueryStr &"&TPL_Prov="& BBR_AucPlace_Prov &"&TPL_City="& BBR_AucPlace_City
Page_QueryStr=Page_QueryStr &"&Place="& BBR_AucPlace
Page_QueryStr=Page_QueryStr &"&BBR_AucOldNew="& BBR_AucOldNew
Page_QueryStr=Page_QueryStr &"&BBR_AucZhiFu="& BBR_AucZhiFu
Page_QueryStr=Page_QueryStr &"&BBR_AucAvailDate="& BBR_AucAvailDate
Page_QueryStr=Page_QueryStr &"&BBR_AucCloseDate="& BBR_AucCloseDate
BBR_AucType=Replace(BBR_AucType,",","|")
Page_QueryStr=Page_QueryStr &"&BBR_AucType="& BBR_AucType
Page_QueryStr=Page_QueryStr &"&BBR_AucOrder="& BBR_AucOrder
Page_QueryStr=Page_QueryStr &"&"
Dim Page:Page=rst("page")
if Page="" then Page=1
if Not IsNum(Page) then Page=1
Dim Page_Url
Page_Url=Cnbbr_CurrentPath
dim strAnd
if instr(Page_Url,"?")=0 then
strAnd = "?"
else
strAnd = "&"
end if
Page_QueryStr=Replace(Page_QueryStr,",","|")
Page_QueryStr=Page_Url & StrAnd & Page_QueryStr
Function Disp_AucSearch()
With Response
.Write"<table width="""& SYS_BodyCenterWidth &""" border=0 align=center cellpadding=0 cellspacing=0>"& vbcrlf
.Write" <tr height=28 class=td>"& vbcrlf
.Write" <td width=30% align=left>"& Disp_AucAdminMenu &"</td>"& vbcrlf
.Write" <td align=right>"& vbcrlf
.Write "<TABLE cellSpacing=0 cellPadding=0 width=98% align=right border=0>" & Vbcrlf
.Write "<TR>" & Vbcrlf
.Write "<td colspan=3 width=100% height=1 align=center class=menutdbg_1> </td>" & Vbcrlf
.Write "</TR>" & Vbcrlf
.Write "<TR>" & Vbcrlf
.Write "<td colspan=3 width=100% height=26 align=Left background=""SKINS/"& SKINS_FOLDER &"/GrayBg.Gif"" border=""0"">"& Vbcrlf
.Write DispAndOrder
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -