56770_tjia_z.asp

来自「能进行网上购物的需求」· ASP 代码 · 共 153 行

ASP
153
字号
<%
dim page
dim maxPerPage '每页显示的产品数
dim num_row '每行显示的产品个数
dim rows '显示的产品行数
num_row=2 '每行放置的产品数
rows=5 '放置的产品行数
maxperpage=num_row*rows
page=Request("page")
if(page="" or isempty(page))then page=1
        thisUrl="tjia.asp?lan='"&request("lan")&"'"
session("oldUrl")=thisUrl&"&page="&page
set rs=server.createobject("adodb.recordset")
sql="select * from 56770_product where cx=true order by day desc"
rs.open sql, conn, 1, 1
rs.pagesize=MaxPerPage
%>
<script language=Javascript>
<!--
function jumpTo(i)
{ 
        if(i == 1)
        {
                this.document.location="<%=thisUrl%>";
        }
        if(i == 2)
        {
                this.document.location="<%=thisUrl%>&page=<%=page-1%>";
        }
        if(i == 3)
        {
                this.document.location="<%=thisUrl%>&page=<%=page+1%>";
        }
        if(i == 4)
        {
                this.document.location="<%=thisUrl%>&page=<%=rs.pageCount%>";
        }
}
//-->
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"><img src="images/top/protop.gif" border="0"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1"  class="bg_l" ><img src="images/space.gif" width="1" height="1" border="0"></td>
<td>
<table width="576" border="0" cellspacing="0" cellpadding="0">
<%
j=1
if not(rs.eof or err)then rs.move(page-1)*maxPerPage
        do while not(rs.eof or err)
if(j mod num_row)=1 then
        %>
<tr><td colspan="<%=(num_row*2-1)%>">
<TABLE align=center class="bg_l" border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD><IMG height=1 src="images/spacer.gif" width="1"></TD>
</TR></TBODY></TABLE>
</td></tr>
<%
response.write "<tr>"
end if
%>
<%
   if request("LAN")="english" then 
   lan_sprice="Market price"
   lan_cprice="Discount price"
   lan_zhekou="Discount"
   elseif request("LAN")="fan" then 
   lan_sprice="市場價"
   lan_cprice="促銷價"
   lan_zhekou="折扣率"
   else
   lan_sprice="市场价"
   lan_cprice="促销价"
   lan_zhekou="折扣率"
   end if
%>
<td width="<%=(100/num_row)%>%" align=center>
<table width="98%" border="0" cellspacing="0" cellpadding="5" align="center">
<tr>
<td width=100>
<div align="center"> <a href="showproduct.ASP?lan=<%=request("lan")%>&id=<%=rs("id")%>"">
<%if rs("pic")<>"" then%>
<img border="0" src="pic/<%=rs("pic")%>" width="80" height="80" alt="点击查看详情">
<%else%>
<img src="pic/nopic.jpg" border="0" width="80" height="80">
<%end if%>
</a></div>
</td>
<td width="200"><a href="showproduct.ASP?lan=<%=request("lan")%>&id=<%=rs("id")%>""><font color="#FF9933"><b> 
<%
if request("LAN")="english" then 
 if len(rs("product_ename"))>20 then%>
<%=left(rs("product_ename"), 20)%>...
<%else%>
<%=rs("product_ename")%>
<%end if
elseif request("LAN")="fan" then 
 if len(rs("product_fname"))>14 then%>
<%=left(rs("product_fname"), 14)%>...
<%else%>
<%=rs("product_fname")%>
<%end if
else
 if len(rs("product_name"))>14 then%>
<%=left(rs("product_name"), 14)%>...
<%else%>
<%=rs("product_name")%>
<%end if
end if%></b><font color="#FF6600"></font></font></a>
<br>
<strike><font color="#666666"><%=lan_sprice%>: <s>¥<%=rs("sprice")%></s></font></strike>
<br> <font color="#666666"><%=lan_cprice%>: ¥<%=rs("cprice")%></font><br>
<font color="#666666"><%=lan_zhekou%>:</font><FONT face=隶书 color=#ee3d11 size=4><EM><STRONG><%=left(replace(rs("cprice")/rs("sprice")*100,".",""),2)%></STRONG></EM></FONT><FONT face=隶书 color=#ee3d11 size=5> %</font>
</td>
</tr>
</table>
</td>
<%
if(j mod num_row)=0 then
        response.write "</tr>"
else %>
        <TD class="bg_l" width="1"><IMG height=1 src="images/spacer.gif" width="1"></TD>
<%
end if
  j=j+1
if j>maxperpage then exit do
   rs.moveNext
   loop
   dim k
   k=(j-1)mod num_row
if not(k=0)then
   response.write "<td colspan="&(num_row-k)&" width="&(cint(100/num_row)*(num_row-k))&">&nbsp;</td>"
   response.write "</tr>"
end if
   response.write"<tr><td colspan="""&(num_row*2-1)&""">"
   response.write"<TABLE align=""center"" class=""bg_l"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""100%"">"
   response.write"<TR><TD><IMG height=""1"" src=""images/spacer.gif"" width=""1""></TD>"
   response.write"</TR></TABLE></TD></TR></TABLE>"
   response.write"</td><td width=""1"" bgcolor=""#CCCCCC""><img src=""images/space.gif"" width=""1"" height=""1"" border=""0""></td>"
   response.write"</tr></table>"
   response.write"<TABLE align=""center"" class=""bg_l"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""100%"">"
   response.write"<form action="""&thisUrl&""" method=""post""><tr><td width=""1"" bgcolor=""#CCCCCC""><img src=""images/space.gif"" width=""1"" height=""1"" border=""0""></td>"
   response.write"<td width=""653"" class=""bg_l"">"
   call pagelist()
   response.write"</TD><td width=""1"" bgcolor=""#CCCCCC""><img src=""images/space.gif"" width=""1"" height=""1"" border=""0""></td></TR></form>"
   response.write"<tr><td colspan=""3""><img src=""images/top/storelower.gif"" height=""9"" border=""0""></td></tr></TABLE>"
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?