📄 fb_result.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/conn.asp" -->
<%
Dim gq__ddd
gq__ddd = "%"
if (Request.QueryString("leixing") <> "") then gq__ddd = Request.QueryString("leixing")
%>
<%
Dim gq__dd
gq__dd = "%"
if (Request.QueryString("title") <> "") then gq__dd = Request.QueryString("title")
%>
<%
Dim gq__dddd
gq__dddd = "%"
if (Request.QueryString("title") <> "") then gq__dddd = Request.QueryString("title")
%>
<%
set gq = Server.CreateObject("ADODB.Recordset")
gq.ActiveConnection = MM_conn_STRING
gq.Source = "SELECT * FROM gqxt WHERE leixing like '%" + Replace(gq__ddd, "'", "''") + "' and gqtitle like '%" + Replace(gq__dd, "'", "''") + "%' and gqneirong like '%" + Replace(gq__dddd, "'", "''") + "%' ORDER BY gqid DESC"
gq.CursorType = 0
gq.CursorLocation = 2
gq.LockType = 3
gq.Open()
gq_numRows = 0
%>
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString
MM_valUsername=CStr(Request.Form("textfield"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="myorder.asp"
MM_redirectLoginFailed="loginerr.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_conn_STRING
MM_rsUser.Source = "SELECT user, password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM user WHERE user='" & replace(MM_valUsername,"'","''") &"' AND password='" & replace(Request.Form("textfield2"),"'","''") & "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<%
' *** Move To Record: set the strings for the first, last, next, and previous links
MM_keepMove = MM_keepBoth
MM_moveParam = "index"
' if the page has a repeated region, remove 'offset' from the maintained parameters
If (MM_size > 0) Then
MM_moveParam = "offset"
If (MM_keepMove <> "") Then
params = Split(MM_keepMove, "&")
MM_keepMove = ""
For i = 0 To UBound(params)
nextItem = Left(params(i), InStr(params(i),"=") - 1)
If (StrComp(nextItem,MM_moveParam,1) <> 0) Then
MM_keepMove = MM_keepMove & "&" & params(i)
End If
Next
If (MM_keepMove <> "") Then
MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1)
End If
End If
End If
' set the strings for the move to links
If (MM_keepMove <> "") Then MM_keepMove = MM_keepMove & "&"
urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "="
MM_moveFirst = urlStr & "0"
MM_moveLast = urlStr & "-1"
MM_moveNext = urlStr & Cstr(MM_offset + MM_size)
prev = MM_offset - MM_size
If (prev < 0) Then prev = 0
MM_movePrev = urlStr & Cstr(prev)
%>
<%
Dim Repeat3__numRows
Repeat3__numRows = 7
Dim Repeat3__index
Repeat3__index = 0
news_numRows = news_numRows + Repeat3__numRows
%>
<%
Dim HLooper3__numRows
HLooper3__numRows = 4
Dim HLooper3__index
HLooper3__index = 0
dazhe_numRows = dazhe_numRows + HLooper3__numRows
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = 25
Dim Repeat1__index
Repeat1__index = 0
gq_numRows = gq_numRows + Repeat1__numRows
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
' set the record count
gq_total = gq.RecordCount
' set the number of rows displayed on this page
If (gq_numRows < 0) Then
gq_numRows = gq_total
Elseif (gq_numRows = 0) Then
gq_numRows = 1
End If
' set the first and last displayed record
gq_first = 1
gq_last = gq_first + gq_numRows - 1
' if we have the correct record count, check the other stats
If (gq_total <> -1) Then
If (gq_first > gq_total) Then gq_first = gq_total
If (gq_last > gq_total) Then gq_last = gq_total
If (gq_numRows > gq_total) Then gq_numRows = gq_total
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (gq_total = -1) Then
' count the total records by iterating through the recordset
gq_total=0
While (Not gq.EOF)
gq_total = gq_total + 1
gq.MoveNext
Wend
' reset the cursor to the beginning
If (gq.CursorType > 0) Then
gq.MoveFirst
Else
gq.Requery
End If
' set the number of rows displayed on this page
If (gq_numRows < 0 Or gq_numRows > gq_total) Then
gq_numRows = gq_total
End If
' set the first and last displayed record
gq_first = 1
gq_last = gq_first + gq_numRows - 1
If (gq_first > gq_total) Then gq_first = gq_total
If (gq_last > gq_total) Then gq_last = gq_total
End If
%>
<%
' *** Move To Record and Go To Record: declare variables
Set MM_rs = gq
MM_rsCount = gq_total
MM_size = gq_numRows
MM_uniqueCol = ""
MM_paramName = ""
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName <> "") Then
MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")
End If
%>
<%
' *** Move To Record: handle 'index' or 'offset' parameter
if (Not MM_paramIsDefined And MM_rsCount <> 0) then
' use index parameter if defined, otherwise use offset parameter
r = Request.QueryString("index")
If r = "" Then r = Request.QueryString("offset")
If r <> "" Then MM_offset = Int(r)
' if we have a record count, check if we are past the end of the recordset
If (MM_rsCount <> -1) Then
If (MM_offset >= MM_rsCount Or MM_offset = -1) Then ' past end or move last
If ((MM_rsCount Mod MM_size) > 0) Then ' last page not a full repeat region
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If
' move the cursor to the selected record
i = 0
While ((Not MM_rs.EOF) And (i < MM_offset Or MM_offset = -1))
MM_rs.MoveNext
i = i + 1
Wend
If (MM_rs.EOF) Then MM_offset = i ' set MM_offset to the last possible record
End If
%>
<%
' *** Move To Record: if we dont know the record count, check the display range
If (MM_rsCount = -1) Then
' walk to the end of the display range for this page
i = MM_offset
While (Not MM_rs.EOF And (MM_size < 0 Or i < MM_offset + MM_size))
MM_rs.MoveNext
i = i + 1
Wend
' if we walked off the end of the recordset, set MM_rsCount and MM_size
If (MM_rs.EOF) Then
MM_rsCount = i
If (MM_size < 0 Or MM_size > MM_rsCount) Then MM_size = MM_rsCount
End If
' if we walked off the end, set the offset based on page size
If (MM_rs.EOF And Not MM_paramIsDefined) Then
If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then
If ((MM_rsCount Mod MM_size) > 0) Then
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If
' reset the cursor to the beginning
If (MM_rs.CursorType > 0) Then
MM_rs.MoveFirst
Else
MM_rs.Requery
End If
' move the cursor to the selected record
i = 0
While (Not MM_rs.EOF And i < MM_offset)
MM_rs.MoveNext
i = i + 1
Wend
End If
%>
<%
' *** Move To Record: update recordset stats
' set the first and last displayed record
gq_first = MM_offset + 1
gq_last = MM_offset + MM_size
If (MM_rsCount <> -1) Then
If (gq_first > MM_rsCount) Then gq_first = MM_rsCount
If (gq_last > MM_rsCount) Then gq_last = MM_rsCount
End If
' set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)
%>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
function DoTrimProperly(str, nNamedFormat, properly, pointed, points)
dim strRet
strRet = Server.HTMLEncode(str)
strRet = replace(strRet, vbcrlf,"")
strRet = replace(strRet, vbtab,"")
If (LEN(strRet) > nNamedFormat) Then
strRet = LEFT(strRet, nNamedFormat)
If (properly = 1) Then
Dim TempArray
TempArray = split(strRet, " ")
Dim n
strRet = ""
for n = 0 to Ubound(TempArray) - 1
strRet = strRet & " " & TempArray(n)
next
End If
If (pointed = 1) Then
strRet = strRet & points
End If
End If
DoTrimProperly = strRet
End Function
</SCRIPT>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="ddd.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="top.asp" -->
<table width="771" border="0" cellspacing="0" cellpadding="0" align="center" height="76" class="bk1">
<tr>
<td height="92" width="196" valign="top">
<form name="form1" method="get" action="fb_result.asp">
<p> </p>
<p> </p>
<table width="90%" border="0" align="center" cellspacing="0" cellpadding="0" class="bk">
<tr>
<td background="images/bg22.gif" class="bk">
<div align="center"><b>供求信息搜索</b></div>
</td>
</tr>
<tr>
<td height="29">
<div align="center">
<select name="leixing" class="textk">
<option value="%">选择信息类型</option>
<option value="供">供</option>
<option value="求">求</option>
</select>
</div>
</td>
</tr>
<tr>
<td height="35">
<div align="center">
<input type="text" name="title" class="textk" size="25" value="标题、内容关键字">
</div>
</td>
</tr>
<tr>
<td height="29">
<div align="center">
<input type="image" border="0" name="imageField" src="images/button_search.gif" width="56" height="22">
</div>
</td>
</tr>
</table>
</form>
</td>
<td valign="top" height="92" width="575">
<div align="center">
<p><b><font size="3"><br>
</font></b></p>
<%
While ((Repeat1__numRows <> 0) AND (NOT gq.EOF))
%>
<% If Not gq.EOF Or Not gq.BOF Then %>
<table width="96%" border="0" class="dfont">
<tr>
<td height="17">【<%=(gq.Fields.Item("leixing").Value)%>】 <a href="#" onClick="MM_openBrWindow('fbdail.asp?gqid=<%=gq.Fields.Item("gqid").Value%>','','width=400,height=400')">
<% =(DoTrimProperly((gq.Fields.Item("gqtitle").Value), 20, 0, 1, "..")) %>
</a>
<% If (gq.Fields.Item("fbdate").Value) = (session("tadate")) Then 'script %>
<img src="images/new11.gif" width="28" height="11">
<% End If ' end If (gq.Fields.Item("fbdate").Value) = (session("tadate")) script %>
<a href="mailto:<%=(gq.Fields.Item("fbemail").Value)%>"><%=(gq.Fields.Item("fbname").Value)%></a></td>
</tr>
</table>
<% End If ' end Not gq.EOF Or NOT gq.BOF %>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
gq.MoveNext()
Wend
%>
<% If gq.EOF And gq.BOF Then %>
<font color="#FF0000"><b><font size="2">没有供求信息</font></b></font>
<% End If ' end gq.EOF And gq.BOF %>
<p> 当前显示第<%=(gq_first)%> 到第<%=(gq_last)%> 条供求信息,一共<%=(gq_total)%>条信息。<b><font size="3"> </font></b></p>
<table border="0" width="55%" align="center">
<tr>
<td width="23%" align="center">
<% If MM_offset <> 0 Then %>
<a href="<%=MM_moveFirst%>">第一页</a>
<% End If ' end MM_offset <> 0 %>
</td>
<td width="31%" align="center">
<% If MM_offset <> 0 Then %>
<a href="<%=MM_movePrev%>">上一页</a>
<% End If ' end MM_offset <> 0 %>
</td>
<td width="23%" align="center">
<% If Not MM_atTotal Then %>
<a href="<%=MM_moveNext%>">下一页</a>
<% End If ' end Not MM_atTotal %>
</td>
<td width="23%" align="center">
<% If Not MM_atTotal Then %>
<a href="<%=MM_moveLast%>">末一页</a>
<% End If ' end Not MM_atTotal %>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<br>
<!--#include file="bottom.asp" -->
</body>
</html>
<%
gq.Close()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -