www.gusucode.com > 全球营销软件站整站源码4月最新数据 4.0源码程序 > 801wyxqf\adminadmin\soft\admin_log.asp

    <!--#include file="const.asp"-->
<!--#include file="../inc/cls_xmlhttp.asp"-->
<%
Server.ScriptTimeout = 99999
Admin_header
'=====================================================================
' 软件名称:801w软件代理系统
' 当前版本:801wAsp 801w cn 801w com
' 文件名称:admin_main.asp
' 更新日期:2010-2-16
' 官方网站:801w代理系统(www.801w.cn www.801w.com) QQ:274667447
'=====================================================================
' Copyright 2003-2010 801w.cn - All Rights Reserved.
' 801wasp is a trademark of 801w.cn
'=====================================================================
Dim Action,isEdit,id,ItemID,classid,isORDER
isEdit = False
isORDER = False

If Not ChkAdmin("Collection_"&ChannelID) Then
	Call Transfer_error()
End If

id = Newasp.ChkNumeric(Request("id"))
ItemID = Newasp.ChkNumeric(Request("ItemID"))
ChannelID = Newasp.ChkNumeric(Request("ChannelID"))
If ChannelID = 0 Then ChannelID = 2
If Not IsObject(CJ_Conn) Then CJ_ConnectionDatabase
%>
<table class="table1" cellspacing="1" cellpadding="3" align="center" border="0">
	<tr>
		<td class="tableline linetitle" width="200" align="left"><%=NewAsp.ModuleName%>采集管理</td>
		<td class="tableline" width="*" align="right"><a href="admin_collection.asp?ChannelID=<%=ChannelID%>">管理首页</a>
			 - <a href="admin_collection.asp?ChannelID=<%=ChannelID%>&action=setting"><font color="red">采集基本设置</font></a>
			 - <a href="admin_log.asp?ChannelID=<%=ChannelID%>">采集日志</a>
			 - <a href="admin_makehtml.asp?ChannelID=<%=ChannelID%>">生成HTML</a>
			 - <a href="admin_list.asp?ChannelID=<%=ChannelID%>"><%=NewAsp.ModuleName%>管理</a>
			 - <a href="../sys/admin_channel.asp?action=edit&ChannelID=<%=ChannelID%>">频道设置</a>
			 - <a href="../sys/admin_class.asp?ChannelID=<%=ChannelID%>">分类管理</a>
			 - <a href="../sys/admin_template.asp">模板管理</a>
		</td>
	</tr>
</table>
<form method="post" action="admin_log.asp">
<table border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<tr>
	<th colspan="2">采集日志列表管理</th>
</tr>
	<tr>
	<td class="tablerow2"><b>搜索URL:</b><input type="text" name="keyword" size="50">
	<input type="hidden" name="ChannelID" value="<%=ChannelID%>"/>
	<input type="hidden" name="ItemID" value="<%=ItemID%>"/>
	<input type="submit" value="开始搜索"/></td>
</tr>
<tr>
	<td class="tablerow1"><b>操作选项:</b><a href="admin_log.asp?ChannelID=<%=ChannelID%>&ItemID=<%=ItemID%>">管理首页</a> - 
	<a href="admin_collection.asp?ChannelID=<%=ChannelID%>">采集首页</a> - 
	<a href="?action=add&ChannelID=<%=ChannelID%>&ItemID=<%=ItemID%>">添加采集URL</a>
	<%If ItemID>0 Then%> - <a href="admin_collection.asp?action=edit&ChannelID=<%=ChannelID%>&ItemID=<%=ItemID%>">编辑采集项目</a><%End If%>
	</td>
</tr>
</table>
</form>
<%
If Not IsObject(CJ_Conn) Then DatabaseConnection
Action = LCase(Request("action"))
Select Case Trim(Action)
Case "del"
	Call delGatherlog
Case "save"
	Call saveGatherlog
Case "add"
	Call editGatherlog
Case "edit"
	isEdit = True
	Call editGatherlog
Case Else
	Call showmain
End Select
If FoundErr = True Then
	ReturnError(ErrMsg)
