<%@language=vbscript codepage=936 %>
<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<!-- #include file="Inc/Head.asp" -->
<%
if request("no")="modi" then
newsid=request("newsid")
title=request("title")
BigClassID=request("BigClassID")
Content=request("Content")
ly=request("ly")
img=request("img")
ok=request("ok")

set rss=server.createobject("adodb.recordset")
sql="select * from BigClass_New where BigClassID="&BigClassID&""
rss.open sql,conn,1,1
BigClassName=rss("BigClassName")

set rs=server.createobject("adodb.recordset")
sql="select * from NEWS where id="&newsid
rs.open sql,conn,1,3
rs("title")=title
rs("content")=content
rs("ly")=ly
rs("img")=img
rs("ok")=ok
rs("BigClassID")=BigClassID
rs("BigClassName")=BigClassName

rs.update
rs.close
rss.close
set rs=nothing
response.write "<script language='javascript'>" & chr(13)
		response.write "alert('修改成功！');" & Chr(13)
		response.write "window.document.location.href='News_Manage.asp';"&Chr(13)
		response.write "</script>" & Chr(13)
Response.End
end if%>
<script language = "JavaScript">
 
function CheckForm()
{
     document.addNEWS.cnWords.value = document.frames.cnEditBox.getHTML(true);     
     document.addNEWS.imageNum.value = document.frames.cnEditBox.document.all("editImageNum").value;
     document.addNEWS.editFirstImageName.value = document.frames.cnEditBox.document.all("editFirstImageName").value;

	if (document.addNEWS.title.value.length == 0) {
		alert("标题没有填写.");
		document.addNEWS.title.focus();
		return false;
	}
	return true;
}
</script>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top"><% 
newsid=request("id")
Set rso=Server.CreateObject("ADODB.RecordSet") 
sql="select * from NEWS where  id="&newsid
rso.Open sql,conn,1,1
if rso.eof and rso.bof then
response.Write("没有记录")
else
%> 
      <br /><table  width="750" border="0" cellpadding="2" cellspacing="1" class="table_southidc">
        <form name="addNEWS" method="post" action="News_modi.asp?no=modi" onSubmit="return CheckForm();">
          <tr align="center"> 
            <td class="back_southidc" height="30" colspan="2">修改信息</td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td width="100" align="center"><font color="#FF0000">* </font>标 题：</td> 
            <td width="78%" valign="top"><input name="title" type="text" class="input" value="<%=rso("title")%>" size="30"></td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td align="center"><font color="#FF0000">* </font>类 别：</td> 
            <td valign="top"><%
		set rs=server.createobject("adodb.recordset") 			
        sql = "select * from BigClass_New where BigClassName<>'精品兰苑' and BigClassName<>'兰家风采'"
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加栏目。"
		else
		%> <select name="BigClassID" id="BigClassID">
                <%do while not rs.eof%>
                <option <% if rs("BigClassID")=rso("BigClassID") then response.Write("selected") end if%> value="<%=trim(rs("BigClassID"))%>"><%=trim(rs("BigClassName"))%></option>
                <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
              </select></td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td align="center" valign="top"><font color="#FF0000">* </font>内 容：</td> 
            <td valign="top"> 
			  <textarea name="content" style="display:none"><%=rso("Content")%></textarea>
			 <iframe id="eWebEditor1" src="ewebeditor.asp?id=content&style=s_coolblue1" frameborder="0" scrolling="No" width="650" height="350"></iframe>		    </td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td align="center">来 源：</td> 
            <td valign="top"><input name="ly" type="text" class="input" id="ly" value="<%=rso("ly")%>" size="30">            </td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td rowspan="2" align="center"><font color="#FF0000">*</font> 首页幻灯片<br>
              图片上传：</td>
            <td height="30"><input name="img" type="text" id="img" value="<%=rso("img")%>" size="50"></td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td height="12"><iframe style="top:2px" id="UploadFiles" src="../upload_zjf.asp?PhotoUrlID=3" frameborder=0 scrolling=no width="300" height="25"></iframe></td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td align="center">是否显示图片：</td>
            <td height="12"><% if rso("ok")=0 then %>
              <input type="radio" name="ok" value="1">
是
<input name="ok" type="radio" value="0" checked>
否
<%elseif rso("ok")=1 then %>
<input type="radio" name="ok" value="1" checked>
是
<input name="ok" type="radio" value="0">
否
<%end if%></td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td align="center">&nbsp;</td>
            <td valign="top">&nbsp;</td>
          </tr>
          <tr align="center" bgcolor="#ECF5FF"> 
            <td height="35" colspan="2"> 
              <input type="submit" name="Submit" value="提交" class="input"> 
              <input type="hidden" name="newsId" value="<%=newsId%>"> 
              <input type="reset" name="Submit2" value="重置" class="input">            </td>
          </tr>
        </form>
      </table>
      <% End If
rso.close
set rso=nothing
 %></td>
  </tr>
</table>
<!-- #include file="Inc/Foot.asp" -->