<!-- #include file="include/config.asp" -->
<!-- #include file="../include/jk_pagecute.asp" -->
<!-- #include file="../include/jk_page_cute.asp" -->

<%
dim id,name,brand,is_emoney,emoney,tmp1,tmp2,tmp3
dim nummer,rssum,page,viewpage,thepages,pageurl
pageurl="?"
nummer=dim_num(0)
tit="商城报价" 

call web_head(0,0,0,0,0)
call shop_load()
'----------------------------左边 开始----------------------------
call shop_left()
call shop_cast_top(5,10)
call shop_top(10,10)
call shop_left_nsort(0)
'----------------------------左边 结束----------------------------
call web_center(0)
'----------------------------中间 开始----------------------------
call shop_search()
call shop_price()
'----------------------------中间 结束----------------------------
call web_end(0,0)

sub shop_price()
dim temp1
temp1=temp1&vbcrlf&"<tr class=bg_tds height=25 align=center>" & _
          vbcrlf&"<td width='6%'>序号</td>" & _
          vbcrlf&"<td ddd1>商品名称</td>" & _
          vbcrlf&"<td width='12%'>商品品牌</td>" & _
          vbcrlf&"<td width='12%'>商品售价</td>" & _
          vbcrlf&"<td width='12%'>商品原价</td>" & _
          vbcrlf&"<td width='12%'>商品折扣</td>" & _
          vbcrlf&"<td width='12%'>节省资金</td>" & _
          vbcrlf&"<td width='12%'>"&web_dim(9)&"支付</td>" & _
          vbcrlf&"</tr>"
  sql="select count(id) from shop_product where hidden=1"
  set rs=joekoe_cms.exec(sql,1)
  rssum=rs(0)
  rs.close
  call format_pagecute()
  sql="select top "&nummer*viewpage&" id,name,brand,discount,price,is_emoney,emoney from shop_product where hidden=1 order by id desc"
  call joekoe_cms.exec(sql,-1)
  rs.open sql,conn,1,1
  if int(viewpage)>1 then  rs.move (viewpage-1)*nummer end if
  for i=1 to nummer
  if rs.eof then exit for
  id=rs("id")
  name=rs("name")
  brand=rs("brand")
  emoney=rs("emoney")
  tmp1=rs("price")
  tmp2=rs("discount")
  is_emoney=rs("is_emoney")
  if int(tmp2)<100 then 
    tmp3=formatnumber(tmp1*tmp2/100)  
  else 
    tmp3=tmp1
  end if
temp1=temp1&vbcrlf&"<tr class=bg_td align=center>" & _
          vbcrlf&"<td>"& (viewpage-1)*nummer+i &"</td>" & _
          vbcrlf&"<td align=left><a href='view.asp?id="& id &"' alt='"& joekoe_cms.code_html(name,1,0) &"'>"& joekoe_cms.code_html(name,1,11) &"</a></td>" & _
          vbcrlf&"<td>"& brand &"</td>" & _
          vbcrlf&"<td align=right><font class=red>"& tmp3 &"</font> 元 </td>" & _
          vbcrlf&"<td align=right><font class=gray>"& tmp1 &"</font> 元 </td>" & _
          vbcrlf&"<td><font class=red2>"& fm_discount(tmp2) &"</font></td>" & _
          vbcrlf&"<td align=right><b><font class=red>"& tmp1-tmp3 &"</font></b> 元 </td>" & _
          vbcrlf&"<td>"& note_emoney(is_emoney,emoney) &"</td>" & _
          vbcrlf&"</tr>"
    rs.movenext
  next
  rs.close
temp1=temp1&vbcrlf&"<tr class=bg_tds height=30>" & _
          vbcrlf&"<td colspan=8>" & _
          vbcrlf&"共有 <font class=red>"& rssum &"</font> 个"& tit &"，每页 <font class=blue>"& nummer &"</font> 个，页次：<font class=red>"& viewpage&"</font>/<font class=red>"&thepages &"</font>&nbsp;&nbsp;分页："& jk_pagecute(nummer,thepages,viewpage,pageurl,5,"#ff0000")  &"" & _
          vbcrlf&"</td>" & _
          vbcrlf&"</tr>"
call shop_center_table(tit,temp1,1,1)
end sub


function fm_discount(dvar)
  if dvar>=100 then
    fm_discount="不打折"
    exit function
  end if 
  fm_discount=cstr(dvar/10)&"折"
end function

function note_emoney(p_is_emoney,p_emoney)
  if p_is_emoney=true and p_emoney>0 then   
   note_emoney="<font class=blue>"&p_emoney&""&web_dim(9)&"</font>"
     exit function
  end if 
   note_emoney="<font class=gray>不可用</font>"
 end function
%>