?? research.asp
字號:
<!--
┌─ o91.com───────────────┐
│ 動感購物商務平臺WWW.SNSN.NET版權所有 │
│ 設計:模糊視線13855119911 QQ:9912515 │
└────────────────────┘
-->
<!--#include file="conn.asp"-->
<!--#include file="fuction.asp"-->
<!--#include file="webconfig.asp"-->
<%dim action,searchkey,anclassid,jiage,selectname
anclassid=request("anclassid")
searchkey=trim(request("searchkey"))
searchkey=Replace(searchkey, "'", "")
searchkey=Replace(searchkey, "‘", "")
searchkey=checkFFSQLStr(Replace(searchkey,"’",""))
selectname=request("selectname")
jiage=request("jiage")
action=request("action")
%>
<html>
<head>
<title><%=webname%>--商品搜索結果</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onMouseOver="window.status='【<%=webname%>】 <%=weburl%> 如果您喜歡本站,別忘了把本站介紹給您的好友哦!:)';return true">
<!--#include file="webtop.asp"-->
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="1" bgcolor="C9C9C8"><img src="../images/block.gif" width="1" height="1"></td>
<td> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="168" valign="top">
<!--#include file="left.asp"-->
</td>
<td width="1" bgcolor="C9C9C8"><img src="images/block.gif" width="1" height="1"></td>
<td valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/bg1_4color_.jpg"><img src=images/bg1_4color_.jpg" width="1" height="3"></td>
</tr>
</table>
<br> <table width="98%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td height="1" bgcolor="cccccc"><img src="images/dot_03.gif" width="9" height="1" border="0"></td>
</tr>
<tr>
<td height="25" bgcolor="efefef"><strong> <img src="images/dot_03.gif" width="9" height="9" border="0">
</strong><b>
<%if jiage="" then%>
<%if searchkey="" then
response.write "<script language=javascript>alert('對不起,請您輸入查訊關鍵字');history.go(-1);</script>"
response.End
else
response.write "您查訊的關鍵字是: "
if (anClassId <> "") And _
IsNumeric(anClassId) Then
if anclassid<>0 then
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_anclass where anclassid="&anclassid,conn,1,1
response.write "<a href=class.asp?lx=big&anid="&anclassid&"><font color=red>"&rs("anclass")&"</font></a>"&" >> "
rs.close
set rs=nothing
end if
End If
response.write "<font color=red>"&searchkey&"</font>"
s_shopname=searchkey
end if%>
<%else%>
<%if (action="1" or action="2" or action="3") and searchkey="" then
response.write "<script language=javascript>alert('對不起,請您輸入查訊關鍵字');history.go(-1);</script>"
response.End
else
response.write "您查訊的關鍵字是: "
if anclassid<>0 then
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_anclass where anclassid="&anclassid,conn,1,1
response.write "<a href=class.asp?lx=big&anid="&anclassid&"><font color=red>"&rs("anclass")&"</font></a>"&" >> "
rs.close
set rs=nothing
end if
if action="1" or action="3" then
response.write "<font color=red>"&searchkey&"</font>"
s_shopname=searchkey
else
response.write "<font color=red>"&selectname&"</font>"
s_shopname=selectname
end if
end if%>
<%end if%>
</b></td>
</tr>
<tr>
<td height="1" bgcolor="cccccc"><img src="images/dot_03.gif" width="9" height="1" border="0"></td>
</tr>
</table>
<%'開始分頁
Const MaxPerPage=20
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
if jiage="" then '//普通查詢
sql2="searchkey="&searchkey&"&anclassid="&anclassid
if anclassid<>0 then '//判斷查訊分類,分類不為空。
sql1=" shopname like '%"&searchkey&"%' and anclassid="&request("anclassid")&" "
else
'//分類為空。
select case action
case "0"
sql1=" pingpai like '%"&searchkey&"%' "
case else
sql1=" shopname like '%"&searchkey&"%'"
end select
end if
else
'//高級查訊
sql2="searchkey="&searchkey&"&anclassid="&anclassid&"&jiage="&jiage&"&action="&action&"&selectname="&selectname
if anclassid<>0 then '//判斷查訊分類,分類不為空。
select case action
case "1"
sql1=" shopname like '%"&searchkey&"%' and (shichangjia<"&jiage&" or huiyuanjia<"&jiage&" or vipjia<"&jiage&") and anclassid="&anclassid&" "
case "2"
sql1=" pingpai like '%"&selectname&"%' and (shichangjia<"&jiage&" or huiyuanjia<"&jiage&" or vipjia<"&jiage&") and anclassid="&anclassid&" "
case "3"
sql1=" shopcontent like '%"&searchkey&"%' and (shichangjia<"&jiage&" or huiyuanjia<"&jiage&" or vipjia<"&jiage&") and anclassid="&anclassid&" "
end select
else
'//分類為空//模糊視線改于2004年10月12日16點42分
select case action
case "1"
sql1=" shopname like '%"&searchkey&"%' and (shichangjia<"&jiage&" or huiyuanjia<"&jiage&" or vipjia<"&jiage&") "
case "2"
sql1=" pingpai like '%"&selectname&"%' and (shichangjia<"&jiage&" or huiyuanjia<"&jiage&" or vipjia<"&jiage&") "
case "3"
sql1=" shopcontent like '%"&searchkey&"%' and (shichangjia<"&jiage&" or huiyuanjia<"&jiage&" or vipjia<"&jiage&") "
end select
end if
end if
call sss()
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_snsn where "&sql1&" order by adddate desc",conn,1,1
if rs.eof And rs.bof then
Response.Write "<p align='center' > 對不起,沒有查訊到您需要的商品!</p>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"research.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim shopmark
shopmark=rs.shopmark
showContent
showpage totalput,MaxPerPage,"research.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"research.asp"
end if
end if
end if
sub showContent
dim i
i=0
%>
<br>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="f1f1f1">
<td height="25"> <div align="center"><strong>商品名稱</strong></div></td>
<td width="15%" align="center"><strong>市場價</strong></td>
<td width="15%" height="23"> <div align="center"> <strong>
<% if Request.Cookies("snsn")("reglx")=2 then
response.write "VIP價"
else
response.write "會員價"
end if%>
</strong></div></td>
<td width="32%" height="23"> <div align="center"><strong>操作</strong></div></td>
</tr>
<%do while not rs.eof%>
<tr bgcolor="#FFFFFF">
<td height="35" style="padding-left:6px">
<%response.write "<a href=list.asp?id="&trim(rs("shopid"))&">"&trim(rs("shopname"))&"</a>"%>
</td>
<td height="35" align="center" style="padding-left:6px"><s><%=rs("shichangjia")%>元</s></td>
<td height="35"> <div align="center">
<%if Request.Cookies("snsn")("reglx")=2 then
response.write "<font color=red>"&rs("vipjia")&" 元</font>"
else
response.write "<font color=red>"&rs("huiyuanjia")&"元</font>"
end if%>
</div></td>
<td height="35"> <div align="center"> <a href="gouwu.asp?id=<%=rs("shopid")%>&action=add"><img src="images//gm.gif" border="0"></a> <a href="shoucang.asp?id=<%=rs("shopid")%>&action=add"><img src="images//shc.gif" border="0"></a>
</div></td>
</tr>
<%i=i+1
if i>=MaxPerPage then Exit Do
rs.movenext
loop
rs.close
set rs=nothing%>
</table>
<%
End Sub
Function showpage(totalnumber,maxperpage,filename)
Dim n
If totalnumber Mod maxperpage=0 Then
n= totalnumber \ maxperpage
Else
n= totalnumber \ maxperpage+1
End If
Response.Write "<form method=Post action="&filename&"?searchkey="&searchkey&"&action="&action&"&anclassid="&anclassid&"&jiage="&jiage&">"
Response.Write "<p align='center' class='contents'> "
If CurrentPage<2 Then
Response.Write "<font class='contents'>首頁 上一頁</font> "
Else
Response.Write "<a href="&filename&"?page=1&searchkey="&searchkey&"&action="&action&"&anclassid="&request("anclassid")&"&jiage="&jiage&" class='contents'>首頁</a> "
Response.Write "<a href="&filename&"?page="&CurrentPage-1&"&searchkey="&searchkey&"&action="&action&"&anclassid="&request("anclassid")&"&jiage="&jiage&" class='contents'>上一頁</a> "
End If
If n-currentpage<1 Then
Response.Write "<font class='contents'>下一頁 尾頁</font>"
Else
Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&"&searchkey="&searchkey&"&action="&action&"&anclassid="&request("anclassid")&"&jiage="&jiage&" class='contents'>"
Response.Write "下一頁</a> <a href="&filename&"?page="&n&"&searchkey="&searchkey&"&action="&action&"&anclassid="&request("anclassid")&"&jiage="&jiage&" class='contents'>尾頁</a>"
End If
Response.Write "<font class='contents'> 頁次:</font><font class='contents'>"&CurrentPage&"</font><font class='contents'>/"&n&"頁</font> "
Response.Write "<font class='contents'> 共查訊到"&totalnumber&"種商品 "
Response.Write "<font class='contents'>轉到:</font><input type='text' name='page' size=2 maxlength=10 class=smallInput value="¤tpage&">"
Response.Write " <input type='submit' class='contents' value='GO' name='cndok'></form>"
End Function
%>
<%
sub sss() '增加搜索關健字到數據庫
if request.cookies("snsn")("username")<>"" then
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from [shop_user] where username='"&request.cookies("snsn")("username")&"'",conn,1,1
t_userid=rs_s("userid")
rs_s.close
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from shop_his where username='"&request.cookies("snsn")("username")&"' and shopname='"&s_shopname&"' and lx=2",conn,1,3
if rs_s.recordcount>0 then
rs_s("ltime")=now()
rs_s("userid")=t_userid
rs_s("searchkey")=sql2
rs_s.update
rs_s.close
set rs_s=nothing
else
rs_s.close
set rs_s=server.createobject("adodb.recordset")
rs_s.open "select * from shop_his where username='"&request.cookies("snsn")("username")&"' and lx=2",conn,1,3
if rs_s.recordcount>=4 then
rs_s.delete
rs_s.update
end if
rs_s.addnew
rs_s("username")=request.cookies("snsn")("username")
rs_s("searchkey")=sql2
rs_s("shopname")=s_shopname
rs_s("userid")=t_userid
rs_s("lx")=2
rs_s("ltime")=now()
rs_s.update
rs_s.close
set rs_s=nothing
end if
end if
end sub%>
</td>
</tr>
</table></td>
<td width="1" bgcolor="C9C9C8"><img src="../images/block.gif" width="1" height="1"></td>
</tr>
</table>
<!--#include file="copyright.asp"-->
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -