<!-- #include file="../Include/conn.asp" -->
<!-- #include file="Include/Chk.asp" -->


<%
img=request("img")
if Request("Action")=1 then
		if(Trim(Request("titles")="" and Trim(Request("En_titles"))="" or Trim(Request("lid"))="") ) then
			Response.write "<script language='javascript'>alert('信息填写不完整：\n标题、栏目、内容必须填写！');history.go(-1);</script>"
			Response.End()
		end if
		if ((Trim(Request("titles"))<>"" and Trim(Request("info"))="") or (Trim(Request("en_titles"))<>"" and Trim(Request("en_info"))="")) then
			Response.write "<script language='javascript'>alert('信息填写不完整：\n内容必须填写！');history.go(-1);</script>"
			Response.End()
		end if
		if (Trim(Request("titles"))<>"" and Trim(Request("info"))="") then
			Response.write "<script language='javascript'>alert('信息填写不完整：\n中文内容必须填写！');history.go(-1);</script>"
			Response.End()
		end if
		if (Trim(Request("en_titles"))<>"" and Trim(Request("en_info"))="") then
			Response.write "<script language='javascript'>alert('信息填写不完整：\n英文内容必须填写！');history.go(-1);</script>"
			Response.End()
		end if



	
	SQL="Select * from Hua_News"
	set rs=server.createobject("adodb.recordset")
	rs.open SQL,conn,1,3

	rs.AddNew
	rs("titles")=Trim(Request("titles"))
	rs("lid")=Trim(Request("lid"))
	rs("from")=Trim(Request("from"))
	rs("info")=Trim(Request("info"))
	rs("author")=Trim(Request("author"))
	rs("addtime")=Trim(Request("addtime"))
	rs("hit")=Trim(Request("hit"))
	rs("key")=Trim(Request("key"))
	rs("des")=Trim(Request("des"))
	rs("news1")=Trim(Request("news1"))
	rs("news2")=Trim(Request("news2"))
	rs("news3")=Trim(Request("news3"))
	rs("news4")=Trim(Request("news4"))
	rs("img")=Trim(Request("img"))

	rs("en_titles")=Trim(Request("en_titles"))
	rs("en_from")=Trim(Request("en_from"))
	rs("en_info")=Trim(Request("en_info"))
	rs("en_author")=Trim(Request("en_author"))
	rs("en_addtime")=Trim(Request("en_addtime"))
	rs("en_hit")=Trim(Request("en_hit"))
	rs("en_key")=Trim(Request("en_key"))
	rs("en_des")=Trim(Request("en_des"))
	rs("en_news1")=Trim(Request("en_news1"))
	rs("en_news2")=Trim(Request("en_news2"))
	rs("en_news3")=Trim(Request("en_news3"))
	rs("en_news4")=Trim(Request("en_news4"))
	rs("en_img")=Trim(Request("en_img"))
	
	
	rs.Update
	rs.Close
	Set rs=nothing
	Response.Write "<script language='javascript'>alert('新闻添加成功!');location.replace('News_Add.asp');</script>"
	Response.End()
else
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<link href="Images/main.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="../cneditor/themes/default/default.css" />
<script charset="utf-8" src="../cneditor/kindeditor.js"></script>
<script charset="utf-8" src="../cneditor/lang/zh_CN.js"></script>
<script>
		KindEditor.ready(function(K) {
				K.create('#info', {
					urlType : 'absolute',
					afterBlur: function(){this.sync();},				
					uploadJson : '../cneditor/asp/upload_json.asp'
				});
				K.create('#en_info', {
					urlType : 'absolute',
					afterBlur: function(){this.sync();},				
					uploadJson : '../cneditor/asp/upload_json.asp'
				});
		});
	</script>

</head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  
  <tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="ta">
      <tr>
        <td width="50%" height="25" align="left" valign="middle" class="t2">录入新闻</td>
        <td width="50%" align="right" valign="middle" class="t2">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="8"></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="1" class="ta">
      <tr>
        <td colspan="2" align="left" valign="top" bgcolor="#FFFFFF">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <form name="form1" method="post" action="?action=1" >
            <tr>
              <td width="10%" height="30" align="right" valign="middle" class="bline"><span class="t3">中文新闻标题：</span></td>
              <td width="90%" height="30" align="left" valign="middle" class="bline"><input name="titles" type="text" class="main" id="titles" size="80" maxlength="250"></td>
            </tr>
            <tr>
              <td width="10%" height="30" align="right" valign="middle" class="bline"><span class="t3">英文新闻标题：</span></td>
              <td width="90%" height="30" align="left" valign="middle" class="bline"><input name="en_titles" type="text" class="main" id="en_titles" size="80" maxlength="250"></td>
            </tr>
            <tr>
              <td height="30" align="right" valign="middle" class="bline"><span class="t3">所属栏目：</span></td>
              <td height="30" align="left" valign="middle" class="bline"><select name="lid" class="main" id="lid">
  <%
