<!--#include file="include/ht.asp"-->
<!--#include file="include/menu_top.asp"-->
<%
action=request.querystring("action")
tp=request.querystring("type")
if action="add" then
actionurl="action=add"

elseif action="modify" then
id=request.querystring("id")
actionurl="action=modify&id="&id&""

set rs=server.CreateObject("adodb.recordset")
sql="select * from xld_news where news_id="&id&""
rs.open sql,conn,1,1
do until rs.eof
title=rs("news_title")
content=rs("news_content")
author=rs("news_author")
from=rs("news_from")
sp=rs("news_sp")
rs.movenext
loop
rs.close
set rs=nothing
end if
%>
<script language="javascript">
function dosubmit()
{
	var Obj=formObj;
	var iframeObj=frames.eWebEditor1.eWebEditor;
	Obj.content.value=iframeObj.document.body.innerHTML;
	if(Obj.title.value==""){
	alert("请输入信息标题");
	Obj.title.focus();
	return false;
	}
	if(Obj.content.value==""){
	alert("请在编辑框编辑你的内容");
	return false;
	}	
}
function content()	
{
	ct=formObj.content.value;
	frames.eWebEditor1.eWebEditor.document.body.innerHTML=ct;
	}
</script>
<body onLoad="content();">
<div style="width:100%"><div id="left"><!--#include file="include/menu_left.asp"--></div>
<div id="right" style="padding:20px;">
<form name="formObj"action="news_action.asp?<%=actionurl%>&type=<%=tp%>"method="post" id="formObj" onSubmit="return dosubmit()">
	<div id="newslb">添 加 新 信 息</div><br>
	<div id="news_lb">信息标题:<input name="title" type="text" id="title" value="<%=title%>" size="50" class="input"></div>
	<div id="news_lb">信息类别:<select name="tp" id="tp" class="input">
	  <%
	  set rs=server.createobject("adodb.recordset")
	  sql="select * from xld_news_lb where lb_id="&tp&""
	  rs.open sql,conn,1,1
	  do until rs.eof
	  tid=rs("lb_id")
	  tp=rs("lb_mc")	  
	  %>	  
	  <option value=<%=tid%>><%=tp%></option>
      <%
	  rs.movenext
	  loop
	  rs.close
	  set rs=nothing
	  %>	  
       </select></div>
	<div id="news_lb">新闻内容:请在以下编辑框中编辑</div>
	<div id="news_lb"><iframe id="eWebEditor1" src="dc_editor/ewebeditor.asp?id=eWebEditor1&style=s_light" frameborder="0" scrolling="no" height="300" style="width:100%"></iframe></div>
	<div id="newslb"><input type="submit" name="Submit" value="保存新闻"></div>
	<textarea name="content" style="display:none"><%=content%></textarea><input type="hidden" name="content1"  value="">
</form>
</div></div>
</body>

<!--#include file="include/Bottom.asp"-->