<% Option Explicit %>
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="../../Inc/Cls_DB.asp" -->
<%
Dim DBC,Conn
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
'==============================================================================
'软件名称：风讯网站信息管理系统
'当前版本：Foosun Content Manager System 2.0 
'最新更新：2004.12
'==============================================================================
'商业注册联系：028-85098980-601,602 技术支持：028-85098980-606、607,客户支持：608
'产品咨询QQ：159410,655071,66252421
'技术支持:所有程序使用问题，请提问到bbs.foosun.net我们将及时回答您
'程序开发：风讯开发组 & 风讯插件开发组
'论坛支持：风讯在线论坛(http://bbs.foosun.net)
'官方网站：www.Foosun.net  演示站点：test.cooin.com    
'网站建设专区：www.cooin.com
'==============================================================================
'免费版本请在新闻首页保留版权信息，并做上本站LOGO友情连接
'==============================================================================
%>
<!--#include file="../../Inc/Session.asp" -->
<!--#include file="../../Inc/CheckPopedom.asp" -->
<%
if Not JudgePopedomTF(Session("Name"),"P0112") then Call ReturnError1()
    Dim NewsID,RsReviewObj,RsNewsObj,SunNumAsp,sql,isn
	If Request("NewsID")<>"" then
	   NewsID = Cstr(Request("NewsID"))
	   isn="where NewsID='"&NewsID&"'"
	 else
		isn=""
	end if
	   	Sql = "Select ID,title,NewsID,Content,UserID,AddTime from Review  "&isn&" order by NewsID,AddTime desc"
		Set RsReviewObj = Server.CreateObject("ADODB.RecordSet")
		RsReviewObj.Open Sql,Conn,3,3
	   SunNumAsp = RsReviewObj.RecordCount
%>
<html>
<head>
<link href="../../css/css.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添加新闻到专题</title>
</head>

<body>

  
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  <form name="RForm" method="post" action="">
    <tr> 
      <td width="4%" height="5"><strong> 
        <input type="checkbox" name="chkall" onClick="CheckAll(this.form)">
        </strong></td>
      <td width="51%" height="5"><strong>内容 
        <input name="Newsid" type="hidden" id="Newsid" value="<%=request("Newsid")%>">
        </strong></td>
      <td width="14%" height="5"><strong>发布人</strong></td>
      <td width="13%"><strong>发布时间</strong></td>
      <td width="18%"><strong>所属新闻</strong></td>
    </tr>
     <tr>
      <td colspan="5" align="center"><hr size="1" noshade></td>
    </tr><%if  RsReviewObj.Bof And RsReviewObj.Eof then%>
   
    <tr> 
      <td colspan="5" align="center"><font color="red">暂时没有记录</font></td>
    </tr>
    <% else
if not  RsReviewObj.Bof And not RsReviewObj.Eof  then 
	Dim page_size,page_no,page_total,record_all
	page_size=12
	page_no=request.querystring("page_no")
    if page_no<=1 or page_no="" then page_no=1
	If Request.QueryString("page_no")="" then
		page_no=1
	end if
	RsReviewObj.PageSize=page_size
	page_total=RsReviewObj.PageCount
	if (cint(page_no)>page_total) then page_no=page_total
	RsReviewObj.AbsolutePage=cint(page_no)
	record_all=RsReviewObj.RecordCount
	Dim i
  	for i=1 to RsReviewObj.PageSize
    	if RsReviewObj.eof then exit for
%>
    <tr> 
      <td> <input name="id" type="checkbox" id="id" value="<%=RsReviewObj("id")%>"></td>
      <td><%=left(RsReviewObj("Content"),50)%></td>
      <td><%=RsReviewObj("UserID")%></td>
      <td><%=RsReviewObj("Addtime")%></td>
      <td> <%
Set RsNewsObj = Conn.Execute("Select TiTle from News where NewsID = '"&RsReviewObj("NewsID")&"'")
response.Write(""&left(RsNewsObj("TiTle"),10)&"")
%></td>
    </tr>
    <%
	  RsReviewObj.movenext
next
  RsReviewObj.close
  set RsReviewObj=nothing
