sk_checkdatabase.asp
来自「1.支持文章」· ASP 代码 · 共 657 行 · 第 1/2 页
ASP
657 行
<%
'=====================================================================
' 软件名称:SK采集管理系统
' 当前版本:1.0
' 更新日期:2006-7-10
' 官方网站:SK娱乐网(www.skxiu.com) QQ:85103270
'=====================================================================
%>
<%
option explicit
response.buffer=true
%>
<!--#include file="inc/setup.asp"-->
<%
Dim cmsrs,Rs,Sql,SqlItem,RsItem,Action,FoundErr,Num,SuccNum,ErrNum,Frs,RSNum,Inum,ii
Dim HistrolyID,ItemID,ChannelID,ClassID,SpecialID,ArticleID,Title,CollecDate,NewsUrl,Result
Dim Arr_Histroly,Arr_ArticleID,i_Arr,Del,Flag,NewsID,DelFlag
Dim MaxPerPage,CurrentPage,AllPage,HistrolyNum,i_His,lx,radiobutton,lb,rslb
'----是否登陆
%>
<html>
<head>
<title>新闻采集系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/Admin_Style.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>
<%
Call Admin()
If IsAdmin=false then
ErrMsg="<li> 您没有登陆或不是管理员。请<a href='sk_login.asp' target='_top'>登陆</a>。"
response.Redirect("Sk_err.asp?action=AdminErr&ErrMsg="&ErrMsg&"")
response.End()
end if
'-----
SuccNum=Trim(Request("SuccNum"))
ErrNum=Trim(Request("ErrNum"))
RSNum=Trim(Request("RSNum"))
Inum=Trim(Request("INum"))
HistrolyID=Trim(Request("HistrolyID"))
DelFlag=Trim(Request("DelFlag"))
if SuccNum="" or ErrNum="" or RSNum="" or Inum="" then
SuccNum=0 : ErrNum=0 : RSNum=0 : Inum=0
end if
MaxPerPage=20
FoundErr=False
Action=Trim(Request("Action"))
lx=Request("radiobutton")
if lx="" or lx=0 then lx=1
select case Action
case "ok"
select case DelFlag
case "审核入库所选记录"
If HistrolyID="" Then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请选择要发布的记录</li>"
Else
HistrolyID=Replace(HistrolyID," ","")
if lx=1 then
Set FRS = Server.CreateObject("ADODB.RECORDSET")
FRS.Open "select * from SK_Article Where ArticleID in(" & HistrolyID & ")", Conn, 1, 3
If Not FRS.EOF Then
while not FRS.eof
InsertIntoBase 1,FRS
FRS.Delete
FRS.movenext
wend
End if
FRS.close
set FRS=nothing
end if
if lx=3 then
Set FRS = Server.CreateObject("ADODB.RECORDSET")
FRS.Open "select * from SK_photo Where ID in(" & HistrolyID & ")", Conn, 1, 3
If Not FRS.EOF Then
while not FRS.eof
InsertIntoBase_photo FRS
FRS.Delete
FRS.movenext
wend
End if
FRS.close
set FRS=nothing
end if
Call NumMsg()
End if
case "审核入库全部记录"
Response.Flush()
if lx=1 then
if RSNum=0 then RSNum=conn.execute("select count(ArticleID) from SK_Article")(0)
if rsnum<>0 then
Set FRS = conn.execute("select top 1 * from SK_Article order by ArticleID DESC")
InsertIntoBase 1,FRS
end if
end if
if lx=3 then
if RSNum=0 then RSNum=conn.execute("select count(ID) from SK_photo")(0)
if rsnum<>0 then
Set FRS = conn.execute("select top 1 * from SK_photo order by ID DESC")
InsertIntoBase_photo FRS
end if
end if
case "删除所选记录"
Response.Flush()
if HistrolyID<>"" then
if lx=1 then conn.execute("Delete From SK_Article Where ArticleID in(" & HistrolyID & ")")
if lx=3 then conn.execute("Delete From SK_photo Where ID in(" & HistrolyID & ")")
end if
response.write "<meta http-equiv=""refresh"" content=""0;url=sk_checkdatabase.asp?radiobutton="& lx &""">"
case "删除全部记录"
if lx=1 then conn.execute("Delete From SK_Article")
if lx=3 then conn.execute("Delete From sk_photo")
response.write "<meta http-equiv=""refresh"" content=""0;url=sk_checkdatabase.asp?radiobutton="& lx &""">"
end select
case "del"
Response.Flush()
if HistrolyID<>"" then
if lx=1 then conn.execute("Delete From SK_Article Where ArticleID in(" & HistrolyID & ")")
if lx=3 then conn.execute("Delete From SK_photo Where ID in(" & HistrolyID & ")")
end if
response.write "<meta http-equiv=""refresh"" content=""0;url=sk_checkdatabase.asp?radiobutton="& lx &""">"
case else
call top()
select case lx
case 1
Call Main1()
case 2
Call Main2()
case 3
Call Main3()'图片
case else
Call Main1()
end select
end select
if FoundErr=True then Call WriteErrMsg(ErrMsg)
sub NumMsg()
response.write "<script>alert('提示:本次共操作 " & SuccNum + ErrNum & " 篇文章\n其中成功入库 " & SuccNum & " 篇,重复而不允许入库 "&ErrNum & " 篇;');</script>"
response.write "<meta http-equiv=""refresh"" content=""0;url=sk_checkdatabase.asp?radiobutton="& lx &""">"
end sub
%>
<%sub top()%>
<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="tableBorder" 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="tableBorder">
<tr class="tdbg">
<td height="30" width="65"><strong>管理导航:</strong></td>
<td height="30"><a href="sk_checkDatabase.asp">管理首页</a> | 数据审核 </td>
</tr>
</table>
<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0" class="tableBorder">
<tr>
<td height=30 align="center">
选择类型:
<input name="radiobutton" type="radio" value="1" <%if lx =1 then Response.Write "checked" %> onClick="location.href='?radiobutton=1';" >
新闻采集
<input type="radio" name="radiobutton" value="3" <%if lx =3 then Response.Write "checked" %> onClick="location.href='?radiobutton=3';">
图片采集
<input type="radio" name="radiobutton" value="2" <%if lx =6 then Response.Write "checked" %> onClick="location.href='?radiobutton=2';">
自定采集
</td>
</tr>
</table>
<%end sub %>
<%
'---------文章------------------
Sub Main1
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder" >
<tr>
<td height="22" colspan="2" class="title"> <div align="center"><strong>所 有 记 录</strong></div></td>
</tr>
</table>
<!--列表-->
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder">
<form name="form1" method="POST" action="sk_checkDatabase.asp">
<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="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 SK_Article"
If Request("page")<>"" then
CurrentPage=Cint(Request("Page"))
Else
CurrentPage=1
End if
SqlItem=SqlItem & " order by ArticleID 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("ArticleID")%>" name="HistrolyID" onClick="unselectall(this.form)" style="border: 0px;background-color: #E1F4EE;"> </td>
<td width="142" align="center"> <%=left(RsItem("CopyFrom"),8)%> </td>
<td width="358" align="left"><%=RsItem("Title")%></td>
<td width="110" align="center"><%Call Admin_ShowClass_Name(RsItem("ChannelID"),RsItem("ClassID"))%></td>
<td align="center"> <%If RsItem("Passed")=True Then
Response.write "已审核"
Else
Response.Write "<font color=red>未审核</font>"
End If
%> </td>
<td width="90" align="center"> <a href="sk_checkDatabase.asp?Actionl=Del&HistrolyID=<%=RsItem("ArticleID")%>&radiobutton=<%=lx%>" 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=8 height="30">
<input name="Action" type="hidden" id="Action" value="ok">
<input name="radiobutton" type="hidden" id="Action" value="<%=lx%>">
<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=8 height="30" align=center><input name="DelFlag" type="submit" class="lostfocus" style="cursor: hand;background-color: #cccccc;" onclick='return confirm("确定要入库选中的记录吗?");' value="审核入库所选记录">
<input name="DelFlag" type="submit" class="lostfocus" style="cursor: hand;background-color: #cccccc;" onclick='return confirm("确定添加全部记录吗?");' value="审核入库全部记录">
<input name="DelFlag" type="submit" class="lostfocus" style="cursor: hand;background-color: #cccccc;" onclick='return confirm("确定要删除选中的记录吗?");' value="删除所选记录">
<input name="DelFlag" type="submit" class="lostfocus" style="cursor: hand;background-color: #cccccc;" onclick='return confirm("确定要删除所有的记录吗?");' value="删除全部记录">
</td>
</tr>
<tr class="tdbg">
<td colspan=8 height="30"> </td>
</tr>
<%Else%>
<tr class="tdbg">
<td colspan='9' 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="tableBorder" >
<tr>
<td height="22" colspan="2" class="tdbg">
<%
Response.Write ShowPage("sk_checkDatabase.asp?Action="& Action,HistrolyNum,MaxPerPage,True,True," 个记录")
%>
</td>
</tr>
</table>
<!--列表-->
</body>
</html>
<%End Sub
'---------文章------------------
%>
<%
'-------------自定------------------
Sub Main2
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder" >
<tr>
<td height="22" colspan="2" class="title"> <div align="center"><strong>所 有 记 录</strong></div></td>
</tr>
</table>
<table class="tableBorder" border="0" align="center" cellspacing="1" width="100%" cellpadding="0">
<form name="form1" method="POST" action="sk_checkDatabase.asp">
<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="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 sk_all"
If Request("page")<>"" then
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?