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


<%
	id=request("id")
	if id="" or not isnumeric(id) then
	Response.Write "<script language='javascript'>alert('参数错误!');location.replace('News_Manage.asp');</script>"
	Response.End()
	end if
	img=request("img")
	SQL="Select * from Hua_News where id="&id
	set rs=server.createobject("adodb.recordset")
	rs.open SQL,conn,1,3
	if rs.eof and rs.bof then
	Response.Write "<script language='javascript'>alert('参数错误!');location.replace('News_Manage.asp');</script>"
	Response.End()
	end if
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



	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_Manage.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&id=<%=Request("id")%>" >
            <tr>
              <td width="11%" height="30" align="right" valign="middle" class="bline"><span class="t3">中文新闻标题：</span></td>
              <td height="30" colspan="2" align="left" valign="middle" class="bline"><input name="titles" type="text" class="main" id="titles" value="<%=rs("titles")%>" size="80" maxlength="250"> 
              <span class="ts"> *标题字数限250字之内 </span></td>
              </tr>
              <tr>
              <td width="11%" height="30" align="right" valign="middle" class="bline"><span class="t3">英文新闻标题：</span></td>
              <td height="30" colspan="2" align="left" valign="middle" class="bline"><input name="en_titles" type="text" class="main" id="en_titles" value="<%=rs("en_titles")%>" size="80" maxlength="250"> 
              <span class="ts"> *标题字数限250字之内 </span></td>
              </tr>
              <tr><td height="30" align="right" valign="middle" class="bline"><span class="t3">所属栏目：</span></td>
              <td height="30" colspan="2" 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
s=""
if Cint(rs("lid"))=Cint(Rs1("id")) then
s="selected"
end if
Response.Write "<option value='" & Rs1("id") & "' "&s&">"& Rs1("name")&"("&rs1("en_name")&")</option>"

	Set Rs2=Conn.Execute("select * from Hua_News_Type where pid="&Rs1("id")&"")
	Do While Not Rs2.EOF
	j=""
	if Cint(rs("lid"))=Cint(Rs2("id")) then
	j="selected"
	end if
	Response.Write "<option style='color:#999999' value='" & Rs2("id") & "' "&j&">--"& Rs2("name") &"("&Rs2("en_name")&")</option>"
	Rs2.movenext
	loop
	rs2.close

Rs1.MoveNext
loop
Rs1.Close
%>
              </select>              </td>
            </tr>
            <tr class="bline">
              <td height="30" align="right" valign="middle" class="bline"><span class="t3">中文其他项：</span></td>
              <td colspan="2" align="left" valign="middle" class="bline">来源：<input name="from" type="text" class="main" id="from" value="<%=rs("from")%>" size="15" maxlength="20"> 作者：<input name="author" type="text" class="main" id="author" value="<%=rs("author")%>" size="18">
                时间：
                <input name="addtime" type="text" class="main" id="addtime" value="<%=rs("addtime")%>" size="15" maxlength="20"> 点击：<input name="hit" type="text" class="main" id="hit" value="<%=rs("hit")%>" size="18"></td>
            </tr>
            <tr class="bline">
              <td height="30" align="right" valign="middle" class="bline"><span class="t3">英文其他项：</span></td>
              <td colspan="2" align="left" valign="middle" class="bline">来源：<input name="en_from" type="text" class="main" id="en_from" value="<%=rs("en_from")%>" size="15" maxlength="20"> 作者：<input name="en_author" type="text" class="main" id="en_author" value="<%=rs("en_author")%>" size="18">
                时间：
                <input name="en_addtime" type="text" class="main" id="en_addtime" value="<%=rs("en_addtime")%>" size="15" maxlength="20"> 点击：<input name="en_hit" type="text" class="main" id="en_hit" value="<%=rs("en_hit")%>" size="18"></td>
            </tr>
			<tr class="bline">
			  <td height="30" align="right" valign="middle" class="bline"><span class="t3">中文关键字：</span></td>
			  <td height="30" colspan="3" align="left" valign="middle" class="bline"><input name="key" type="text" class="main" id="key" value="<%=rs("key")%>" size="50" maxlength="250"></td> 
			  </tr>
			<tr class="bline">
			  <td height="30" align="right" valign="middle" class="bline"><span class="t3">英文关键字：</span></td>
			  <td height="30" colspan="3" align="left" valign="middle" class="bline"><input name="en_key" type="text" class="main" id="en_key" value="<%=rs("en_key")%>" size="50" maxlength="250"></td> 
			  </tr>
			<tr class="bline">
              <td height="30" align="right" valign="middle" class="bline"><span class="t3">中文产品描述：</span></td>
              <td height="30" colspan="3" align="left" valign="middle" class="bline"><input name="des" type="text" class="main" id="des" value="<%=rs("des")%>" size="100" maxlength="250"></td> 
			</tr>
			<tr class="bline">
              <td height="30" align="right" valign="middle" class="bline"><span class="t3">英文产品描述：</span></td>
              <td height="30" colspan="3" align="left" valign="middle" class="bline"><input name="en_des" type="text" class="main" id="en_des" value="<%=rs("en_des")%>" size="100" 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"><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" value="<%=rs("img")%>"></td>
             
              <td width="200" align="left" valign="middle" class="bline"><img src="<%=rs("img")%>" width="200" height="100"></td>
            </tr>
            <tr>
              <td height="120" align="right" valign="middle" class="bline"><span class="t3">英文上传图片：</span></td>
              <td width="47%" height="120" align="left" valign="middle" 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" value="<%=rs("en_img")%>"></td>
              <td width="200" align="left" valign="middle" class="bline"><img src="<%=rs("en_img")%>" width="200" height="100"></td>
            </tr>
            <tr>
              <td width="11%" height="30" align="right" valign="middle" class="bline"><span class="t3">中文新闻内容：</span></td>
              <td colspan="2" align="left" valign="middle" class="bline">
                <p>
 <textarea  id="info" name="info" style="width:900px;height:530px;"> 
<%=rs("info")%>
</textarea>          </p>                </td>
            </tr>
            <tr>
              <td width="11%" height="30" align="right" valign="middle" class="bline"><span class="t3">英文新闻内容：</span></td>
              <td colspan="2" align="left" valign="middle" class="bline">
                <p>
  <textarea  id="en_info" name="en_info" style="width:900px;height:530px;"> 
<%=rs("en_info")%>
</textarea>       </p>                </td>
            </tr>
            <tr>
              <td height="50" colspan="3" align="center" valign="middle"><input name="Submit" type="submit" class="inputbut" value="修改">
                &nbsp;
                <input name="Submit2" type="reset" class="inputbut" value="返回" onClick="history.back()"></td>
              </tr>
			</form>
          </table>
                
        </td>
        </tr>
      
    </table></td>
  </tr>
</table>
</body>
</html>
<%
end if
%>