Set Rs1 = Conn.Execute("select * from Hua_News_Type where pid=0")
Do While Not Rs1.EOF
Response.Write "<option value='" & Rs1("id") & "'>"& Rs1("name") &"("&rs1("en_name")&")</option>"
	
	Set Rs2=Conn.Execute("select * from Hua_News_Type where pid="&Rs1("id")&"")
	do while not Rs2.eof
	Response.Write "<option style='color:#999999' value='" & Rs2("id") & "'>--"& Rs2("name") &"("&Rs2("en_name")&")</option>"
	Rs2.movenext
	loop
	rs2.close
	
Rs1.MoveNext
loop
Rs1.Close

%>
                </select>              </td>
            </tr>
                <tr>
                  <td height="40" align="right" valign="middle" class="bline"><span class="t3">中文其他项：</span></td>
                  <td align="left" valign="middle" class="bline">作者：
                    <input name="author" type="text" class="main" id="author" size="15" maxlength="60" value="admin"> 
                    来源： 
                    <input name="from" type="text" class="main" id="from" size="20" maxlength="100" value="中国新华">
                    时间：
                    <input name="addtime" type="text" class="main" id="addtime" size="30" maxlength="60" value="<%If isEdit Then Response.Write Rs("WriteTime"):Else Response.Write (Now())%>">
                    点击：
                  <input name="hit" type="text" class="main" id="hit" size="10" maxlength="50" value="0"></td>
                </tr>
			<tr>
            <tr>
                  <td height="40" align="right" valign="middle" class="bline"><span class="t3">英文其他项：</span></td>
                  <td align="left" valign="middle" class="bline">作者：
                    <input name="en_author" type="text" class="main" id="en_author" size="15" maxlength="60" value="admin"> 
                    来源： 
                    <input name="en_from" type="text" class="main" id="en_from" size="20" maxlength="100" value="Cnxinhua.com">
                    时间：
                    <input name="en_addtime" type="text" class="main" id="en_addtime" size="30" maxlength="60" value="<%If isEdit Then Response.Write Rs("WriteTime"):Else Response.Write (Now())%>">
                    点击：
                  <input name="en_hit" type="text" class="main" id="en_hit" size="10" maxlength="50" value="0"></td>
                </tr>
			<tr>
              <td height="40" align="right" valign="middle" class="bline"><span class="t3">中文关键字：</span></td>
              <td height="40" align="left" valign="middle" class="bline">
			  <input name="key" type="text" class="main" id="key" size="50" maxlength="250" value=" "></td>
			 </tr>
             <tr>
              <td height="40" align="right" valign="middle" class="bline"><span class="t3">英文关键字：</span></td>
              <td height="40" align="left" valign="middle" class="bline">
			  <input name="en_key" type="text" class="main" id="en_key" size="50" maxlength="250" value=" "></td>
			 </tr>
			 <tr>
              <td height="40" align="right" valign="middle" class="bline"><span class="t3">中文产品描述：</span></td>
              <td height="40" align="left" valign="middle" class="bline">
			  <input name="des" type="text" class="main" id="des" size="100" maxlength="250" value="  "></td>
			 </tr>
			 <tr>
              <td height="40" align="right" valign="middle" class="bline"><span class="t3">英文产品描述：</span></td>
              <td height="40" align="left" valign="middle" class="bline">
			  <input name="en_des" type="text" class="main" id="en_des" size="100" maxlength="250" value="  "></td>
			 </tr>
			 <tr>
              <td height="40" align="right" valign="middle" class="bline"><span class="t3">中文上传图片<br>
                （图片新闻）：  </span></td>
              <td height="40" align="left"  class="bline">
			  <iframe allowTransparency="true" name='i1' src='upload/upload_pic.asp'; frameborder=0 width="350" scrolling=no height="40"> </iframe>
                <input name="img" type="hidden" id="img">
                如果上传图片，将显示在首页图片新闻中。</td>
            </tr>
           <tr>
              <td height="40" align="right" valign="middle" class="bline"><span class="t3">英文上传图片<br>
                （图片新闻）：  </span></td>
              <td height="40" align="left"  class="bline"><iframe allowTransparency="true" name='i1' src='upload/en_upload_pic.asp'; frameborder=0 width="350" scrolling=no height="40"> </iframe>
                <input name="en_img" type="hidden" id="en_img">                 如果上传图片，将显示在首页图片新闻中。</td>
            </tr>
            <tr>
              <td width="10%" height="30" align="right" valign="middle" class="bline"><span class="t3">中文新闻内容：<br>
              </span></td>
              <td width="90%" align="left" valign="middle" class="bline">
                <p>
                 <textarea  id="info" name="info" style="width:900px;height:530px;"> 

</textarea>
                </p>                </td>
            </tr>
            <tr>
              <td width="10%" height="30" align="right" valign="middle" class="bline"><span class="t3">英文新闻内容：<br>
              </span></td>
              <td width="90%" align="left" valign="middle" class="bline">
                <p>
                 <textarea id="en_info" name="en_info" style="width:900px;height:530px;"> 

</textarea>
                </p>                </td>
            </tr>
            <tr>
              <td height="50" colspan="2" align="center" valign="middle"><input name="Submit" type="submit" class="inputbut" value="提交">
                &nbsp; <input name="Submit2" type="reset" class="inputbut" value="重置"></td>
              </tr>
			</form>
          </table>
                
        </td>
        </tr>
      
    </table></td>
  </tr>
</table>
</body>
</html>
<%
end if
%>