<%@language=VBScript.Encode codepage=936 %>
<!--#include file="conn.asp"-->
<!--#include file="application.asp"-->
<!--#include file="admin.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
IF Trim(Request("action"))="Edit" then
   ID     =repens(Trim(Request("ID")))
   ClassID=repens(Trim(Request("ClassID")))
   Title  =repens(Trim(Request("Title")))
   titlecolor=repens(Trim(Request("titlecolor")))
   keyword=repens(Trim(Request("keyword")))
   Desc=repens(Trim(Request("Desc")))
   Content=repens(Trim(Request("Content")))
   ShowPic=repens(Trim(Request("FileName")))
   Admin  =repens(Trim(Request("user")))
   set rs=server.CreateObject("adodb.recordset")
   rs.open"select * from news where ID="&ID,conn,1,3
   If not rs.eof then
      Rs("Title")=Title
	  Rs("titlecolor")=titlecolor
	  Rs("ClassID")=ClassID
	  Rs("KeyWord")=KeyWord
	  Rs("Desc")=Desc
	  Rs("Content")=Content
	  Rs("ShowPic")=ShowPic
	  Rs("Admin")=Admin
   Rs.update
   Rs.close:set Rs=nothing
   Response.Redirect("News.asp")
   End if
End If

dim rs,ID
dim sql
ID=Trim(Request("ID"))
set rs=server.createobject("adodb.recordset")
sql = "select * from news where ID="&ID
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
function CheckForm()
{
	if (document.myform.title.value.length == 0) {
		alert("单页标题没有填写.");
		document.myform.title.focus();
		return false;
	}
	return true;    
	if (editor.EditMode.checked==true)
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerText;
    else
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerHTML; 

}
</script>
<!-- #include file="Inc/Head.asp" -->

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
   
    <td align="center" valign="top"><table width="95%" border="0" cellpadding="2" cellspacing="1" class="table_southidc">
      <form method="POST" name="myform" onSubmit="return CheckForm();" action="NewsEdit.asp?action=Edit" target="_self">
        <input type="hidden" value="<%=ID%>" name="ID">
        <tr>
          <td class="back_southidc" height="30" colspan="3" align="center">编辑新闻信息</td>
        </tr>
        <tr bgcolor="#ECF5FF">
          <td width="177" height="25" align="right"><font color="#FF0000">*</font>文章标题：</td>
          <td colspan="2"><input name="title" value="<%=rs("Title")%>" type="text" class="input" size="30" maxlength="50">&nbsp;
			<select name="titlecolor">
			<option value=""></option>
			<option value="#FF0000" <%if rs("TitleColor")="#FF0000" then response.Write("selected") end if%>>红色</option>
			</select>
			*标题颜色</td>
        </tr>
		<tr bgcolor="#ECF5FF"> 
            <td width="177" height="25" align="right"><font color="#FF0000">*</font>文章类别：</td>
            <td colspan="2"> 
			<select name="ClassID">
			<option value="">选择分类</option>
			<option value="建站知识" <%if rs("ClassID")="建站知识" then response.Write("selected") end if%>>建站知识</option>
			<option value="网站推广" <%if rs("ClassID")="网站推广" then response.Write("selected") end if%>>网站推广</option>
			<option value="行业动态" <%if rs("ClassID")="行业动态" then response.Write("selected") end if%>>行业动态</option>
			<option value="站内公告" <%if rs("ClassID")="站内公告" then response.Write("selected") end if%>>站内公告</option>
			</select></td>
          </tr>
		<tr bgcolor="#ECF5FF"> 
            <td width="177" height="25" align="right"><font color="#FF0000">*</font>文章关键字：</td>
            <td colspan="2"> <input name="keyword" value="<%=rs("keyword")%>" type="text" class="input" size="30" maxlength="50"></td>
          </tr>
		  <tr bgcolor="#ECF5FF"> 
            <td width="177" height="25" align="right"><font color="#FF0000">*</font>文章描述：</td>
            <td colspan="2">&nbsp;
              <textarea name="Desc" cols="50" rows="4"><%=rs("Desc")%></textarea>
            **控制在150字以内</td>
          </tr>
        <tr bgcolor="#ECF5FF">
          <td height="25" align="right" valign="top"><font color="#FF0000">*</font>文章内容：</td>
          <td colspan="2" valign="top"><textarea name="Content" style="display:none"><%=Rs("Content")%></textarea>
              <iframe id="eWebEditor1" src="Southidceditor/ewebeditor.asp?id=content&style=southidc" frameborder="0" scrolling="no" width="90%" height="450"></iframe></td>
        </tr>
        <tr bgcolor="#ECF5FF">
          <td height="25" align="right"><font color="#FF0000">*</font>展示图片：</td>
          <td width="215"><input name="FileName" type="text" value="<%=Rs("ShowPIc")%>" class="input" size="30">&nbsp;</td>
          <td width="549"><iframe frameborder="0" height="22" name="UpLoad" scrolling="no" src="Upload_Photo.asp"></iframe></td>
        </tr>
        <tr bgcolor="#ECF5FF">
          <td height="25" align="right"><font color="#FF0000">*</font>发布人：</td>
          <td colspan="2"><input name="user" type="text" class="input" value="<%=session("AdminName")%>" size="30"></td>
        </tr>
        <tr>
          <td height="30" colspan="3" align="center" bgcolor="#ECF5FF"><input type="submit" name="Submit" value="提交" class="input">
            
            <input type="reset" name="Submit" value="重置" class="input">          </td>
        </tr>
      </form>
    </table></td>
  </tr>
</table>
<!-- #include file="Inc/Foot.asp" -->