End If
Admin_footer

Sub showmain()
	Dim Rs,SQL,iCount,lCount
	iCount=2:lCount=2
	If Not IsEmpty(Request("sid")) Then
		Select Case NewAsp.CheckStr(Request("act"))
		Case "批量删除":Call delGatherlog
		Case "批量锁定":Call IslockUrl
		Case "取消锁定":Call UnlockUrl
		Case "已采集状态":Call IsRecords
		Case "未采集状态":Call NoRecords
		Case "批量采集":isORDER=True:Call BeginGather
		Case "倒序采集":Call BeginGather
		Case "更新时间":Call upindate
		End Select
		Exit Sub
	End If
	
	Dim maxperpage,pagenow,Pcount,totalrec,totalnumber,pagelinks,strLink,i,tablestyle,keyword,ii,m_star
	maxperpage = 50
	totalrec = 0
	Pcount = 1
	pagenow = Newasp.ChkNumeric(Request("page"))
	keyword = Newasp.CheckStr(Trim(Request("keyword")))
	pagelinks = "?ChannelID="&ChannelID&"&ItemID=" & ItemID & "&keyword=" & keyword&"&"
	
%>
<table id="tablehovered" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<tr>
	<th width="5%" nowrap>选择</th><th width="5%" nowrap> 软件 ID </th><th width="30%">标题</th><th width="32%">URL</th><th width="15%" nowrap>采集时间</th><th width="8%" nowrap> 推荐星级 </th><th width="5%" nowrap> 采集状态 </th>
</tr>
<tr>
	<td class="tablerow1" colspan="7" align="left" id="showNextPage">&nbsp;</td>
</tr>
<form name="selform" method="post" action="">
<input type="hidden" name="ChannelID" value="<%=ChannelID%>"/>
<input type="hidden" name="ItemID" value="<%=ItemID%>"/>
<%
	If Len(keyword) > 1 Then
		SQL = "SELECT * FROM [NC_Softlog] WHERE ChannelID=" & ChannelID & " And (url like '%" & keyword & "%' Or title like '%" & keyword & "%') ORDER BY addtime DESC, id DESC"
		totalrec = cmHttp.Execute("SELECT COUNT(id) FROM [NC_Softlog] WHERE ChannelID=" & ChannelID & " And (url like '%" & keyword & "%' Or title like '%" & keyword & "%')")(0)
	Else
		If ItemID > 0 Then
			SQL = "SELECT * FROM [NC_Softlog] WHERE ChannelID=" & ChannelID & " And ItemID=" & ItemID & " ORDER BY addtime DESC, id DESC"
			totalrec = cmHttp.Execute("SELECT COUNT(id) FROM [NC_Softlog] WHERE ChannelID=" & ChannelID & " And ItemID=" & ItemID)(0)
		Else
			SQL = "SELECT * FROM [NC_Softlog] WHERE ChannelID=" & ChannelID & " ORDER BY addtime DESC, id DESC"
			totalrec = cmHttp.Execute("SELECT COUNT(id) FROM [NC_Softlog] WHERE ChannelID=" & ChannelID & "")(0)
		End If
	End If
	Pcount = CLng(totalrec / maxperpage)  '得到总页数
	If Pcount < totalrec / maxperpage Then Pcount = Pcount + 1
	If pagenow < 1 Then pagenow = 1
	If pagenow > Pcount Then pagenow = Pcount
	If pagenow = 0 Then pagenow = 1
	
	Set Rs=NewAsp.CreateAXObject("ADODB.Recordset")
	Rs.Open SQL, CJ_Conn, 1,1
	If Not (Rs.BOF And Rs.EOF) Then
		If Pcount > 1 then Rs.Move (pagenow - 1) * maxperpage
		'Rs.MoveFirst
		i = 0
		Do While Not Rs.EOF And i < maxperpage
			If Not Response.IsClientConnected Then ResponseEnd
			If (i mod 2) = 0 Then
				iCount=2:lCount=1
			Else
				iCount=1:lCount=2
			End If
