<% Option Explicit %>
<!--#include file="inc/Cls_DB.asp" -->
<!--#include file="../../Inc/Const.asp" -->
<%
'==============================================================================
'软件名称：风讯新闻采集系统V1.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友情连接
'==============================================================================
Dim DBC,Conn,CollectConn
Set DBC = New DataBaseClass
Set CollectConn = DBC.OpenConnection()
DBC.ConnStr = "DBQ=" + Server.MapPath(DataBaseConnectStr) + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
'判断权限
%>
<!--#include file="../../Inc/Session.asp" -->
<!--#include file="../../Inc/CheckPopedom.asp" -->
<%
if Not JudgePopedomTF(Session("Name"),"P1401") then Call ReturnError1()
'判断权限结束
Dim RsEditObj,EditSql,SiteID
Set RsEditObj = Server.CreateObject ("ADODB.RecordSet")
SiteID = Request("SiteID")
if SiteID <> "" then
	EditSql="Select * from Site where ID=" & SiteID
	RsEditObj.Open EditSql,CollectConn,1,3
	if RsEditObj.Eof then
		Response.write"<script>alert(""没有修改的站点"");location.href=""javascript:history.back()"";</script>"
		Response.end
	end if
else
	Response.write"<script>alert(""没有修改的站点"");location.href=""javascript:history.back()"";</script>"
	Response.end
end if

Dim ClassList,RsClassObj
Set RsClassObj = Server.CreateObject("Adodb.RecordSet")
RsClassObj.Source = "Select ClassID,ClassCName from NewsClass order by id desc"
RsClassObj.open RsClassObj.Source,Conn,1,3
do while Not RsClassObj.Eof
	if RsClassObj("ClassID") = RsEditObj("SysClass") then
		ClassList = ClassList & "<option selected value=" & RsClassObj("ClassID") & "" & ">" & RsClassObj("ClassCName") & "</option><br>"
	else
		ClassList = ClassList & "<option value=" & RsClassObj("ClassID") & "" & ">" & RsClassObj("ClassCName") & "</option><br>"
	end if
	RsClassObj.MoveNext	
loop
RsClassObj.Close
Set RsClassObj = Nothing
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>自动新闻采集—站点设置</title>
</head>
<link href="Inc/Collect.css" rel="stylesheet">
<body leftmargin="0" topmargin="0">
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#cccccc">
  <form name="form1" method="post" action="SiteTwoStep.asp">
    <tr bgcolor="#E4E4E4"> 
      <td height="30" colspan="4" background="images/Collect_bg.gif"><font color="#FF0000"><strong>站点属性修改---第一步</strong></font></td>
    </tr>
    <tr bgcolor="#F3F3F3"> 
      <td width="20%" bgcolor="#F3F3F3"> <div align="right"> 
          <input name="SiteID" type="hidden" id="SiteID" value="<% = SiteID %>">
          <input name="Result" type="hidden" id="Result" value="Edit">
          采集站点名称</div></td>
      <td colspan="3"> <input name="SiteName" style="width:100%;" type="text" id="SiteName" value="<%=RsEditObj("sitename")%>"> 
        <div align="right"> </div></td>
    </tr>
    <tr bgcolor="#F3F3F3"> 
      <td><div align="right">站点分类</div></td>
      <td colspan="3"> <input name="SiteClass" style="width:100%;" type="text" id="SiteClass2" value="<%=RsEditObj("SiteClass")%>"></td>
    </tr>
    <tr bgcolor="#F3F3F3"> 
      <td> <div align="right">采集站地址</div></td>
      <td colspan="3"> <input name="SiteUrl" type="text" id="SiteUrl" style="width:100%;" value="<%=RsEditObj("SiteUrl")%>"> 
        <div align="right"></div></td>
    </tr>
    <tr bgcolor="#F3F3F3"> 
      <td bgcolor="#F3F3F3"><div align="right">采集对象页</div></td>
      <td colspan="3" bgcolor="#F3F3F3"> <input name="objURL" type="text" id="textarea" style="width:100%;" value="<%=RsEditObj("objURL")%>" size="50"></td>
    </tr>
    <tr bgcolor="#F3F3F3"> 
      <td bgcolor="#F3F3F3"><div align="right">新闻摸板</div></td>
      <td colspan="3" bgcolor="#F3F3F3"><input name="SysTemplet" type="text" id="SysTemplet" style="width:100%;" value="<%=RsEditObj("SysTemplet")%>"></td>
    </tr>
    <tr bgcolor="#F3F3F3"> 
      <td bgcolor="#F3F3F3"><div align="right">目标栏目</div></td>
      <td width="30%" bgcolor="#F3F3F3"><select name="SysClass" style="width:100%;" id="select2">
          <% =ClassList %>
        </select></td>
      <td width="15%" bgcolor="#F3F3F3"><div align="right">锁定</div></td>
      <td bgcolor="#F3F3F3"><input name="islock" type="checkbox" id="islock2" value="1" <%if RsEditObj("islock")=true then response.Write("checked")%>></td>
    </tr>
    <tr bgcolor="#F3F3F3"> 
      <td height="50" colspan="4"> <div align="right"> 
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr> 
              <td width="50%"> <div align="center"> 
                  <input type="reset" name="Submit2" value=" 重 填 ">
                </div></td>
              <td width="30%"> <div align="center"> 
                  <input type="button" onClick="CheckData();" name="Submit" value="下 一 步">
                </div></td>
            </tr>
          </table>
        </div></td>
    </tr>
  </form>
</table>
</body>
</html><%
Set Conn = Nothing
Set CollectConn = Nothing
Set RsEditObj = Nothing
%>
<script language="JavaScript">
function CheckData()
{
	if (document.form1.SiteName.value==''){alert('没有填写站点名称');document.form1.SiteName.focus();return;}
	if (document.form1.SiteClass.value==''){alert('没有填写站点分');document.form1.SiteClass.focus();return;}
	if (document.form1.SiteUrl.value==''){alert('没有填写采集站地址');document.form1.SiteUrl.focus();return;}
	if (document.form1.objURL.value==''){alert('没有填写采集对象页');document.form1.objURL.focus();return;}
	if (document.form1.SysClass.value==''){alert('没有填写目标栏目');document.form1.SysClass.focus();return;}
	document.form1.submit();
}
</script>