<!--#include file="conn.asp"-->
<!--#include file="seeion.asp"-->
<!--#include file="fckeditor/fckeditor.asp"-->
<%
Dim Angel_languageid
    Angel_languageid=Trim(request.QueryString("Languageid"))
If Angel_languageid="" Then 
    Angel_languageid=1
Else
    Angel_languageid=Angel_languageid
End If 
Angel_main_id = request("Angel_main_id")
If request("submit") = "确定添加" Then
    Angel_title = request.Form("Angel_title")
	Angel_SeoKeywords = request.Form("Angel_SeoKeywords")
    Angel_SeoDescription = request.Form("Angel_SeoDescription")
    Angel_category = request.Form("Angel_category")
    Angel_author = request.Form("Angel_author")
    Angel_Source = request.Form("Angel_source")
    Angel_body = request.Form("Angel_body")
    If Angel_title = "" Then
        response.Write("<script language=javascript>alert('标题不能为空!');history.back(1)</script>")
        response.End()
    End If
    If Angel_body = "" Then
        response.Write("<script language=javascript>alert('内容不能为空!');history.back(1)</script>")
        response.End()
    End If
    Set rs = server.CreateObject("adodb.recordset")
    sql = "select * from Angel_news"
    rs.Open sql, conn, 1, 3
    rs.addnew
    rs("Angel_title") = Angel_title
    rs("Angel_SeoKeywords") = Angel_SeoKeywords
    rs("Angel_SeoDescription") = Angel_SeoDescription
    rs("Angel_category") = Angel_category
    rs("Angel_author") = Angel_author
    rs("Angel_source") = Angel_Source
    rs("Angel_body") = Angel_body
    rs("Angel_languageid")=Angel_languageid
    rs.update
    Response.Write "<script>alert('成功添加新闻，点击“确定”继续添加！');window.location.href='news.asp';</script>"
End If
%>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>网站后台管理系统</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--#include file="header.asp"-->
<div id="top_banner" class="layout"></div>
<div id="content" class="layout">
  <!--#include file="left.asp"-->
  <div id="right">
    <div class="right_title">
      <h2>添加新闻</h2>
    </div>
    <div class="right_body">
<table align="center" style="margin-bottom:10px">
	<tr>
	<td>
<%If Int(Angel_languageid)=1 Then  %>
<div id="lglocatione1"><a href="news.asp?LanguageId=1" >添加中文</a></div>
<div id="lglocatione"><a href="news.asp?Languageid=2">添加英文</a></div>
<%else%>
<div id="lglocatione"><a href="news.asp?LanguageId=1" >添加中文</a></div>
<div id="lglocatione1"><a href="news.asp?Languageid=2">添加英文</a></div>
<%End If %>
</td>
	</tr>
</table>

      <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="table">
        <form method="post" >
          <tr>
            <td width="14%">新闻标题：</td>
            <td width="86%"><input name="Angel_title" onblur='value=value.replace(/[>"<]/g,"")' type="text" size="60" /></td>
          </tr>
		<tr>
            <td align="center">关键字：</td>
            <td><input name="Angel_SeoKeywords" type="text" size="80"/></td>
          </tr>
		   <tr>
            <td align="center">描述：</td>
            <td><input name="Angel_SeoDescription" type="text" size="80" /></td>
          </tr>
          <tr>
            <td>新闻分类：</td>
            <td><select name="Angel_category">
              <%
Set rs = conn.Execute("select * from Angel_news_category where 1=1 and Angel_languageid="&Angel_languageid&" ")
Do While Not rs.EOF
    response.Write("<option value="""&rs("Angel_id")&""">"&rs("Angel_title")&"</option>")
    rs.movenext
Loop
rs.Close
Set rs = Nothing

%>
            </select></td>
          </tr>
          <tr>
            <td>作者：</td>
            <td><input name="Angel_author" type="text" value="<%=session("user_name")%>"/></td>
          </tr>
          <tr>
            <td>来源：</td>
            <td><input name="Angel_source" type="text" value="本站" size="10" /></td>
          </tr>
          <tr>
            <td height="258">内容详情：</td>
            <td>
		<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "fckeditor/"
oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "100%"
oFCKeditor.Height = "360"
oFCKeditor.Value = ""
oFCKeditor.Create "Angel_body"
%> 
			  </td>
          </tr>
          <tr>
            <td colspan="2"><p class="submit">
              <input name="submit" type="submit" value="确定添加" />
            </p></td>
          </tr>
        </form>
      </table>
    </div>
  </div>
  <div class="clear"></div>
</div>
<!--#include file="footer.asp"-->
