<%@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"))="Add" then
   Title  =repens(Trim(Request("Title")))
   titlecolor=repens(Trim(Request("titlecolor")))
   keyword=repens(Trim(Request("keyword")))
   Desc=repens(Trim(Request("Desc")))
   ClassID=repens(Trim(Request("ClassID")))
   Content=repens(Trim(Request("Content")))
   ShowPic=repens(Trim(Request("FileName")))
   Admin  =repens(Trim(Request("user")))
   AddDate=repens(Trim(Request("AddDate")))
   set rs=server.CreateObject("adodb.recordset")
   rs.open"select * from news where ID is null",conn,1,3
   Rs.addnew
      Rs("Title")=Title
	  Rs("titlecolor")=titlecolor
	  Rs("KeyWord")=KeyWord
	  Rs("Desc")=Desc
	  Rs("ClassID")=ClassID
	  Rs("Content")=Content
	  Rs("AddDate")=AddDate
	  Rs("ShowPic")=ShowPic
	  Rs("Hits")=0
	  Rs("Admin")=Admin
   Rs.update
   Rs.close:set Rs=nothing
   Response.Redirect("News.asp")
End If
%>
<script language = "JavaScript">
function CheckForm()
{
	if (document.myform.title.value == "") {
		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="NewsAdd.asp?action=Add">
          <tr> 
            <td class="back_southidc" height="30" colspan="3" align="center">增加新闻信息</td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
            <td width="180" height="25" align="right"><font color="#FF0000">*</font>文章标题：</td>
            <td colspan="2"> <input name="title" type="text" class="input" size="30" maxlength="50">&nbsp;
			<select name="titlecolor">
			<option value=""></option>
			<option value="#FF0000">红色</option>
			</select>
			*标题颜色</td>
          </tr>
		  <tr bgcolor="#ECF5FF"> 
            <td width="180" height="25" align="right"><font color="#FF0000">*</font>文章类别：</td>
            <td colspan="2"> 
			<select name="ClassID">
			<option value="">选择分类</option>
			<option value="建站知识">建站知识</option>
			<option value="网站推广">网站推广</option>
			<option value="行业动态">行业动态</option>
			<option value="站内公告">站内公告</option>
			</select></td>
          </tr>
		  <tr bgcolor="#ECF5FF"> 
            <td width="180" height="25" align="right"><font color="#FF0000">*</font>文章关键字：</td>
            <td colspan="2"> <input name="keyword" type="text" class="input" size="30" maxlength="50"></td>
          </tr>
		  <tr bgcolor="#ECF5FF"> 
            <td width="180" height="25" align="right"><font color="#FF0000">*</font>文章描述：</td>
            <td colspan="2">&nbsp;
              <textarea name="Desc" cols="50" rows="4"></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"></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="221"> <input name="FileName" type="text" class="input" size="30"></td>
            <td width="540">&nbsp;
            <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" align="right" bgcolor="#ECF5FF">录入时间：</td>
            <td height="30" colspan="2" align="left" bgcolor="#ECF5FF">
                <input name="AddDate" type="text" id="AddDate" value="<%=now()%>" maxlength="50"></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" -->