?? sub.asp
字號:
<%
'***********************************************
' 目的: 公共上部分
' 輸入: title,nowplace,nav
' 說明: title:當前頁標題; nowplace:當前位置名稱; nav:導航
'***********************************************
sub up(title,nowplace,nav)
response.write "<html>"
response.write "<head>"
response.write "<meta http-equiv=Content-Language content=zh-cn>"
response.write "<meta http-equiv=Content-Type content=text/html; charset=gb2312>"
response.write "<title>"&title&"</title>"
response.write "</head>"
response.write "<body>"
%>
<!--#include file=Top.asp-->
<%
response.write "<table border=0 width=100% cellpadding=0 style=border-collapse: collapse>"
response.write " <tr>"
response.write " <td width=180 valign=top>"
%>
<!--#include file=Left.asp-->
<%
response.write " </td>"
response.write " <td width=10> </td>"
response.write " <td valign=top><a href=index.asp>首頁</a> » "&nav&" <br>"
response.write " <br>"
response.write " <table width='100%' cellspacing=1 cellpadding=4 style='border-collapse: collapse'>"
response.write " <tr>"
response.write " <td colspan=3 class=RightHead>"&nowplace&"</td>"
response.write " </tr>"
end sub
'***********************************************
' 目的: 公共下部分
'***********************************************
sub down()
response.write " </table>"
response.write " </td>"
response.write " </tr>"
response.write "</table>"
%>
<!--#include file=End.asp-->
<%
response.write "</body>"
response.write "</html>"
end sub
'***********************************************
'*****************************************************************************
' 目的: 按商品特性顯示最新商品列表
' 輸入: flag,RowNums,Row
' 說明: flag:商品特性(1=新 2=薦 3=特); NumsPerRow:每行商品數; Rows:行數;
'*****************************************************************************
Sub ProductIndexList(flag,NumsPerRow,Rows)
if IsNumeric(NumsPerRow)=false or IsNumeric(Rows)=false then
check="false"
end if
dim topnums
topnums=NumsPerRow*Rows
if check<>"false" then
response.write "<table cellspacing=0 cellpadding=2 style='border-collapse: collapse' width='100%' class=RightContent>"
response.write "<tr align=center>"
select case flag
case 1
sql="select top "&topnums&" id,Product_info_Name,Product_info_PriceM,Product_info_PriceS,Product_info_PicS from Product_info where Product_info_OnOff=0 and instr(Product_info_flag,1)"
case 2
sql="select top "&topnums&" id,Product_info_Name,Product_info_PriceM,Product_info_PriceS,Product_info_PicS from Product_info where Product_info_OnOff=0 and instr(Product_info_flag,2)"
case 3
sql="select top "&topnums&" id,Product_info_Name,Product_info_PriceM,Product_info_PriceS,Product_info_PicS from Product_info where Product_info_OnOff=0 and instr(Product_info_flag,3)"
end select
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof then
response.write "<td align=center>對不起,暫時沒有相關商品信息!</td></tr></table>"
else
i=1
set id =rs(0)
set Product_info_Name =rs(1)
set Product_info_PriceM =rs(2)
set Product_info_PriceS =rs(3)
set Product_info_PicS =rs(4)
xxx=1/NumsPerRow*100
while not rs.eof
response.write "<td align=center width="&xxx&"% >"
response.write " <table width='100%' border=0 align=center cellpadding=0 cellspacing=0 style='border-collapse: collapse'>"
response.write " <tr>"
response.write " <td align=center valign=top>"
response.write " <table border=1 cellspacing=0 cellpadding=4 style='border-collapse: collapse' bordercolor='#E4E4E4'>"
response.write " <tr><td align=center><a href=Product_Detail.asp?id="&id&"><img border=0 src=UPloadpic/"&Product_info_PicS&" onload='loaded(this,"&root_option_WidthSPic&","&root_option_HeighSPic&")' /></a></td></tr>"
response.write " </table>"
response.write " <a href=Product_Detail.asp?id="&id&">"&Product_info_Name&"</a><br />"
response.write " 市場價:¥"&formatnumber(Product_info_PriceM,0,-1)&"<br>"
response.write " 網站價:<b><font color=#FF6600>¥"&FormatNumber(Product_info_PriceS,0,-1)&"</font></b>"
response.write " </td>"
response.write " </tr>"
response.write " </table>"
response.write "</td>"
if i mod NumsPerRow = 0 then
response.write "</tr>"
end if
rs.movenext
i=i+1
wend
response.write "</table>"
end if
else
response.write "參數錯誤"
end if
rs.close
set rs=nothing
end sub
'*********************************************************
'*************************************************************************************************
' 目的: 按商品類別-顯示商品列表
' 輸入: cid,NumsPerPage,NumsPerRow
' 說明: cid:商品類別id; NumsPerPage:每頁記錄條數; NumsPerRow:每行顯示的商品數量;
'*************************************************************************************************
Sub Product_ListCategory(cid,NumsPerRow,NumsPerPage)
if IsNumeric(cid)=false or IsNumeric(NumsPerRow)=false or IsNumeric(NumsPerPage)=false then
check="false"
end if
if check<>"false" then
response.write "<table cellspacing=0 cellpadding=2 style='border-collapse: collapse' width='100%'>"
response.write "<tr align=center>"
sql="select id,Product_info_Name,Product_info_PriceM,Product_info_PriceS,Product_info_PicS from Product_info where Product_info_OnOff=0 and cid="&cid&" order by id desc"
'response.write sql
'response.end
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof then
response.write "<td align=center>對不起,暫時沒有相關商品信息!</td></tr></table>"
else
rs.PageSize =NumsPerPage '每頁記錄條數
iCount=rs.RecordCount '記錄總數
iPageSize=rs.PageSize
maxpage=rs.PageCount
page=request("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif page>maxpage then
page=maxpage
end if
rs.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if
i=1
set id =rs(0)
set Product_info_Name =rs(1)
set Product_info_PriceM =rs(2)
set Product_info_PriceS =rs(3)
set Product_info_PicS =rs(4)
xxx=1/NumsPerRow*100
while not rs.eof and i<=rs.pagesize
response.write "<td align=center width="&xxx&"% >"
response.write " <table width='100%' border=0 align=center cellpadding=0 cellspacing=0 style='border-collapse: collapse'>"
response.write " <tr>"
response.write " <td align=center valign=top>"
response.write " <table border=1 cellspacing=0 cellpadding=4 style='border-collapse: collapse' bordercolor='#E4E4E4'>"
response.write " <tr><td align=center><a href=Product_Detail.asp?id="&id&"><img border=0 src=UPloadpic/"&Product_info_PicS&" onload='loaded(this,"&root_option_WidthSPic&","&root_option_HeighSPic&")' /></a></td></tr>"
response.write " </table>"
response.write " <a href=Product_Detail.asp?id="&id&">"&Product_info_Name&"</a><br />"
response.write " 市場價:¥"&formatnumber(Product_info_PriceM,2,-1)&"<br>"
response.write " 網站價:<b><font color=#FF6600>¥"&FormatNumber(Product_info_PriceS,2,-1)&"</font></b>"
response.write " </td>"
response.write " </tr>"
response.write " </table>"
response.write "</td>"
if i mod NumsPerRow = 0 then
response.write "</tr>"
end if
rs.movenext
i=i+1
wend
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -