<!-- #include file="include/con_shop.asp" -->
<!-- #include file="include/con_shop_main.asp" -->
<!-- #include file="include/jk_ubb.asp" -->
<!-- #include file="include/jk_review.asp" -->
<%
dim id,c_id,s_id,p_name,p_serial,p_brand,p_stock,p_down_url,p_down_remark,p_remark_1,p_remark_2,p_smallimg,p_bigimg,p_counter,p_buy_counter,p_hidden,p_isgood,p_tim,p_cod,p_keyes,p_price,p_discount,p_is_emoney,p_emoney,p_price_now
id=trim(request.querystring("id"))
if not isnumeric(id) then id=0
sql="select top 1 * from shop_product where hidden=1 and id="&id
set rs=joekoe_cms.exec(sql,1)
if rs.eof then
  rs.close
  call format_redirect("shop.asp")
end if
cid=rs("c_id")
sid=rs("s_id")
p_name=rs("name")
p_serial=rs("serial")
p_brand=rs("brand")
p_stock=rs("stock")
p_down_url=rs("down_url")
p_down_remark=rs("down_remark")
p_remark_1=rs("remark_1")
p_remark_2=rs("remark_2")
p_smallimg=rs("smallimg")
p_bigimg=rs("bigimg")
p_counter=rs("counter")
p_buy_counter=rs("buy_counter")
p_hidden=rs("hidden")
p_isgood=rs("isgood")
p_tim=rs("tim")
p_cod=rs("cod")
p_keyes=rs("keyes")
p_price=rs("price")
p_discount=rs("discount")
p_is_emoney=rs("is_emoney")
p_emoney=rs("emoney")
rs.close
p_price_now=fm_price(p_price*(p_discount/100),0)
if int(p_cod)=1 then p_remark_2=code_jk(p_remark_2)

tit="产品浏览 ("&p_name&" )" 

call web_head(0,0,0,0,0)
call shop_load(0,0,0)
'----------------------------左边 开始----------------------------
call shop_left()
call shop_left_nsort(0)
call shop_cast_top(6,10)
'----------------------------左边 结束----------------------------
call web_center(0)
'----------------------------中间 开始----------------------------
response.write vbcrlf&shop_bar_top(tit,1,1)
%>
<tr>
<td width='40%' align=center><%response.write pic_url(p_bigimg,2)%></td>
<td width='60%'>
  <table border=0>
  <tr><td colspan=2><font class=blue size=3><b><%response.write p_name%></b></font></td></tr>
  <tr>
  <td><%response.write val_name%>品牌：<%response.write p_brand%></td>
  <td rowspan=5 align=right>
    <table border=0 width=150>
    <tr><td align=center><a href='shop_bag.asp?id=<%response.write id%>' target=_blank><img src='<%response.write joekoe_cms.web_dir%>skin/<%response.write joekoe_cms.web_skin%>/main/button_bag.gif' border=0></a></td></tr>
    <tr><td align=center height=30>现在<%response.write p_stock%></td></tr>
    <tr><td align=center>订购<font class=red><%response.write p_buy_counter%></font>次，浏览<%response.write p_counter%>次</td></tr>
    </table>
    </td>
  </tr>
  <tr><td><%response.write val_name%>价格：<font class=red><%response.write p_price_now%></font> <%response.write val_unit%></td></tr>
  <tr><td><%response.write val_name%>原价：<%response.write p_price&val_unit%> <font class=red2><%response.write fm_discount(p_discount)%></font></td></tr>
  <tr><td><%response.write joekoe_cms.web_unit%>支付：<%response.write shop_emoney_pay(p_is_emoney,p_emoney,id)%></td></tr>
  <tr><td><%response.write val_name%>编号：<%response.write p_serial%></td></tr>
  </table>
</td>
</tr>
<%
response.write vbcrlf&shop_bar_end("",1)
response.write vbcrlf&shop_bar_top("简单介绍",1,2)
%>
<tr><td>
  <table border=0 width='100%' class=tf>
  <tr><td class=bw><font class=htd><%response.write joekoe_cms.code_html(p_remark_1,2,0)%></font></td></tr>
  </table>
</td></tr>
<%
response.write vbcrlf&shop_bar_end("",1)
response.write vbcrlf&shop_bar_top("详细介绍",1,4)
%>
<tr><td>
  <table border=0 width='98%' class=tf>
  <tr><td class=bw><font class=htd><%response.write p_remark_2%></font></td></tr>
  </table>
</td></tr>
<%
response.write vbcrlf&shop_bar_end("",1)
response.write vbcrlf&shop_bar_top("相关产品",1,3)
%>
<tr><td>
  <table border=0 class=tablew><%call shop_view_keyes(p_keyes)%></table>
</td></tr>
<%
response.write vbcrlf&shop_bar_end("",1)
response.write vbcrlf&shop_bar_top("相关评论",1,1)
response.write vbcrlf&"<tr><td align=center>"
call review_type(n_sort,id,"shop_view.asp?id="&id,1,"")
response.write vbcrlf&"</td></tr>"
response.write vbcrlf&shop_bar_end("",1)
call joekoe_cms.exec("update shop_product set counter=counter+1 where id="&id,0)
'----------------------------中间 结束----------------------------
call shop_end()
call web_end(0,0)

sub shop_view_keyes(kvar)
  dim sqladd,li,price,price_now,discount,name
  sqladd=sql_key(kvar,"keyes",1,"or")
  li=0
  if sqladd<>"" then
    sql="select id,name,smallimg,brand,price,discount,is_emoney,emoney from shop_product where hidden=1 and "&sqladd&" and id<>"&id&" order by id desc"
    set rs=joekoe_cms.exec(sql,1)
    do while not rs.eof
      if (li mod 2)=0 then response.write vbcrlf&"<tr valign=top>"
      name=joekoe_cms.code_html(rs("name"),1,0)
      price=fm_price(rs("price"),0)
      discount=rs("discount")
      price_now=fm_price(price*(discount/100),0)
      discount=fm_discount(discount)
      response.write vbcrlf&shop_list_type(rs("id"),name,rs("smallimg"),rs("brand"),price,price_now,discount,rs("is_emoney"),rs("emoney"))
      if (li mod 2)>0 then response.write vbcrlf&"</tr>"
      rs.movenext
      li=li+1
    loop
    rs.close
    if (li mod 2)>0 then
      response.write vbcrlf&"<td width='50%'></td></tr>"
    end if
  end if
end sub
%>