<!-- #include file="include/config.asp" -->
<!-- #include file="../include/jk_pagecute.asp" -->
<!-- #include file="../include/jk_page_cute.asp" -->
<!-- #include file="../include/jk_review.asp" -->
<!-- #include file="../include/jk_ubb.asp" -->
<%
dim nummer,nums,rssum,page,viewpage,thepages,tmp
nummer=dim_num(0)
nums=nummer
page=1
tit="商城公告"
call web_head(0,0,0,0,0)
call shop_load()
'----------------------------左边 开始----------------------------
call shop_left()
call shop_left_nsort(0)
call shop_top(10,10)
if action="view" then
  call shop_cast_top(10,10)
end if
'----------------------------左边 结束----------------------------
call web_center(0)
'----------------------------中间 开始----------------------------
n_sort="scast"


'select case action
'case "view"
  call shop_cast_view()
'case else
'  call shop_cast_main()
'end select

'----------------------------中间 结束----------------------------
call shop_end()
call web_end(0,0)

sub shop_cast_view()
  dim tmp,id,word
  id=trim(request.querystring("id"))
  if not(isnumeric(id)) then
    call shop_cast_main()
    exit sub
  end if
  sql="select top 1 * from shop_cast where hidden=1 and id="&id
  set rs=joekoe_cms.exec(sql,1)
  if rs.eof then
    call shop_cast_main()
    exit sub
  end if
  word=rs("word")
  if int(rs("cod"))=1 then word=code_jk(word)
  tmp=CMS_Skin.GetDB("shop_cast")
  tmp=Replace(tmp,"{$topic}",joekoe_cms.code_html(rs("topic"),1,0))
  tmp=Replace(tmp,"{$tim}",joekoe_cms.time_type(rs("tim"),2))
  tmp=Replace(tmp,"{$word}",word)
  rs.close
  call shop_center_table("公告浏览",tmp,1,4)
  
  call shop_center_table("相关评论","",1,4)
  call review_type(n_sort,id,joekoe_cms.web_path&"shop/cast.asp?action=view&id="&id,1,"")
end sub

sub shop_cast_main()
  dim tmp1,pageurl,topic,istop,tim,hvar
  pageurl="?"
  tmp1=vbcrlf&"<tr align=center class=bg_tds>" & _
       vbcrlf&"<td width='6%'>序号</td>" & _
       vbcrlf&"<td "&ddd2&">"&tit&"标题" & _
       vbcrlf&"<td width='16%'>发布时间</td>" & _
       vbcrlf&"</tr>"
  sql="select count(id) from shop_cast where hidden=1"
  set rs=joekoe_cms.exec(sql,1)
  rssum=rs(0)
  rs.close
  call format_pagecute()
  sql="select top "&nummer*viewpage&" * from shop_cast where hidden=1 order by id desc"
  call joekoe_cms.exec("",-1)
  rs.open sql,conn,1,1
  if int(viewpage)>1 then rs.move (viewpage-1)*nummer
  if int(viewpage*nummer)>int(rssum) then nums=nummer-(viewpage*nummer-rssum)
  for i=1 to nums
    topic=rs("topic")
    istop=rs("istop")
    tim=rs("tim")
    hvar=web_img_h
    if int(istop)>0 then hvar="'istop'"
    tmp1=tmp1&vbcrlf&"<tr align=center class=bg_td>" & _
         vbcrlf&"<td>"&img_skin(hvar)&"</td>" & _
         vbcrlf&"<td align=left><a href='?action=view&id="&rs("id")&"' alt='"&joekoe_cms.code_html(topic,1,0)&"'>"&joekoe_cms.code_html(topic,1,30)&"</a></td>" & _
         vbcrlf&"<td><font alt='"&joekoe_cms.time_type(tim,2)&"' class=gray>"&joekoe_cms.time_type(tim,4)&"</font></td>" & _
         vbcrlf&"</tr>"
    rs.movenext
  next
  rs.close
tmp1=tmp1&vbcrlf&"<tr class=bg_tds height=30><td colspan=4>共有<font class=red>"&rssum&"</font>条"&tit&"&nbsp;页次：<font class=red>"&viewpage&"</font>/<font class=red>"&thepages&"</font>&nbsp;分页："&jk_pagecute(nummer,thepages,viewpage,pageurl,3,"#ff0000")&"</td></tr>"
  call shop_center_table(tit,tmp1,1,1)
end sub
%>