%>
<tr>
	<td class="tablerow<%=iCount%> hovered" align="center"><input type="checkbox" name="sid" value="<%=Rs(0)%>"></td>
	<td class="tablerow<%=iCount%> hovered" align="center" title="点击这里编辑URL"><a href="?action=edit&channelid=<%=ChannelID%>&id=<%=Rs(0)%>&ItemID=<%=Rs("ItemID")%>"><%=Rs("softid")%></a></td>
	<td class="tablerow<%=iCount%> hovered" title="<%=Rs("title")%>">&nbsp;<a href="?action=edit&channelid=<%=ChannelID%>&id=<%=Rs(0)%>&ItemID=<%=Rs("ItemID")%>"><%=cmHttp.GotTopic(Rs("title"),26)%></a></td>
	<td class="tablerow<%=iCount%> hovered" title="<%=Rs("url")%>"><a href="javascript:" onclick="window.open('<%=Rs("url")%>')"><%=Left(Rs("url"),40)%></a></td>
	<td class="tablerow<%=iCount%> hovered" align="center" noWrap><%=showDateTime(Rs("addtime"),"yyyy-MM-dd hh:mm:ss")%></td>
	<td class="tablerow<%=iCount%> hovered" align="center" nowrap><%
	If Rs("star") > 0 Then
		Response.Write "<font color=""red"">"
		For ii=1 To Rs("star")
			Response.Write "★"
		Next
		Response.Write "</font>"
		If Rs("star") < 5 Then
			Response.Write "<font color=""#dddddd"">"
			Response.Write String(5 - Rs("star"), "★")
			Response.Write "</font>"
		End If
	Else
		Response.Write "<font color=""#dddddd"">★★★★★</font>"
	End If
	%></td>
	<td class="tablerow<%=iCount%> hovered" align="center"><a href="?act=批量采集&ChannelID=<%=ChannelID%>&ItemID=<%=ItemID%>&sid=<%=Rs(0)%>" title="点击此处开始采集"><%
	If Rs("islock") = 0 Then
		If Rs("records") = 0 Then
			Response.Write "未采集"
		Else
			Response.Write "<font color=""green"">已采集</font>"
		End If
	Else
		Response.Write "<font color=""red"">已锁定</font>"
	End If
	%></a></td>
</tr>
<%
			Rs.movenext
			i = i + 1
			If i >= maxperpage Then Exit Do
		Loop
	End If
	Rs.Close:Set Rs = Nothing

%>
<tr>
	<td colspan="7" class="tablerow<%=lCount%>" nowrap><input class="Button" type="button" name="chkall" value="全选" onClick="CheckAll(this.form)"><input class="Button" type="button" name="chksel" value="反选" onClick="ContraSel(this.form)">
	<select name="act">
		<option value="0">请选择操作选项</option>
		<option value="批量采集">批量采集</option>
		<option value="倒序采集">倒序采集</option>
		<option value="批量删除">批量删除</option>
		<option value="批量锁定">批量锁定</option>
		<option value="取消锁定">取消锁定</option>
		<option value="已采集状态">已采集状态</option>
		<option value="未采集状态">未采集状态</option>
		<option value="更新时间">更新时间</option>
	  </select>
	<input class="button" type="submit" name="Submit2" value="执行操作" onclick="return confirm('您确定要执行已选择的操作吗?');">
	</td></form>
</tr>
<tr>
	<td colspan="7" id="NextPageText" class="tablerow<%=iCount%>">
	<var class="morePage"><%=showlistpage(pagenow,Pcount,maxperpage,totalrec,pagelinks)%></var></td>
</tr>
</table>
<script type="text/javascript">
document.getElementById("showNextPage").innerHTML = document.getElementById("NextPageText").innerHTML;
</script>
<%
End Sub

Sub editGatherlog()
	Dim m_intPlugin,Rs
	If isEdit Then
		Set Rs = cmHttp.Execute("SELECT * FROM [NC_Softlog] WHERE id=" & id)
		If Rs.BOF And Rs.EOF Then
			Founderr = True
			ErrMsg = "<li>错误的系统参数</li>"
			Set Rs = Nothing
			Exit Sub
		End If
		classid = Rs("classid")
		m_intPlugin = Rs("plugin")
	Else
		classid = 0
		m_intPlugin = 0
	End If
