<%@ codepage = 936 LCID = 2052 %>
<% if Session("exemple_status") <> "login" then response.redirect "login.asp" %>
<%
Response.expires = 0
Response.expiresabsolute = Now() - 1
Response.addHeader "pragma", "no-cache"
Response.addHeader "cache-control", "private"
Response.CacheControl = "no-cache"
%>
<!--#include file="db.asp"-->

<%
response.buffer = true

'get action
a=request.form("a")

'get fields from form

x_id = Request.Form("x_id")
x_title = Request.Form("x_title")
x_content = Request.Form("content")
x_datetime = Request.Form("x_datetime")

' Open Connection to the database
set conn = Server.CreateObject("ADODB.Connection")
conn.Open xDb_Conn_Str

Select Case a
	Case "A": ' Add

		' Open record
		strsql = "SELECT * FROM [news_info] WHERE 0 = 1"

		set rs = Server.CreateObject("ADODB.Recordset")
		rs.Open strsql, conn, 1, 2

		rs.AddNew

		
tmpFld = Trim(x_title)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("title") = tmpFld
tmpFld = Trim(x_content)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("content") = tmpFld


		rs.Update
		rs.Close
		Set rs = Nothing
		conn.Close
		Set conn = Nothing
		Response.Clear
		Response.Redirect "news_infolist.asp"
End Select
%>


<!--#include file="header.asp"-->

<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#336699"><tr><td>
<img src="images/bnradd.gif" alt="" width="400" height="30" border="0"></td></tr></table>

<table width="100%" border="0" cellspacing="0" cellpadding="10"><tr><td>
<p>目前操作栏目 : 企业信息类管理<br><br><a href="news_infolist.asp">[返回上一页]</a></p>

<script language="JavaScript" src="ew.js"></script>
<script language="JavaScript">
<!-- start Javascript
function  EW_checkMyForm(EW_this) {
document.form1.content.value=document.form1.doc_html.value;
return true;
}
// end JavaScript -->
</script>
<form onSubmit="return EW_checkMyForm(this);"  action="news_infoadd.asp" method="post" name="form1">
<p>
<input type="hidden" name="a" value="A">

                    <table width="596" border="0" cellspacing="1" cellpadding="5" bgcolor="cccccc">
                      <tr> 
                        <td bgcolor="f5f5f5"><font color="">id&nbsp;</td>
                        <td bgcolor="#F5F5F5"><%= x_id %>&nbsp;</td>
                      </tr>
                      <tr> 
                        <td bgcolor="f5f5f5"><font color="">标题&nbsp;</td>
                        <td bgcolor="#F5F5F5"><input type="text" name="x_title" value="<%= x_title %>" size=50 maxlength=50>
                          &nbsp;</td>
                      </tr>
                      <tr> 
                        <td bgcolor="f5f5f5"><font color="">内容&nbsp;</td>
                        <td bgcolor="#F5F5F5"> <object id=doc_html style="LEFT: 0px; TOP: 0px" data=editor.htm width=544 
	        height=320 type=text/x-scriptlet  VIEWASTEXT>
                          </object> <input type="hidden" name="content" value="" > 
                          <script language="JavaScript" type="text/JavaScript">
document.form1.content.value=document.form1.doc_html.value;
</script> &nbsp;</td>
                      </tr>
					  <tr>
                        <td bgcolor="f5f5f5">提醒</td>
                        <td bgcolor="#F5F5F5"><font color="#FF0000">* 图片请先上传,然后点击上方&quot;插入图片&quot;标签,然后填入图片完整网址 
                          <input name="Submit" type="button" onClick="window.open('../upfile.htm')" value="图片上传(点击)">
                          </font></td>
                      </tr>
                    </table>
<p>
<input type="submit" name="Action" value="ADD">
</form>
</td></tr></table>
<!--#include file="footer.asp"-->
