<!--#include file="../conn.asp"-->
<%
dim pid
dim aa(15)

pid = request.QueryString("pid")		'商品的ID编号


if request.QueryString("action")="submit" then call getLiuYan()

set rs_p = server.CreateObject("adodb.recordset")
rs_p.open "select * from zh_pro where id = "& pid &"",conn,1,1

if not rs_p.eof then
	aa(0) = rs_p("proImg")
	aa(1) = rs_p("price_shic")
	aa(2) = rs_p("price_xianshi")
	aa(3) = datediff("d",date(),rs_p("time_xianshi"))
	aa(4) = rs_p("jianjie")
	aa(5) = rs_p("Proname")
	aa(6) = rs_p("price_yika")
	aa(7) = rs_p("time_xianshi")
	aa(8) = rs_p("price_yika")
	aa(9) = rs_p("chuxiaoInfo")
	aa(10)= rs_p("if_chuxiao")
end if
rs_p.close
set rs_p = 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=gb2312" />
<title>装潢</title>
<link href="/css/comm.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/inc/showo_page.js"></script>
</head>

<body>
<div class="bodyDiv">
  <!--#include file="top.asp"-->
  <!--#include file="zh_daohang.asp"-->
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="267" valign="top" bgcolor="#f0f0f0">
		  <!--#include file="paihang.asp"-->
          <div style="text-align:center; padding:10px 0;"><img src="zh_img/Snap2.jpg" width="257" height="67" /></div>
          <!--#include file="chengjiao.asp"--><br />
          <!--#include file="model_cuxiao.asp"--><br />
          <!--#include file="pinpai.asp"--><br />
        </td>
        <td valign="top" width="22">&nbsp;</td>
        <td valign="top"><div style="margin-top:10px;">
          <table width="100%" height="60" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width="33%" style="border-right:dotted 1px #CCCCCC;"><img src="/<%=aa(0)%>" alt="" width="190" /></td>
              <td width="4%" valign="top">&nbsp;</td>
              <td width="63%" valign="top"><div style="font-size:16px; font-weight:bold; margin-bottom:15px;"><%=aa(5)%></div>
              <div style="padding-left:10px; line-height:180%; color:#969789;">市场价格：<span style="text-decoration:line-through;"><%=aa(1)%></span>&nbsp;元<br />
              <%
			if now() >= aa(7) then
				ifxianshi = "no"
				response.write "易卡搜价：<span style='color:#FF4900;'>"& aa(8) &"</span>&nbsp;元<br />"
			else
				ifxianshi = "yes"
				response.write "限时特价：<span style='color:#FF4900;'>"& aa(2) &"</span>&nbsp;元<br />"
			end if
			  %>
              节&nbsp;&nbsp;&nbsp;&nbsp;省：<%=cint(aa(1)) - cint(aa(2))%>&nbsp;元<br />
              <%if ifxianshi = "yes" then
			  	response.write "剩余时间："& aa(3) &"&nbsp;天<br />"
				end if
			  %>              
              <br />
              <a href="baoming.asp?pid=<%=pid%>"><img src="zh_img/Snap13.jpg" width="86" height="21" border="0" /></a></div></td>
            </tr>
          </table>
        </div>
        <%if aa(10) = "yes" then%>
        <div style="margin-top:10px;">
          <div style="background-image:url(zh_img/Snap15.jpg);"><img src="zh_img/Snap19.jpg" width="99" height="29" /></div>
          <div style="padding:10px; color:#535444; line-height:150%;"><%=aa(9)%></div>
        </div>
        <%end if%>
        <div style="margin-top:10px;">
          <div style="background-image:url(zh_img/Snap15.jpg);"><img src="zh_img/Snap14.jpg" width="99" height="29" /></div>
          <div style="padding:10px; color:#535444; line-height:150%;"><%=aa(4)%></div>
        </div>
        <div>
          <div style="padding:7px 0; border:solid 1px #D5D4D2;">&nbsp;&nbsp;<img align="absmiddle" src="zh_img/Snap1.jpg" width="15" height="18" />&nbsp;&nbsp;客户留言</div>
