<!--#include file="conn.asp"-->
<!--#include file="seeion.asp"-->
<!--#include file="fckeditor/fckeditor.asp"-->
<%
id = request("id")
If request("submit") = "确定修改" Then
    sql = "select * from news where id="&id
    Set rs = server.CreateObject("adodb.recordset")
    rs.Open sql, conn, 1, 3
    rs("title") = request.Form("title")
    rs("body") = request.Form("body")
    rs("category") = request.Form("category")
    rs("author") = request.Form("author")
    rs("source") = request.Form("source")
    rs.update
    rs.Close
    response.Write "<script>alert('新闻修改成功！');window.location.href='Managementnews.asp';</script>"
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>网站后台管理系统</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--#include file="header.asp"-->
<div id="top_banner" class="layout"></div>
<div id="content" class="layout"> 
  <!--#include file="left.asp"-->
  <div id="right">
    <div class="right_title">
      <h2>修改新闻</h2>
      <%
Set rs = server.CreateObject("adodb.recordset")
exec = "select * from news where id="& request("id")
rs.Open exec, conn, 1, 1
%>
    </div>
    <div class="right_body">
      <table class="table">
        <form method="post">
          <tr>
            <td width="8%">新闻标题</td>
            <td width="92%"><input name="id" type="hidden" value="<%=request("id")%>" />
              <input name="title" type="text" value="<%=rs("title")%>" size="80"></td>
          </tr>
          <tr>
            <td>新闻分类</td>
            <td><select name="category" >
                <%
Set rss = conn.Execute("select * from news_category")
Do While Not rss.EOF
    If rs("category") = rss("id") Then
        response.Write("<option value=""" & rss("id") & """ selected>" & rss("title") & "</option>")
    Else
        response.Write("<option value=""" & rss("id") & """>" & rss("title") & "</option>")
    End If
    rss.movenext
Loop
rss.Close
Set rss = Nothing

%>
              </select></td>
          </tr>
          <tr>
            <td>作　　者</td>
            <td><input name="author" type="text" value="<%=rs("author")%>" /></td>
          </tr>
          <tr>
            <td>来　　源</td>
            <td><input name="source" type="text" value="<%=rs("source")%>" /></td>
          </tr>
          <tr>
            <td height="300">详细内容</td>
            <td><%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "fckeditor/"
oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "100%"
oFCKeditor.Height = "360"
oFCKeditor.Value = rs("body")
oFCKeditor.Create "body"
%>
          </tr>
          <tr>
            <td height="34" colspan="2"><p class="submit">
                <input name="submit" type="submit" value="确定修改" />
              </p></td>
          </tr>
        </form>
      </table>
    </div>
  </div>
  <div class="clear"></div>
</div>
<!--#include file="footer.asp"-->