<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!-- #include file="../session.asp"-->
<!--#include file="../../inc/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<!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>新闻列表 - Powered by GoCDKEY! | www.gocdkey.cn</title>
<link href="../images/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
	color: #0590D3;
}
a:link {
	color: #3366CC;
}
a:visited {
	color: #3366CC;
}
a:hover {
	color: #FF0000;
}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style></head>
<%
if not isempty(request("selAnnounce")) then
idlist=request("selAnnounce")
if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist)
dim id
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call deleteannounce(id)
next
else
call deleteannounce(clng(idlist))
end if
end if

sub deleteannounce(id)
dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="delete from cdkey88_news where news_id="&cstr(id)
conn.execute sql
set fs=server.CreateObject("scripting.filesystemobject")
filepath="/news/show_news.asp?news_id="&id&""
filepath=server.MapPath(filepath)
if fs.FileExists(filepath) then
     fs.DeleteFile filepath,true
end if
End sub
%>
<body>
<TABLE border="1" cellspacing="0" width="100%" cellpadding="2" style="border-collapse: collapse" bordercolor="#dddddd" bordercolorlight="#dddddd" bordercolordark="#dddddd" align="center">
  <!--DWLayoutTable-->
  <form action="news_list.asp?page=<%=request("page")%>&username=<%=request("username")%>&game_id=<%=request("game_id")%>" method="post" name="Form1">
  <tr bgcolor="#0590D3">
    <td width="60" height="23" align="center" valign="middle" class="font_color">编号</td>
    <td width="350" align="center" valign="middle" class="font_color">新闻标题</td>
    <td width="90" align="center" valign="middle" class="font_color">所属游戏</td>
	<td width="110" align="center" valign="middle" class="font_color">添加人</td>
    <td width="90" align="center" valign="middle" class="font_color">添加日期</td>
    <td width="42" align="center" valign="middle" class="font_color">修改</td>
    <td width="45" align="center" valign="middle"><span class="font_color">
      <input name="submit" type='submit' value='删除' />
    </span></td>
  </tr>
   <%set rs=server.CreateObject("Adodb.recordset")
   if request("username")<>"" then
   rs.open "select news_id,news_title,date,game_id,username,f from cdkey88_news where username='"&request("username")&"' and typeid=1 order by news_id desc",conn,1,1
   elseif request("game_id")<>"" then
   rs.open "select news_id,news_title,date,game_id,username,f from cdkey88_news where game_id="&request("game_id")&" and typeid=1 order by news_id desc",conn,1,1
   else
rs.open "select news_id,news_title,date,game_id,username,f from cdkey88_news where typeid=1 order by news_id desc",conn,1,1
end if
if rs.eof then
	response.write"<tr><td colspan=9 height=50 align=center><font color=#ff0000>暂无记录</font></td></tr>"
	response.End()
	end if
	if rs.recordcount<>0 then
	rs.pagesize=15
    if request("page")<>"" then
	currentpage=cint(request("page"))
	else
	currentpage=1
	end if
	if currentpage<=1 then
	currentpage=1
	end if
	if currentpage=>rs.pagecount then
	currentpage=rs.pagecount
	end if
	rs.AbsolutePage=currentpage
	end if
	do while not rs.eof
	if rs("game_id")<>0 and not isnull(rs("game_id")) and rs("game_id")<>"" then
	set rs2=server.CreateObject("adodb.recordset")
	rs2.open "select game_name,game_id from cdkey88_game where game_id="&rs("game_id"),conn,1,1
    s="<a href='news_list.asp?game_id="&rs("game_id")&"' title='该游戏所有新闻信息'><font color=#ff0000>"&rs2("game_name")&"</font></a>"
	rs2.close
	set rs2=nothing
	else
	s="综合新闻"
	end if
	%>
  <tr>
    <td height="24" align="center" valign="middle"><%=rs("news_id")%></td>
    <td align="left" valign="middle"><a href="/news/show_news.asp?news_id=<%=rs("news_id")%>" title="<%=rs("news_title")%>"><%=leftstr(rs("news_title"),50)%></a></td>
    <td align="center" valign="middle"><%=s%></td>
	<td align="center" valign="middle"><%if rs("f")=1 then%><font color="#FF0000">管理员</font><%else%><a href="news_list.asp?username=<%=rs("username")%>" title="该会员所有新闻信息"><%=rs("username")%></a><%end if%></td>
    <td align="center" valign="middle"><%=FormatDate(rs("date"),2)%></td>
    <td align="center" valign="middle"><a href="news_edit.asp?news_id=<%=rs("news_id")%>">修改</a></td>
    <td align="center" valign="middle"><span class="down_line">
      <input type='checkbox' name='selAnnounce' value='<%=cstr(rs("news_id"))%>' />
    </span></td>
  </tr>
     <%k=k+1
   if k>=rs.pagesize then exit do
  rs.movenext
   loop
   %>
   </form>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
  <!--DWLayoutTable-->
  <tr align="center" valign="middle">
   <td height="22" colspan="2" align="center">第<font  color="#FF0000"><%=currentpage%></font>页/共<font  color="#FF0000"><%=rs.PageCount%></font>页&nbsp;&nbsp;共有<font  color="#FF0000"><%=rs.recordcount%></font>条记录&nbsp;&nbsp;&nbsp;
          <% 'if session("cur_page")>1 then %>
	  <a href="?page=1&username=<%=request("username")%>&game_id=<%=request("game_id")%>">首页</a>　
	  <a href="?page=<%=currentpage-1%>&username=<%=request("username")%>&game_id=<%=request("game_id")%>">上一页</a>
		<% 'end if%>
		<% 'if session("cur_page")<rs.PageCount  then %>
	  <a href="?page=<%=currentpage+1%>&username=<%=request("username")%>&game_id=<%=request("game_id")%>">下一页</a>　
		<a href="?page=<%=rs.pagecount%>&username=<%=request("username")%>&game_id=<%=request("game_id")%>">末页</a>
	<% 'end if %></td>
  </tr>
</table>
<%
  rs.close
  set rs=nothing
  conn.close
  set conn=nothing
  %>
</body>
</html>