<%
set rs_11 = server.CreateObject("adodb.recordset")
rs_11.open "select * from zh_liuyan where pid="& pid &" order by id desc",conn,1,1

page_size = 10
prm = "pid="& pid &"&"
page=request.QueryString("page")
if page="" or isnumeric(page)=false then page=1
	
if not rs_11.eof then
	have = 1
	rs_11.pagesize     = page_size
	rs_11.absolutePage = page
	recordCountNum  = rs_11.recordcount
else
	have = 0
end if

if have = 1 then
			
		dim i
		i = rs_11.recordcount
		do while not rs_11.eof and i <=page_size
		  %>
          <table width="100%" height="65" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td height="31" colspan="2" style="font-weight:bold;"><%=i%>楼：<%=rs_11("name1")%></td>
            </tr>
            <tr>
              <td width="7%" height="34" bgcolor="#F3F3F3" style="color:#CC0001; font-weight:bold;">内容：</td>
              <td width="93%" bgcolor="#F3F3F3"><%=rs_11("content")%></td>
            </tr>
          </table>
          <%
		i = i - 1
		rs_11.movenext
		loop
end if
		rs_11.close
		set rs_11 = nothing
			  %>
          </div>
          <%if have = 1 then%>
          <div><Script Language="JavaScript">
ShowoPage("<table style='BORDER-COLLAPSE: collapse' borderColor='#111111' height='10' cellSpacing='0' cellPadding='0' width='95%' border='0'><tr><td vAlign='bottom'  style='font-family: Verdana,宋体; font-size: 11.5px; line-height: 15px'>","</td></tr></table>","页次:<font color='red'>","</font>/","","&nbsp;","&nbsp;每页<font color='red'>","</font>&nbsp;","&nbsp;共计:<font color='red'>","</font></td><td vAlign='bottom' align='right'  style='font-family: Verdana,宋体; font-size: 11.5px; line-height: 15px'>","<font face=webdings>9</font>","<font face=webdings>7</font>","<font face=webdings>8</font>","<font face=webdings>:</font>","&nbsp;&nbsp;跳转:","<font color='orange'>[","]</font>","","","<font color='red'>","</font>","","",<%=recordCountNum%>,<%=page_size%>,4,"?p=parm1&<%=prm%>")
</Script></div>
          <%end if%>
          

        <div style="margin-top:10px;">
          <table width="100%" height="51" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td bgcolor="#F6F6F6"><form id="form1" name="form1" method="post" action="?action=submit">
                <textarea name="content" id="content" cols="60" rows="5"></textarea>
                <div style="padding:5px 0; color:#333333;"><input name="ifniming" type="checkbox" id="ifniming" value="yes" align="absmiddle" />                
匿名留言(选择该选项后您对此商品的留言及评论都将<span style="color:#0000FF;">匿名</span>)</div>
                <div style="color:#333333;">请输入您的用户名：
                  <input name="name1" type="text" id="name1" size="15" align="absmiddle" />
                  <input type="image" src="zh_img/Snap16.jpg" align="absmiddle" name="button" id="button" value="提交" />
                  <input name="pid" type="hidden" id="pid" value="<%=pid%>" />
                </div>
              </form>              </td>
            </tr>
          </table>
        </div><br /></td>
      </tr>
  </table>

  <!--#include file="../model_bottom.asp"-->
</div>
</body>
</html>
<%
'=================================
'将留言信息插入数据库
function getLiuYan()
	dim bb(4)
	dim rs_11
	
	bb(0) = toHTML(request.Form("content"))
	bb(1) = request.Form("name1")
	bb(2) = request.Form("ifniming")
	bb(3) = now()
	bb(4) = request.Form("pid")
	
	if bb(2) = "yes" then
		bb(1) = "匿名"
	end if
	
	set rs_11 = server.CreateObject("adodb.recordset")
	rs_11.open "select top 1 * from zh_liuyan",conn,1,3
	rs_11.addnew
	rs_11("Pid")     = bb(4)
	rs_11("Name1")   = bb(1)
	rs_11("Content") = bb(0)
	rs_11("Shijian") = bb(3)
	rs_11.update
	rs_11.close
	set rs_11 = nothing
	response.Redirect("view.asp?pid="& bb(4) &"")
end function
%>