<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!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">
<!--#include file="fckeditor/fckeditor.asp"-->
<!--#include file="conn.asp"-->
<%
dim cls
if session("admin")="" then
	Response.Redirect("admin.asp")	
end if
%>
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from news where id=" & request("id"),conn,1,1
if rs.eof then
      mcount=1
else
      mcount=2
end if

rs.close
set rs=nothing


if request.QueryString("action")="save" then


Content=Request("mytext")

if Content="" then
   response.Write("<script language=javascript>alert('内容不能为空！');history.go(-1);</script>")
   response.End()
end if



set rs=server.CreateObject("adodb.recordset")
rs.open "select * from news where id=" & request("id"),conn,1,3 
	rs("title")=trim(request("dyname"))
	rs("zuozh")=trim(request("addname"))
	rs("mytext") = content
	rs.update
	rs.close
set rs=nothing

response.write "<script language=javascript>alert('修改成功！');location.href='Announcement_up.asp';</script>"
response.End
end if
%>

<head>
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from news where id=" & request("id"),conn,1,1
%>
<script language="javascript">
function checkdata(){
if(form1.dyname.value==""){
     form1.dyname.focus();
     alert("标题不能为空");
}else if(form1.addname.value==""){
     form1.addname.focus();
     alert("作者不能为空");
}
else{
return true;
}
return false;
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body>

<div style="border: 1px solid #6699CC; margin-top:20px; width:90%; margin-left:7%; margin-right:auto;">
<table class="tableBorder" width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr> 
<td  align="center" background="images/admin_bg_1.gif" height="25"><b><font color="#ffffff">信息修改</font></b></td>
</tr>
<tr> 
<td valign="top"> 
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#FBF4F4">
        <form name="form1" method="post" action="?action=save&id=<%=request("id")%>" onSubmit="return checkdata()">
          <tr > 
            <td width="30%" align="right">主题：</td>
            <td width="70%" style="PADDING-LEFT: 10px"> <input name="dyname" type="text" id="dyname" value="<%=rs("title")%>" size="30"> 
            </td>
          </tr>
          <tr > 
            <td align="right">发 表 人：</td>
            <td style="PADDING-LEFT: 10px"> <input name="addname" type="text" id="addname" value="<%=rs("zuozh")%>" size="30"> 
            </td>
          </tr>
          <tr > 
            <td align="right" valign="top">内容：</td>
            <td bgcolor="#FFFFFF" class="forumRowHighlight"style="PADDING-LEFT: 10px">
<!--在线编辑器-->
<div style="width:600px; height:400px;">
<%

Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "100%"
oFCKeditor.Height = "400"
oFCKeditor.Value = rs("mytext")
oFCKeditor.Create "mytext"
%>
</div>
<!---------------------->			
			
			</td>
          </tr>
          <tr > 
            <td height="30"></td>
            <td height="30" style="PADDING-LEFT: 10px"> <input type="submit" name="Submit" value="提交发表"> 
              <input  type=button name="Clear" value="返　　回" onclick="history.go(-1);"></td>
          </tr>
        </form>
      </table>
</td>
</tr>
</table>
</div>
<%
rs.close
set rs=nothing
%>
<!--#include file="foot.asp"-->
</body>
</html>
