⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showproduct.asp

📁 网上购物系统
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="page.asp"-->
<%
action=request.querystring("action")
productclassid=request.querystring("productclassid")
productid=request.querystring("productid")
if action="list" then
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="Image/Main.css" rel="stylesheet" type="text/css" />
<title>产品</title>
</head>
<body>
<!--#include file="top.asp"-->
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="180" align="center" valign="top">
	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="14"></td>
      </tr>
    </table>
	<table width="100%" border="1"align="center" cellpadding="3" cellspacing="1" bordercolor="#CCCCCC" style="border-collapse: collapse">
      <tr>
        <td height="20" align="center" bgcolor="#eeeeee">栏目列表</td>
      </tr>
      <tr>
        <td> ·<a href="?action=list">全部产品</a></td>
      </tr>	  
<%
Set TiaoRs=Server.CreateObject("AdoDb.RecordSet")
TiaoRs.Open "Select * From productclass",Conn,1,1
Do While Not TiaoRs.eof 
%>
	  
      <tr>
        <td> ·<a href="?action=list&productclassid=<%=tiaors(0)%>"><%=tiaors(1)%></a></td>
      </tr>
<%
tiaors.movenext
Loop
TiaoRs.Close
Set TiaoRs=Nothing
%>	  
    </table></td>
    <td width="3">&nbsp;</td>
    <td align="center" valign="top">
	<table width="100%" height="100%" border="1"align="center" cellpadding="3" cellspacing="1" bordercolor="#CCCCCC" style="border-collapse: collapse">
      <tr>
        <td align="center" bgcolor="#eeeeee">产品列表</td>
      </tr>
<%
Set mypage=new xdownpage
mypage.getconn=conn
if productclassid<>""then
mypage.getsql="select * from product where productclassid="&productclassid&" order by productid desc"
else
mypage.getsql="select * from product order by productid desc"
end if
mypage.pagesize=16
set rspage=mypage.getrs()
Response.Write("<br/>")
for i=1 to mypage.pagesize
if not rspage.eof then
%>	  
      <tr>
        <td> ·<a target="_blank" href="?action=show&productid=<%=rspage("productid")%>"><%=rspage("productname")%></a></td>
      </tr>
<%
rspage.movenext
else
exit for
end if
next
%>  	  
      <tr>
        <td align="right"><%mypage.showpage()%></td>
      </tr>
    </table></td>
  </tr>
</table>
<!--#include file="foot.asp"-->
</body>
</html>
<%
end if
if action="show" then
set rs=server.createobject("adodb.recordset")
sql="select * from product where productid="&productid
rs.open sql,conn,1,1
productclassid=rs("productclassid")
productname=rs("productname")
productContent=rs("productContent")
productpicture=rs("productpicture")
ProductKucun=rs("ProductKucun")
ProductPrice=rs("ProductPrice")
set rs=server.createobject("adodb.recordset")
sql="select * from productclass where productclassid="&productclassid
rs.open sql,conn,1,1
productclassname=rs("productclassname")
rs.close
set rs=nothing
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="Image/Main.css" rel="stylesheet" type="text/css" />
<title>产品-<%=productclassname%>-<%=productname%></title>
</head>
<body>
<!--#include file="top.asp"-->
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
     <td height="14"></td>
  </tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="180" align="center" valign="top">
	<table width="100%" border="1"align="center" cellpadding="3" cellspacing="1" bordercolor="#CCCCCC" style="border-collapse: collapse">
      <tr>
        <td height="20" align="center" bgcolor="#eeeeee">栏目列表</td>
      </tr>
      <tr>
        <td> ·<a href="?action=list">全部产品</a></td>
      </tr>	  
<%
Set TiaoRs=Server.CreateObject("AdoDb.RecordSet")
TiaoRs.Open "Select * From productclass",Conn,1,1
Do While Not TiaoRs.eof 
%>
	  
      <tr>
        <td> ·<a href="?action=list&productclassid=<%=tiaors(0)%>"><%=tiaors(1)%></a></td>
      </tr>
<%
tiaors.movenext
Loop
TiaoRs.Close
Set TiaoRs=Nothing
%>	  
    </table></td>
    <td width="3">&nbsp;</td>
    <td align="center" valign="top">
	<table width="100%" border="1"align="center" cellpadding="3" cellspacing="1" bordercolor="#CCCCCC" style="border-collapse: collapse">
      <tr>
        <td colspan="2" height="20">导航:产品&gt;&gt;<%=productclassname%>&gt;&gt;正文</td>
      </tr>
      <tr>
        <td colspan="2" align="center" bgcolor="#eeeeee"><%=productname%></td>
      </tr>
      <tr>
        <td width="160" height="160" rowspan="4" align="center" valign="middle"><%if productpicture<>""then%>
            <img src="<%=productpicture%>" width="150" height="150"><br>
            <%end if%>
        </td>
        <td align="left" valign="middle">【品牌】<%=productclassname%></td>
      </tr>
      <tr>
        <td align="left" valign="middle">【库存】<%=productkucun%>台</td>
      </tr>
      <tr>
        <td align="left" valign="middle">【单价】<%=productprice%>元</td>
      </tr>
      <tr>
        <td width="576" align="center" valign="middle">【<a href="javascript:;" onClick="javascript:window.open('shopcart.asp?id=<%=productid%>&action=add','gouwu','width=450,height=300,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');">加入购物车</a>】 </td>
      </tr>
      <tr>
        <td height="300" colspan="2" align="left" valign="top"><%=productContent%> </td>
      </tr>
      <tr>
        <td colspan="2" align="center">【<A href='javascript:window.close()'>关闭</A>】</td>
      </tr>
    </table></td>
  </tr>
</table>
<!--#include file="foot.asp"-->
</body>
</html>
<%end if%>

⌨️ 快捷键说明

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