<% Option Explicit %>
<!--#include file="inc/Cls_DB.asp" -->
<!--#include file="../../Inc/Const.asp" -->
<%
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 ClassID 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

if Request.Form("Result") = "Edit" then
    Dim RsAddObj,sql
    if Request.Form("SiteName")="" Or Request.Form("SysTemplet")="" or Request.Form("SiteUrl")=""  or Request.Form("objURL")=""  or Request.Form("SiteClass")=""  or Request.Form("SysClass")=""  then
		Response.write"<script>alert(""请填写完整！"");location.href=""javascript:history.back()"";</script>"
		Response.end
	end if
	Set RsAddObj = Server.CreateObject ("ADODB.RecordSet")
	Sql = "select * from Site where id=" & Request.Form("SiteID")
	RsAddObj.Open Sql,CollectConn,1,3
	RsAddObj("SiteName") = Request.Form("SiteName")
	RsAddObj("SiteUrl") = Request.Form("SiteUrl")
	RsAddObj("objURL") = Request.Form("objURL")
	RsAddObj("SiteClass") = Request.Form("SiteClass")
	RsAddObj("SysClass") = Request.Form("SysClass")
	RsAddObj("SysTemplet") = Request.Form("SysTemplet")
	if Request.Form("IsAuto")<>"" then
		RsAddObj("IsAuto") = True
	else
		RsAddObj("IsAuto") = False
	end if
	RsAddObj("ListHeadSetting") = Request.Form("ListHeadSetting")
	RsAddObj("ListFootSetting") = Request.Form("ListFootSetting")
	RsAddObj("LinkHeadSetting") = Request.Form("LinkHeadSetting")
	RsAddObj("LinkFootSetting") = Request.Form("LinkFootSetting")
	RsAddObj("PagebodyHeadSetting") = Request.Form("PagebodyHeadSetting")
	RsAddObj("PagebodyFootSetting") = Request.Form("PagebodyFootSetting")
	RsAddObj("PageTitleHeadSetting") = Request.Form("PageTitleHeadSetting")
	RsAddObj("PageTitleFootSetting") = Request.Form("PageTitleFootSetting")
	if Request.Form("IsAutoCollect") <> "" then
		RsAddObj("IsAutoCollect") = True
		RsAddObj("CollectDate") = Clng(Request.Form("CollectDate"))
	else
		RsAddObj("IsAutoCollect") = False
	end if
	if Request.Form("Islock") <> "" then
		RsAddObj("Islock") = True
	else
		RsAddObj("Islock") = False
	end if
	RsAddObj.update
	RsAddObj.close
	Set RsAddObj = Nothing
	Response.Redirect("Site.asp")
	Response.End
