<%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true
%>
<!--#include file="../include/Conn.jsp"-->
<!--#include file="../Article/inc/function.jsp"-->
<!--#include file="admin_islogin.jsp"-->
<!--#include file="admin_cj.jsp"-->
<%
Dim Rs,Sql,SqlItem,RsItem,Action,FoundErr,ErrMsg
Dim HistrolyID,ItemID,ChannelID,ClassID,ArticleID,Title,CollecDate,NewsUrl,Result
Dim  Arr_Histroly,Arr_ArticleID,i_Arr,Del,Flag
Dim MaxPerPage,CurrentPage,AllPage,HistrolyNum,i_His
MaxPerPage=20
FoundErr=False
Del=Trim(Request("Del"))
Action=Trim(Request("Action"))
If Del="Del" Then
   Call DelHistroly()
End If
If FoundErr<>True Then
   Call Main()
else
   Call WriteErrMsg(ErrMsg)
End If
'关闭数据库链接
Call CloseDatabase()
Call CloseConnItem()
%>

<%Sub Main%>
<html>
<head>
<title>新闻采集系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Images/Style.css" rel="stylesheet" type="text/css">
<style type="text/css">
.ButtonList {
	BORDER-RIGHT: #000000 2px solid; BORDER-TOP: #ffffff 2px solid; BORDER-LEFT: #ffffff 2px solid; CURSOR: default; BORDER-BOTTOM: #999999 2px solid; BACKGROUND-COLOR: #e6e6e6
}
</style>
<SCRIPT language=javascript>
function unselectall(thisform)
{
    if(thisform.chkAll.checked)
	{
		thisform.chkAll.checked = thisform.chkAll.checked&0;
    } 	
}

function CheckAll(thisform)
{
	for (var i=0;i<thisform.elements.length;i++)
    {
	var e = thisform.elements[i];
	if (e.Name != "chkAll"&&e.disabled!=true)
		e.checked = thisform.chkAll.checked;
    }
}
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table cellpadding="0" cellspacing="1" border="0" width="100%" class="border" align=center>
  <tr class="topbg">
	<td height="22" colspan="2" align="center"><strong>已 采 数 据 审 核</strong></td>
  </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
  <tr class="tdbg"> 
    <td height="30" width="65"><strong>管理导航：</strong></td>  
    <td height="30"><a href="Admin_checkDatabase.jsp">管理首页</a>&nbsp;&nbsp;|&nbsp;&nbsp;数据审核</td>     
  </tr>         
</table>    
<br>   
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >
    <tr> 
      <td height="22" colspan="2" class="title"> <div align="center"><strong>所 有 记 录</strong></div></td>
    </tr>
</table>
  
<table class="border" border="0" cellspacing="1" width="100%" cellpadding="0">
  <form name="form1" method="POST" action="Admin_checkDatabase.jsp">
    <tr class="tdbg" style="padding: 0px 2px;"> 
      <td width="57" height="22" align="center" class=ButtonList>选择</td>
      <td width="142" align="center" class=ButtonList>文章来源</td>
      <td width="358" align="center" class=ButtonList>新闻标题</td>
      <td width="132" height="22" align="center" class=ButtonList>频道</td>
      <td width="110" height="22" align="center" class=ButtonList>栏目</td>
      <td width="120" align="center" class=ButtonList>审核结果</td>
      <td width="90" height="22" align="center" class=ButtonList>操作</td>
    </tr>
    <%                          
Set RsItem=server.createobject("adodb.recordset")         
SqlItem="select * from T_Article"

If Request("page")<>"" then
    CurrentPage=Cint(Request("Page"))
Else
    CurrentPage=1
End if 
SqlItem=SqlItem  &  " order by F_ID DESC"
RsItem.open SqlItem,Conn,1,1
If (Not RsItem.Eof) and (Not RsItem.Bof) then
   RsItem.PageSize=MaxPerPage
   Allpage=RsItem.PageCount
   If Currentpage>Allpage Then Currentpage=1
   HistrolyNum=RsItem.RecordCount
   RsItem.MoveFirst
   RsItem.AbsolutePage=CurrentPage
   i_His=0
   Do While not RsItem.Eof