end if
end if
%>
    <tr> 
      <td colspan="5"><div align="right"><strong> 
          <%
if page_total=1 then
		response.Write "&nbsp;<img src=../images/First1.gif border=0 alt=首页></img>&nbsp;"
		response.Write "&nbsp;<img src=../images/prePage.gif border=0 alt=上一页></img>&nbsp;"
		response.Write "&nbsp;<img src=../images/nextPage.gif border=0 alt=下一页></img>&nbsp;"
		response.Write "&nbsp;<img src=../images/endPage.gif border=0 alt=尾页></img>&nbsp;"
else
	if cint(page_no)<>1 and cint(page_no)<>page_total then
		response.Write "&nbsp;<a href=?page_no=1&Newsid="&request("Newsid")&"><img src=../images/First1.gif border=0 alt=首页></img></a>&nbsp;"
		response.Write "&nbsp;<a href=?page_no="&cstr(cint(page_no)-1)&"&Newsid="&request("Newsid")&"><img src=../images/prePage.gif border=0 alt=上一页></img></a>&nbsp;"
		response.Write "&nbsp;<a href=?page_no="&cstr(cint(page_no)+1)&"&Newsid="&request("Newsid")&"><img src=../images/nextPage.gif border=0 alt=下一页></img></a>&nbsp;"
		response.Write "&nbsp;<a href=?page_no="& page_total &"&Newsid="&request("Newsid")&"><img src=../images/endPage.gif border=0 alt=尾页></img></a>&nbsp;"
	elseif cint(page_no)=1 then
		response.Write "&nbsp;<img src=../images/First1.gif border=0 alt=首页></img></a>&nbsp;"
		response.Write "&nbsp;<img src=../images/prePage.gif border=0 alt=上一页></img>&nbsp;"
		response.Write "&nbsp;<a href=?page_no="&cstr(cint(page_no)+1)&"&Newsid="&request("Newsid")&"><img src=../images/nextPage.gif border=0 alt=下一页></img></a>&nbsp;"
		response.Write "&nbsp;<a href=?page_no="& page_total &"&Newsid="&request("Newsid")&"><img src=../images/endpage.gif border=0 alt=尾页></img></a>&nbsp;"
	else
		response.Write "&nbsp;<a href=?page_no=1&Newsid="&request("Newsid")&"><img src=../images/First1.gif border=0 alt=首页></img></a>&nbsp;"
		response.Write "&nbsp;<a href=?page_no="&cstr(cint(page_no)-1)&"&Newsid="&request("Newsid")&"><img src=../images/prePage.gif border=0 alt=上一页></img></a>&nbsp;"
		response.Write "&nbsp;<img src=../images/nextPage.gif border=0 alt=下一页></img></a>&nbsp;"
		response.Write "&nbsp;<img src=../images/endpage.gif border=0 alt=尾页></img>&nbsp;"
	end if
end if
%>
          　　 
          <input name="action" type="hidden" id="action" value="del">
          <input type="submit" name="Submit" value="删除选中">
          <input type="button" name="Submit2" value="关闭窗口" onClick="javascript:window.close()">
          </strong></div></td>
    </tr>
  </form>
</table>

</body>
</html>
<%
if request.Form("action")="del" then
dim num,rs,sql1
Num=request.form("ID").count
      for i=1 to Num
      set rs=Server.CreateObject("adodb.Recordset")
      sql1="Select * from Review  where ID="&request.form("ID")(i)
      rs.open sql1,conn,1,1
      conn.execute("Delete From Review Where ID="&request.form("ID")(i))
    next
	response.Redirect("?newsid="&Request.Form("Newsid")&"")
end if
%>
<script language="JavaScript" type="text/JavaScript">
function CheckAll(form)
{
for (var i=0;i<RForm.elements.length;i++)
{
var e = RForm.elements[i];
if (e.name != 'chkall')
e.checked = RForm.chkall.checked;
}
}
function CheckAll1(form)
{
for (var i=0;i<RForm.elements.length;i++)
{
var e = RForm.elements[i];
if (e.name != 'chkall1')
e.checked = RForm.chkall1.check;
}
}
function modify(){if(confirm("您确定要修改?")){return true;}return false;}
</script>


