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

📄 product.asp

📁 企业管理系统,黑色风格
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
dim rs,id,item_p,code_p,size_p,material_p,price_p,img_p,keywords_p,Description_p,content_p,classid_p
  id=trim(request.QueryString("id"))
  set rs=conn.execute("select top 1 * from data_Product where item<>'' and id="&id&" ")
   if not rs.eof then
	 item_p=rs("item")
	 code_p=rs("code")
	 size_p=rs("size")
	 material_p=rs("material")
	 price_p=rs("price")
	 img_p=rs("img")
	 keywords_p=rs("keywords")
	 Description_p=rs("Description")
	 classid_p=rs("classid")
	 content_p=rs("content")
	 updatetime_p=rs("updatetime")
	 title_p=item_p
   end if 
  rs.close
  set rs=nothing
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=title_p%>-<%=websitename%></title>
<%
if keywords_p<>"" then
response.write("<meta name=""keywords"" content="""&keywords_p&""" />" & vbcrlf)
end if
if Description_p<>"" then
response.write("<meta name=""Description"" content="""&Description_p&""" />" & vbcrlf)
end if
%><script src="inc/functions.js" type="text/javascript"></script>
<link href="images/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.STYLE1 {color: #FFFFFF}
.STYLE7 {color: #CCCCCC}
-->
</style>
</head>
<body class="product">
<div id="page">
<!--#include file="top.asp"--> 
<div id="body">
     <div id="left">
       <!--#include file="left.asp"-->
     </div>
<div id="right">
<div id="path"><%=get_path(classid_p)%></div>
<div id="show_content">
             <div class="title"><span class="t"><h1><font color="#CCCCCC"><%=title_p%></font></h1></span></div>
             <div class="content"><font color="#CCCCCC"><%=material_p%></font>
             <table width="100%" border="0" align="center" cellspacing="5">
    <tr>
      <td width="7%" align="right" nowrap="nowrap"><span class="STYLE7">名称:</span> </td>
      <td width="44%" align="left"><font color="#CCCCCC"><%=item_p%></font></td>
      <td width="8%" align="right" nowrap="nowrap"><span class="STYLE1"><span class="STYLE7">编号:</span></span></td>
      <td width="41%" align="left"><font color="#CCCCCC"><%=code_p%></font></td>
    </tr>
    <tr>
      <td align="right" nowrap="nowrap"><span class="STYLE7">规格:</span></td>
      <td align="left"><font color="#CCCCCC"><%=size_p%></font></td>
      <td align="right" nowrap="nowrap"><span class="STYLE7">颜色:</span></td>
      <td align="left"><font color="#CCCCCC"><%=colour_p%></font></td>
    </tr>
    <tr>
      <td align="right" nowrap="nowrap"><span class="STYLE7">材料:</span></td>
      <td align="left"><font color="#CCCCCC"><%=material_p%></font></td>  
      <td align="right" nowrap="nowrap">
        <span class="STYLE7">价格:</span>      </td>
      <td align="left"><font color="#CCCCCC">
        <%=price_p%></font><span class="STYLE7">元</span></td>
    </tr>
  </table>
            <div style="text-align:center;"> <img src="<%=img_p%>" width="<%=c_product_width%>" height="<%=c_product_height%>" align="absmiddle" onload="ResizeImage(this, <%=c_product_width%>, <%=c_product_height%>);" /></div>
             <table width="100%" border="0" align="center" cellpadding="0" cellspacing="5">
    <tr>
      <td align="left"><span class="STYLE7">内容:</span></td>
    </tr>
    <tr>
      <td align="left">
          <font color="#CCCCCC"><%=content_p%></font></td>
    </tr>
  </table>
        </div>
</div>
<div id="Related">
  <div class="title">相关产品</div>
  <div class="content">
     <ul>
      <%
	dim ids,nn 
	nn=5
	ids=get_Related(updatetime_p,classid_p,nn)
   set rs=server.CreateObject("adodb.recordset")
   rs.open "select top 10 * from data_Product where item<>''  and display=1 and classid="&classid_p&" and id in("&ids&")   order by  updatetime desc,id desc",conn,1,1
   i=0
   while not rs.eof
   if i mod  5=0 then
   response.write("<li class=""first"">" & vbcrlf)
   else
   response.write("<li>" & vbcrlf) 
   end if
   response.write("<div class=""box"" >" & vbcrlf)
   response.write("<a href=""product.asp?id="&rs("id")&""" title="""&rs("item")&"""><img src="""&rs("img_s")&""" border=""0"" align=""absmiddle"" width="""&c_product_width_s&""" height="""&c_product_height_s&""" onload=""ResizeImage(this, "&c_product_width_s&", "&c_product_height_s&");"" alt="""&rs("item")&"""></a></div>" & vbcrlf)
   response.write("      <div class=""txt""><a href=""product.asp?id="&rs("id")&""" >"&strleft(rs("item"),16,"..")&"</a></div>" & vbcrlf)
   response.write(" </li>" & vbcrlf)
i=i+1
	rs.movenext
	wend
	rs.close
	set rs=nothing
	
	
	function get_Related(byval updatetime,byval classid,byval nn)
	    dim nn1,nn2,strtemp
		strtemp="0"
		nn1=0
		nn2=0
	    set rs=conn.execute("select count(id) from data_Product where item<>'' and display=1 and classid="&classid_p&" and updatetime>#"&updatetime&"# ")
		if rs(0)>0 then 
		nn1=rs(0)
		end if
	    set rs=conn.execute("select count(id) from data_Product where item<>'' and display=1 and classid="&classid_p&" and updatetime<#"&updatetime&"# ")
		if rs(0)>0 then 
		nn2=rs(0)
		end if
		'前后分配个数
		if nn1>nn and nn2>nn then
		     nn1=nn
		     nn2=nn
		elseif nn1>nn and nn2<=nn then
		     nn1=nn+(nn-nn2)
		elseif nn1<=nn and nn2>nn then
			 nn2=nn+(nn-nn1)  
		end if
		
		if nn1>0 and nn2>0 then
		set rs=conn.execute(" (select top "&nn1&" id from data_Product where item<>'' and display=1 and classid="&classid_p&" and updatetime>#"&updatetime&"# order by updatetime) union (select top "&nn2&" id from data_Product where item<>'' and display=1 and classid="&classid_p&" and updatetime<#"&updatetime&"#  order by updatetime desc)")
		elseif  nn1>0 and nn2=0 then
		set rs=conn.execute(" select top "&nn1&" id from data_Product where item<>'' and display=1 and classid="&classid_p&" and updatetime>#"&updatetime&"# order by updatetime")
		elseif nn1=0 and nn2>0 then
		set rs=conn.execute(" select top "&nn2&" id from data_Product where item<>'' and display=1 and classid="&classid_p&" and updatetime<#"&updatetime&"#  order by updatetime desc")
		else
		set rs=conn.execute(" select top "&(2*nn)&" id from data_Product where item<>'' and display=1 and classid="&classid_p&"   order by updatetime desc ")
		end if
		while not rs.eof
		strtemp=strtemp&","&rs(0)
		rs.movenext
		wend
		rs.close
		set rs=nothing
		get_Related=strtemp
	end function
	%></ul>
    <div class="clear"></div>
  </div>
</div>
          </div>

<div class="clear"></div>
  </div>
  <!--#include file="bottom.asp"-->
</div>
</body>
</html>

⌨️ 快捷键说明

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