
<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<!--#include file="../Inc/Ubbcode.asp"-->
<!--#include file="Inc/Function.asp"-->
<html>
<link href="../images/css.css" rel="stylesheet" type="text/css">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<%


Dim htmlData

htmlData = Request.Form("content")

Function htmlspecialchars(str)
	str = Replace(str, "&", "&amp;")
	str = Replace(str, "<", "&lt;")
	str = Replace(str, ">", "&gt;")
	str = Replace(str, """", "&quot;")
	htmlspecialchars = str
End Function
%>
<script charset="utf-8" src="../kindeditor.js"></script>
<script charset="utf-8" src="../lang/zh_CN.js"></script>
<script>
        var editor;
        KindEditor.ready(function(K) {
                editor = K.create('#content', {
                        resizeType : 2,
							allowFileManager : true,
							fileManagerJson : '../asp/file_manager_json.asp',
                        uploadJson : '../upload_json.asp' // 相对于当前页面的路径
                });
        });
		
		
		
		html = editor.html();


  editor.sync();

  html = document.getElementById('content').value; // 原生API

  html = K('#content').val(); // KindEditor Node API

  html = $('#content').val(); // jQuery

  
  // 设置HTML内容

  editor.html('');




</script>
</head>

<body topmargin="0" leftmargin="0" rightmargin="0">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="52"><img src="images/main_1.jpg" width="52" height="55"></td>
        <td background="images/main_2.jpg" class="title1"><strong>修改新闻</strong></td>
        <td width="52"><img src="images/main_3.jpg" width="52" height="55"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="15" background="images/main_4.gif">&nbsp;</td>
        <td class="td">
 
<%
dim ID,rs_news,FoundErr,ErrMsg
dim sql
dim count
ID=trim(request("ID"))
FoundErr=False
if ID="" then 
	response.Redirect("News_Manage.asp")
end if
sql="select * from News where ID=" & ID & ""
Set rs_news= Server.CreateObject("ADODB.Recordset")
rs_news.open sql,conn,1,1
if FoundErr=True then
	call WriteErrMsg()
else
%>
<%
set rs=server.createobject("adodb.recordset")
sql = "select * from SmallClass_New order by SmallClassID asc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
        <%
        count = 0
        do while not rs.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("SmallClassName"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.myform.SmallClassName.length = 1; 
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.myform.SmallClassName.options[document.myform.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
    }    

function AddItem(strFileName){
  document.myform.IncludePic.checked=true;
  document.myform.DefaultPicUrl.value=strFileName;
  document.myform.DefaultPicList.options[document.myform.DefaultPicList.length]=new Option(strFileName,strFileName);
  document.myform.DefaultPicList.selectedIndex+=1;
  if(document.myform.UploadFiles.value==''){
	document.myform.UploadFiles.value=strFileName;
  }
  else{
    document.myform.UploadFiles.value=document.myform.UploadFiles.value+"|"+strFileName;
  }
}
  
function CheckForm()
{
   if (editor.EditMode.checked==true)
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerText;
   else
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerHTML; 

	if (document.myform.title.value.length == 0) {
		alert("新闻标题没有填写.");
		document.myform.title.focus();
		return false; 
	}
		if (document.myform.user.value.length == 0) {
		alert("新闻发布人没有填写");
		document.myform.user.focus();
		return false;
	}
	return true;
}
</script>
<!-- #include file="Inc/Head.asp" -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top">
      <table  width="100%" border="0" cellpadding="2" cellspacing="1" class="table_southidc">
        <form method="POST" name="myform" action="News_save.asp?action=Modify" target="_self"  onSubmit="javascript:editor.sync();">
          <tr bgcolor="#ECF5FF"> 
            <td width="20%" height="24" align="right"><div align="left"><font color="#FF0000">*</font>新 
                闻标题：</div></td>
            <td width="80%" valign="top">　 
              <div align="left">
                <input name="title" type="text" class="input" value="<%=rs_news("title")%>" size="50" maxlength="200">
              </div></td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
            <td height="24" align="right"><div align="left"><font color="#FF0000">*</font>新闻类别：</div></td>
            <td valign="top"> 　 
              <div align="left">
                <%			
        sql= "select * from BigClass_New"
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加栏目。"
		else
		%>
             <select name="BigClassName"  size="1">
                  <%
		    do while not rs.eof
			%>
                  <option <% if rs("BigClassName")=rs_news("BigClassName") then response.Write("selected") end if%> value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option>
                  <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
            </select>
              </div></td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
            <td align="right" valign="top"><div align="left"><font color="#FF0000">*</font>新闻内容：</div></td>
            <td valign="top">
		 <textarea id="content" name="content" cols="100" rows="8" style="width:700px;height:400px;visibility:hidden;"><%=htmlspecialchars(rs_news("content"))%></textarea>               		</td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
            <td height="24" align="right"><div align="left"><font color="#FF0000">*</font>发布人：</div></td>
            <td valign="top">
<div align="left">
                <input name="user" type="text" class="input" size="30" value="<%=rs_news("user")%>">
              </div></td>
          </tr>
          <tr align="center" bgcolor="#ECF5FF"> 
            <td height="35"><div align="left">录入时间：</div></td>
            <td height="35"><div align="left">
                <input name="AddDate" type="text" id="AddDate" value="<%=rs_news("AddDate")%>" maxlength="50">
              </div></td>
          </tr>
          <tr align="center" bgcolor="#ECF5FF"> 
		   <input type="hidden" name="Id" value="<%=Id%>">
            <td height="35" colspan="2"> <input type="submit" name="Submit" value="提交" class="input">          
              　 
              <input type="reset" name="Submit" value="重置" class="input"> </td>
          </tr>
        </form>
      </table>
  </td>
  </tr>
</table>
<!-- #include file="Inc/Foot.asp" -->
<%end if %>

  <!--#include file="foot.asp"--></td>
        <td width="15" background="images/main_5.gif">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="15" background="images/main_4.gif">&nbsp;</td>
        <td background="images/main_9.gif">&nbsp;</td>
        <td width="15" background="images/main_5.gif">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="52"><img src="images/main_6.gif" width="52" height="16"></td>
        <td background="images/main_7.gif" width="100%"></td>
        <td width="52"><img src="images/main_8.gif" width="52" height="16"></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