end if
%>
<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="">
    <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="15%"> 
        <div align="right">采集站点名称</div></td>
      <td width="40%"> 
        <input name="SiteName" style="width:100%;" type="text" id="SiteName" value="<%=RsEditObj("sitename")%>">
      </td>
      <td width="15%"> <div align="right"> 
          <input name="SiteID" type="hidden" id="SiteID2" value="<% = SiteID %>">
          <input name="Result" type="hidden" id="Result2" value="Edit">
          站点分类</div></td>
      <td> <input name="SiteClass" style="width:100%;" type="text" id="SiteClass" value="<%=RsEditObj("SiteClass")%>"> 
      </td>
    </tr>
    <tr bgcolor="#F3F3F3"> 
      <td> <div align="right">采集站地址</div></td>
      <td><input name="SiteUrl" type="text" style="width:100%;" id="SiteUrl" value="<%=RsEditObj("SiteUrl")%>"></td>
      <td> <div align="right">目标栏目</div></td>
      <td><select name="SysClass" style="width:100%;" id="SysClass">
          <% =ClassList %>
        </select></td>
    </tr>
    <tr bgcolor="#F3F3F3"> 
      <td bgcolor="#F3F3F3"><div align="right">采集对象页</div></td>
      <td colspan="3" bgcolor="#F3F3F3"><input name="objURL" style="width:100%;" type="text" id="objURL" value="<%=RsEditObj("objURL")%>" size="50"></td>
    </tr>
    <tr bgcolor="#F3F3F3"> 
      <td bgcolor="#F3F3F3"><div align="right">新闻摸板</div></td>
      <td bgcolor="#F3F3F3"><input name="SysTemplet" type="text" id="SysTemplet" style="width:100%;" value="<%=RsEditObj("SysTemplet")%>"> 
      </td>
      <td bgcolor="#F3F3F3"><div align="right">锁定</div></td>
      <td bgcolor="#F3F3F3"><input name="islock" type="checkbox" id="islock" value="1" <%if RsEditObj("islock")=true then response.Write("checked")%>></td>
    </tr>
    <tr bgcolor="#DFEAEE"> 
      <td> <div align="right">列表开始字符</div></td>
      <td colspan="3"> <textarea name="ListHeadSetting" cols="50" rows="3" id="ListHeadSetting" style="width:100%;"><%=RsEditObj("ListHeadSetting")%></textarea></td>
    </tr>
    <tr bgcolor="#DFEAEE"> 
      <td> <div align="right">列表结束字符</div></td>
      <td colspan="3"> <textarea name="ListFootSetting" cols="50" rows="3" id="ListFootSetting" style="width:100%;"><%=RsEditObj("ListFootSetting")%></textarea></td>
    </tr>
    <tr bgcolor="#DFEAEE"> 
      <td> <div align="right">列表URL开始字符</div></td>
      <td colspan="3"> <textarea name="LinkHeadSetting" cols="50" rows="3" id="textarea2" style="width:100%;"><%=RsEditObj("LinkHeadSetting")%></textarea></td>
    </tr>
    <tr bgcolor="#DFEAEE"> 
      <td> <div align="right">列表URL结束字符</div></td>
      <td colspan="3"> <textarea name="LinkFootSetting" cols="50" rows="3" id="textarea3" style="width:100%;"><%=RsEditObj("LinkFootSetting")%></textarea></td>
    </tr>
    <tr bgcolor="#E3E3E3"> 
      <td> <div align="right">标题开始字符</div></td>
      <td colspan="3"> <textarea name="PageTitleHeadSetting" cols="50" rows="3" id="textarea6" style="width:100%;"><%=RsEditObj("PageTitleHeadSetting")%></textarea></td>
    </tr>
    <tr bgcolor="#E3E3E3"> 
      <td> <div align="right">标题结束字符</div></td>
      <td colspan="3"> <textarea name="PageTitleFootSetting" cols="50" rows="3" id="textarea7" style="width:100%;"><%=RsEditObj("PageTitleFootSetting")%></textarea></td>
    </tr>
    <tr bgcolor="#E3E3E3"> 
      <td> <div align="right">内容开始字符</div></td>
      <td colspan="3"> <textarea name="PagebodyHeadSetting" cols="50" rows="3" id="textarea8" style="width:100%;"><%=RsEditObj("PagebodyHeadSetting")%></textarea></td>
    </tr>
    <tr bgcolor="#E3E3E3"> 
      <td> <div align="right">内容结束字符</div></td>
      <td colspan="3"> <textarea name="PagebodyFootSetting" cols="50" rows="3" id="textarea9" style="width:100%;"><%=RsEditObj("PagebodyFootSetting")%></textarea></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="submit" name="Submit" value=" 修 改 ">
                </div></td>
              <td><div align="center"> 
                  <input type="reset" name="Submit2" value=" 重 填 ">
                </div></td>
            </tr>
          </table>
        </div></td>
    </tr>
  </form>
</table>
</body>
</html>
<%
Set Conn = Nothing
Set CollectConn = Nothing
Set RsEditObj = Nothing
%>