%>
<table border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<tr>
	<th colspan="2"><%=Newasp.ChannelName%> - 采集日志添加/编辑</th>
</tr>
<form method="post" action="?action=save">
<%
If isEdit Then
	Response.Write "<input type=""hidden"" name=""id"" value="""&Rs("id")&"""/>" & vbCrLf
Else
	Response.Write "<input type=""hidden"" name=""id"" value=""0""/>" & vbCrLf
End If
%><input type="hidden" name="ChannelID" value="<%=ChannelID%>"/>
<tr>
	<td class="tablerow1" align="right"><u>采集项目ID</u>:</td>
	<td class="tablerow1"><input type="text" name="ItemID" size="10" value="<%
	If isEdit Then
		Response.Write Rs("ItemID")
	Else
		Response.Write ItemID
	End If
	%>">* 请注意,如果不明白就不要改</td>
</tr>
<tr>
	<td width="25%" class="tablerow2" align="right"><u>软件ID</u>:</td>
	<td width="75%" class="tablerow2"><input type="text" name="softid" size="10" value="<%
	If isEdit Then
		Response.Write Rs("softid")
	Else
		Response.Write 0
	End If
	%>"></td>
</tr>
<tr>
	<td class="tablerow1" align="right"><u>所属分类</u>:</td>
	<td class="tablerow1"><%
	Call selectClasslist(ChannelID,classid)
%></td>
</tr>
<tr>
	<td class="tablerow2" align="right"><u>标题</u>:</td>
	<td class="tablerow2"><input type="text" name="title" size="70" value="<%
	If isEdit Then Response.Write Server.HTMLEncode(Rs("title") & "")
	%>"></td>
</tr>
<tr>
	<td class="tablerow1" align="right"><u>远程URL</u>:</td>
	<td class="tablerow1"><input type="text" name="url" size="70" value="<%
	If isEdit Then Response.Write Server.HTMLEncode(Rs("url") & "")
	%>"> <%
	If isEdit Then
		Response.Write "<a href=""javascript:"" onclick=""window.open('" & Rs("url") & "')"">-=>></a>"
	End If
	%></td>
</tr>
<tr>
	<td class="tablerow2" align="right"><u>推荐星级</u>:</td>
	<td class="tablerow2"><select name="star">
		<option value="0">系统默认设置</option>
		<%If isEdit Then%>
			<option value="5"<%If Rs("star") = 5 Then Response.Write (" selected")%>>★★★★★</option>
			<option value="4"<%If Rs("star") = 4 Then Response.Write (" selected")%>>★★★★</option>
			<option value="3"<%If Rs("star") = 3 Then Response.Write (" selected")%>>★★★</option>
			<option value="2"<%If Rs("star") = 2 Then Response.Write (" selected")%>>★★</option>
			<option value="1"<%If Rs("star") = 1 Then Response.Write (" selected")%>>★</option>
		<%Else%>
			<option value="5">★★★★★</option>
			<option value="4">★★★★</option>
			<option value="3">★★★</option>
			<option value="2">★★</option>
			<option value="1">★</option>
		<%End If%>
          </select></td>
</tr>
<tr>
	<td class="tablerow1" align="right"><u>插件情况</u>:</td>
	<td class="tablerow1"><select name="plugin">
	  	<option value="0"<%If m_intPlugin = 0 Then Response.Write (" selected")%>>↓插件使用情况↓</option>
	  	<option value="1"<%If m_intPlugin = 1 Then Response.Write (" selected")%>>无插件-无病毒</option>
	  	<option value="2"<%If m_intPlugin = 2 Then Response.Write (" selected")%>>有插件-可选择</option>
		<option value="3"<%If m_intPlugin = 3 Then Response.Write (" selected")%>>凝有毒-未确认</option>
		<option value="4"<%If m_intPlugin = 4 Then Response.Write (" selected")%>>有插件-无选择</option>
		<option value="5"<%If m_intPlugin = 5 Then Response.Write (" selected")%>>有病毒-已确认</option>
		<option value="6"<%If m_intPlugin = 6 Then Response.Write (" selected")%>>尚未认证</option>
		<option value="7"<%If m_intPlugin = 7 Then Response.Write (" selected")%>>未通过-暂停下载</option>
	  </select></td>
</tr>
<tr>
	<td class="tablerow2" align="right"><u>采集状态</u>:</td>
	<td class="tablerow2">
		<input type="radio" name="records" value="0"<%If isEdit Then 
			If Rs("records")=0 Then Response.Write " checked"
		Else
			Response.Write " checked"
		End If
		%>/> 未采集&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="radio" name="records" value="1"<%If isEdit Then If Rs("records")=1 Then Response.Write " checked"%>/> 已采集
	</td>
</tr>
<tr>
	<td class="tablerow1" align="right"><u>锁定URL</u>:</td>
	<td class="tablerow1">
		<input type="radio" name="islock" value="0"<%If isEdit Then 
			If Rs("islock")=0 Then Response.Write " checked"
		Else
			Response.Write " checked"
		End If%>/> 否&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="radio" name="islock" value="1"<%If isEdit Then If Rs("islock")=1 Then Response.Write " checked"%>/> 是
	 注意:如果锁定URL,采集时将会跳过</td>
</tr>
<tr>
	<td class="tablerow2" align="right"><u>采集时间</u>:</td>
	<td class="tablerow2"><input type="text" name="addtime" size="30" value="<%If isEdit Then Response.Write Rs("addtime") Else Response.Write Now()%>">
		<input type="checkbox" name="update" value="1"/> 更新时间
	</td>
</tr>
<tr>
	<td class="tablerow1" align="right">&nbsp;</td>
	<td class="tablerow1"><input type="submit" name="submit2" value="保存数据" /></td>
</tr>
</form>
</table>
<%
	If isEdit Then
		Set Rs = Nothing
	End If
End Sub

Sub saveGatherlog()
	Succeed("<li>恭喜您!保存数据成功。</li>")
End Sub

Sub delGatherlog()
	cmHttp.Execute("DELETE FROM [NC_Softlog] WHERE id in(" & Replace(Request("sid"), "'", "") & ")")
	Succeed("<li>恭喜您!删除URL成功。</li>")
End Sub

Sub IslockUrl()
	cmHttp.Execute ("UPDATE [NC_Softlog] SET islock=1 WHERE id in(" & Replace(Request("sid"), "'", "") & ")")
	Succeed("<li>恭喜您!锁定URL成功。</li>")
End Sub

Sub UnlockUrl()
	cmHttp.Execute ("UPDATE [NC_Softlog] SET islock=0 WHERE id in(" & Replace(Request("sid"), "'", "") & ")")
	Succeed("<li>恭喜您!解除锁定URL成功。</li>")
End Sub

Sub IsRecords()
	cmHttp.Execute ("UPDATE [NC_Softlog] SET records=1 WHERE id in(" & Replace(Request("sid"), "'", "") & ")")
	Succeed("<li>恭喜您!设置成功。</li>")
End Sub

Sub NoRecords()
	cmHttp.Execute ("UPDATE [NC_Softlog] SET records=0 WHERE id in(" & Replace(Request("sid"), "'", "") & ")")
	Succeed("<li>恭喜您!设置成功。</li>")
End Sub

Sub upindate()
	cmHttp.Execute ("UPDATE [NC_Softlog] SET addtime=Now() WHERE id in(" & Replace(Request("sid"), "'", "") & ")")
	Succeed("<li>恭喜您!批量更新时间成功。</li>")
End Sub

Sub BeginGather()
	Call Transfer_error()
End Sub

Function FormatShowTime(ByVal datime)
	If Not IsDate(datime) Then Exit Function
	Dim strTemp
	
	If Datediff("d",Now(),CDate(datime)) = 0 Then
		strTemp = "<font color=""red"">"
		strTemp = strTemp & datime
		strTemp = strTemp & "</font>"
	Else
		strTemp = datime
	End If
	FormatShowTime = strTemp
End Function

%>