<!-- #include file="include/con_shop.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
nummer=dim_num(0)
nums=nummer
page=1
tit="商城公告"
call web_head(0,0,0,0,0)
call shop_load(0,0,0)
'----------------------------左边 开始----------------------------
call shop_left()
call shop_left_nsort(0)
if action="view" then
  call shop_cast_top(10,10)
end if
'----------------------------左边 结束----------------------------
call web_center(0)
'----------------------------中间 开始----------------------------
n_sort="scast"

response.write vbcrlf&shop_bar_top(tit,1,1)
response.write ukong

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

response.write vbcrlf&shop_bar_end("",1)
response.write ukong
'----------------------------中间 结束----------------------------
call shop_end()
call web_end(0,0)

sub shop_cast_view()
  dim 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)
%>
<table cellspacing=1 cellpadding=4 class=table>
<tr><td class=bg_td align=center><font class=blue size=3><b><%response.write joekoe_cms.code_html(rs("topic"),1,0)%></b></font></td></tr>
<tr><td class=bg_td height=30 class=gray align=center><a href="shop_cast.asp" class=gray>商城公告</a>　<%response.write joekoe_cms.time_type(rs("tim"),2)%>　<a href="javascript:history.back(-1);" class=gray>返回上一页</a></td></tr>
<tr><td class=bg_td>
  <table border=0 width='98%' class=tf>
  <tr><td class=bw><font class=htd><%response.write word%></font></td></tr>
  </table>
</td></tr>
</table>
<%
  rs.close
  response.write vbcrlf&shop_bar_top("相关评论",1,4)
  call review_type(n_sort,id,"shop_cast.asp?action=view&id="&id,1,"")
end sub

sub shop_cast_main()
  dim pageurl,topic,istop,tim,hvar
  pageurl="?"
%>
<table cellspacing=1 cellpadding=4 class=table>
<tr class=bg_tds align=center>
<td width='6%'>序号</td>
<td width='78%'><%response.write tit%>标题</td>
<td width='16%'>发布时间</td>
</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'"
%>
<tr align=center class=bg_td>
<td><%response.write img_skin(hvar)%></td>
<td align=left><a href='?action=view&id=<%response.write rs("id")%>' alt='<%response.write joekoe_cms.code_html(topic,1,0)%>'><%response.write joekoe_cms.code_html(topic,1,30)%></a></td>
<td><font alt='<%response.write joekoe_cms.time_type(tim,2)%>' class=gray><%response.write joekoe_cms.time_type(tim,4)%></font></td>
</tr>
<%
    rs.movenext
  next
  rs.close
%>
<tr class=bg_tds height=30><td colspan=4>共有<font class=red><%response.write rssum%></font>条<%response.write tit%>&nbsp;页次：<font class=red><%response.write viewpage&"</font>/<font class=red>"&thepages%></font>&nbsp;分页：<% response.write jk_pagecute(nummer,thepages,viewpage,pageurl,3,"#ff0000") %></td></tr>
</table>
<%
end sub
%>