%>
    <tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#cccccc'" style="padding: 0px 2px;"> 
      <td width="57" align="center"> <input type="checkbox" value="<%=RsItem("F_ID")%>" name="HistrolyID" onClick="unselectall(this.form)" style="border: 0px;background-color: #E1F4EE;"> 
      </td>
      <td width="142" align="center"> <%=RsItem("F_ComeFrom")%> </td>
      <td width="358" align="left"><%=RsItem("F_Title")%></td>
      <td width="132" align="center"><%Call Admin_ShowChannel_Name(RsItem("F_BigCategoryID"))%></td>
      <td width="110" align="center"><%Call Admin_ShowClass_Name(RsItem("F_BigCategoryID"),RsItem("F_SmallCategoryID"))%></td>
      <td align="center"> <%If RsItem("F_IsAuditing")=1 Then
           Response.write "已审核"
        Else
		   Response.Write "<font color=red>未审核</font>"
        End If
      %> </td>
      <td width="90" align="center"> <a href="Admin_checkDatabase.jsp?Action=<%=Action%>&Del=Del&HistrolyID=<%=RsItem("F_ID")%>" onclick='return confirm("确定要删除此记录吗？");'>删除</a> 
      </td>
    </tr>
    <%         
           i_His=i_His+1
           If i_His > MaxPerPage Then
              Exit Do
           End If
        RsItem.Movenext         
   Loop         
%>
    <tr class="tdbg"> 
      <td colspan=7 height="30"> <input name="Del" type="hidden" id="Del" value="Del"> 
        <input name="Action" type="hidden" id="Action" value="<%=Action%>"> 
        <input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox" style="border: 0px;background-color: #E1F4EE;">
        全选 </td>
    </tr>
    <tr class="tdbg"> 
      <td colspan=7 height="30" align=center> <input type="submit" value="审核所选记录" name="DelFlag" onclick='return confirm("确定发布选中的记录吗？");' style="cursor: hand;background-color: #cccccc;"> 
        &nbsp;&nbsp; <input type="submit" value="审核全部记录" name="DelFlag" onclick='return confirm("确定添加全部记录吗？");' style="cursor: hand;background-color: #cccccc;"> 
        &nbsp;&nbsp; <input type="submit" value="删除所选记录" name="DelFlag"  onclick='return confirm("确定要删除选中的记录吗？");' style="cursor: hand;background-color: #cccccc;"> 
        &nbsp;&nbsp; <input type="submit" value="删除全部未审核记录" name="DelFlag" onclick='return confirm("确定要删除所有未审核的记录吗？");' style="cursor: hand;background-color: #cccccc;">
		&nbsp;&nbsp; <input type="submit" value="删除全部记录" name="DelFlag" onclick='return confirm("确定要删除所有的记录吗？");' style="cursor: hand;background-color: #cccccc;">
      </td>
    </tr>
    <tr class="tdbg"> 
      <td colspan=7 height="30"> </td>
    </tr>
    <%Else%>
    <tr class="tdbg"> 
      <td colspan='8' class="tdbg" align="center"><br>
        系统中暂无历史记录！</td>
    </tr>
    <%End  If%>
    <%         
RsItem.Close         
Set RsItem=nothing           
%>
  </form>
</table>  
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >
    <tr> 
      <td height="22" colspan="2" class="tdbg">
<%
Response.Write ShowPage("Admin_checkDatabase.jsp?Action="& Action,HistrolyNum,MaxPerPage,True,True," 个记录")
%>

      </td>
    </tr>
</table>
           
</body>         
</html>
<%End Sub%>
<%Sub DelHistroly
Dim DelFlag
DelFlag=Trim(Request("DelFlag"))
HistrolyID=Trim(Request("HistrolyID"))
If HistrolyID<>"" Then
   HistrolyID=Replace(HistrolyID," ","")
End If

If DelFlag="审核所选记录" Then
   If HistrolyID="" Then
      FoundErr=True
      ErrMsg=ErrMsg & "<br><li>请选择要发布的记录</li>"
   Else
      HistrolyID=Replace(HistrolyID," ","")
      SqlItem="update T_Article set F_IsAuditing=1 Where F_ID in(" & HistrolyID & ")"
   End If
ElseIf DelFlag="审核全部记录" Then
	HistrolyID=1
   SqlItem="update T_Article set F_IsAuditing=1"
ElseIf DelFlag="删除所选记录" Then
   SqlItem="Delete From T_Article Where F_ID in(" & HistrolyID & ")"
ElseIf DelFlag="删除全部未审核记录" Then
	HistrolyID=1
   SqlItem="Delete From T_Article where F_IsAuditing=0"
elseif DelFlag="删除全部记录" then
	HistrolyID=1
   SqlItem="Delete From T_Article"
else
   SqlItem="Delete From T_Article where F_ID=" & HistrolyID
End if
If FoundErr<>True and HistrolyID<>"" Then
   Conn.Execute(SqlItem)
End If
End Sub
%>
