📄 2.asp
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="../conn.asp" -->
<%
shop_name=request("shop_name")
Classification_0="推荐商品"
set rs=server.createobject("adodb.recordset")
sqltext="select * from Product Where p_shop='"& shop_name &"' and Classification='"& Classification_0 &"' order by Product_No desc"
rs.open sqltext,conn,1,1
dim MaxPerPage
MaxPerPage=12
'取得页数,并判断用户输入的是否数字类型的数据,如不是将以第一页显示
dim text,checkpage
text="0123456789"
Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next
If checkpage<>0 then
If NOT IsEmpty(request("page")) Then
CurrentPage=Cint(request("page"))
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
Else
CurrentPage= 1
End If
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if
%>
<HTML>
<HEAD>
<TITLE>2</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE>
BODY {
FONT-SIZE: 9pt
}
TD {
FONT-SIZE: 9pt
}
a { text-decoration: none; color: #FFFFFF }
a:hover { text-decoration: underline; color: #0000FF }
</STYLE>
<NOSCRIPT><IFRAME SRC="*.html"></IFRAME></NOSCRIPT>
<script language="javascript">
function click() {
if (event.button==2) {
alert('您好!欢迎您光临汕头商城!')
}
}
document.onmousedown=click
</script>
<SCRIPT language=JavaScript>
<!--
function openbag(url,name){
window.open(url,name,"height=200,width=600,left=190,top=0,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no")}
-->
</SCRIPT>
</HEAD>
<BODY bgColor=#990000 leftMargin=0 topMargin=0>
<TABLE height=333 cellSpacing=0 cellPadding=0 width=752 border=0 align="center">
<TBODY>
<TR>
<TD height=77 background="images/021_01.jpg">
<table width="766" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="120"> </td>
<td width="646">
<div align="center" style="FONT-SIZE: 25pt"><font color="#FFFFFF"><b><%=shop_name%></b></font></div>
</td>
</tr>
</table>
</TD>
</TR>
<TR>
<TD vAlign=top>
<TABLE height=310 cellSpacing=0 cellPadding=0 width="100%" align=left
border=0>
<TBODY>
<TR>
<TD vAlign=top width="15%" background=images/021_02.gif
rowSpan=2> <TABLE class=f9 width=134
border=0 background="images/box.jpg">
<TBODY>
<TR>
<TD height=20> <DIV align=center></DIV>
<DIV align=center><A class=f9
href="1.asp?shop_name=<%=shop_name%>">公司介绍 </A></DIV></TD>
</TR>
<TR>
<TD height=20> <DIV align=center><A class=f9
href="2.asp?shop_name=<%=shop_name%>">推荐商品 </A></DIV></TD>
</TR>
<TR>
<TD height=20> <DIV align=center><A class=f9
href="3.asp?shop_name=<%=shop_name%>">分类商品 </A></DIV></TD>
</TR>
<TR>
<TD height=20> <DIV align=center><A class=f9
href="4.asp?shop_name=<%=shop_name%>">综合资讯</A></DIV></TD>
</TR>
<TR>
<TD height=20> <DIV align=center><A class=f9
href="7.asp?shop_name=<%=shop_name%>">旅游线路</A></DIV></TD>
</TR>
<TR>
<TD height=20> <DIV align=center><A class=f9
href="5.asp?shop_name=<%=shop_name%>">企业动态 </A></DIV></TD>
</TR>
<TR>
<TD height=20> <DIV align=center><A class=f9
href="6.asp?shop_name=<%=shop_name%>">客户反馈 </A></DIV></TD>
</TR>
<TR>
<TD height=20> <DIV align=center><A class=f9
href="8.asp?shop_name=<%=shop_name%>">诚聘英才 </A></DIV></TD>
</TR>
<TR>
<TD height=20> <DIV align=center><A class=f9
href="default.asp?shop_name=<%=shop_name%>">返回首页</A></DIV></TD>
</TR>
</TBODY>
</TABLE></TD>
<TD vAlign=top width="85%">
<TABLE height=350 cellSpacing=4 width="632" border=0 bgcolor="#FFFFFF">
<TBODY>
<TR>
<TD background=images/h.gif height=40 width="628">当前位置:推荐商品<A class=f90
href="http://3322.sw365.com/templates/19/1_8.php?userid=z3d522f4121908"></A></TD>
</TR>
<TR>
<TD vAlign=top height=300 width="628">
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<%
'/////////////////////////////////////////////////////////假如没有商品时//////////////////
If rs.eof and rs.bof then
response.write "<td><p align='center'><font color='#ff0000'>还没任何商品资料</font></p></td>"
End if %>
<%row_count=1
'/////////////////////////////////////显示帖子的子程序////// ///////////////////////////////////
Sub list()%>
<%i=0
Do While Not rs.EOF%>
<td height="56" align="center" valign="top"><a href="../../ProductDetail.asp?Product_id=<%=rs("Product_id")%>"><img name="small" border="0" src="../../manage/pic_play.asp?pic_id=<%=rs("pic_id")%>" width="72" height="82" ><br>
<font color="#0000ff"><%=rs("Product_Name")%></font><br>
</a><font color="#cc0000">销售商:</font><%=rs("p_shop")%><font color="#cc0000"><br>
会员价:</font><%=rs("P_NewPrice")%>元<br>
<a href="javascript:openbag('../../check.asp?cpbm=<%=rs("Product_Id")%>&shopname=<%=rs("p_shop")%>')"><img style="CURSOR: hand" height="22" src="../../images/che1.gif" width="56" align="absMiddle" border="0"></a>
</td>
<%if row_count mod 4 =0 then%>
</tr>
<tr>
<td height="20"></td>
</tr>
<tr>
<%end if%>
<%
i=i+1
if i >= MaxPerpage then exit do
rs.MoveNext
row_count=row_count+1
Loop
end Sub
%>
<%
'显示翻页子程序
call list
If Rs.recordcount > MaxPerPage then
Response.write "<br>"
call showpages
end if%>
</tr>
</table>
</TD>
</TR>
</TBODY>
</TABLE>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE width="96%" border=0 align="center">
<TBODY>
<TR>
<TD>
<DIV class=f90 align=center><BR>
</DIV>
</TD></TR></TBODY></TABLE>
<%
'显示翻页的子程序
sub showpages()%>
<table border="0" cellPadding="0" cellSpacing="0" width="590" align="center" >
<form method=Post action='2.asp?shop_name=<%=shop_name%>'>
<tr>
<td>
<table border="0" cellPadding="0" cellSpacing="3" width="590" align="center">
<tr>
<td class=main1 height="30">
<p align="center">
<%
If currentpage > 1 Then
response.write "<a href='2.asp?&page="+cstr(1)+"&shop_name="+Cstr(shop_name)+"'><font color='#0000FF'>首页</font></a><font color='#FF0000'><b> — </b></font>"
Response.write "<a href='2.asp?page="+Cstr(currentpage-1)+"&shop_name="+Cstr(shop_name)+"'><font color='#0000FF'>前页</font></a><font color='#FF0000'><b> — </b></font>"
Else
Response.write "首页<font color='#FF0000'><b>—</b></font>"
Response.write "前页<font color='#FF0000'><b>—</b></font>"
End if
If currentpage < Rs.PageCount Then
Response.write "<a href='2.asp?page="+Cstr(currentPage+1)+"&shop_name="+Cstr(shop_name)+"'><font color='#0000FF'>后页</font></a><font color='#FF0000'><b>—</b></font>"
Response.write "<a href='2.asp?page="+Cstr(Rs.PageCount)+"&shop_name="+Cstr(shop_name)+"'><font color='#0000FF'>尾页</font></a> "
Else
Response.write "后页—"
Response.write "尾页 "
End if
Response.write "页次:" & "<font color=#FF0000>" & Cstr(CurrentPage) & "</font>" & "<font color='#000000'>/" & Cstr(rs.pagecount) & "</font> "
Response.write "<font color=#FF0000>" & Cstr(MaxPerPage) & "</font>" & "种产品/页 " & "共" & "<font color=#FF0000>" & Cstr(Rs.RecordCount) & "</font>" & "<font color='#000000'>种产品</font> "
response.write "</td><td align='right' >"
response.write "<font class=main1>转到:<input type='text' name='page' size=4 maxlength=4 class=smallInput value="&Currentpage&"> "
response.write "<input class=buttonface type='submit' value='Go' name='cndok' style='background-color: #E6E4C4'></span> "
%>
</td>
</tr>
</table>
</td>
</tr>
</form>
</table>
<%end sub%>
</BODY></HTML>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -