<!--#include file="../conn/conn_other.asp"-->
<!--#include file="check.asp"-->
<%
	useflag=1
%>
<!--#include file="flag.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	end if
	action=Trim(Request.Form("action"))
	
	if action="edit" then
		id=int(Trim(Request("id")))
		title=Trim(Request("title"))						'标题题目
		zhuangtai=Trim(Request("zhuangtai"))
		content=trim(request("content")) 
		
		if title ="" or content="" then
			response.write"<SCRIPT language=JavaScript>alert('请填写完整关于我们的标题和内容！');"
			response.write"javascript:history.go(-1)</SCRIPT>"
			response.end
		end if
		if id=0 then
			response.write"<SCRIPT language=JavaScript>alert('无法找到您需要的信息，请与程序开发者联系！');"
			response.write"javascript:history.go(-1)</SCRIPT>"
			response.end
		end if
		set rs=server.createobject("adodb.recordset")
		sql="select * from aboutus where id="&id&""
		rs.open sql,conn,2,3
		rs("title")=title
		rs("zhuangtai")=zhuangtai
		rs("content")=content
		rs("stime")=date()
		rs.update
		rs.close
		set rs=nothing
		response.write"<script language=JavaScript>alert('关于我们信息添加成功');"    
		response.write"this.location.href='aboutus_all.asp';</script>"
		response.End
	end if
	id=int(Trim(Request.QueryString("id")))
	if id=0 then
		response.write"<SCRIPT language=JavaScript>alert('您的操作有误，请重来！');"
		response.write"javascript:history.go(-1)</SCRIPT>"
		response.end
	end if
	set rs=server.createobject("adodb.recordset")
	sql="select * from aboutus where id="&id&""
	rs.open sql,conn,1,1
	if rs.eof then
		response.write"<SCRIPT language=JavaScript>alert('无法找到您需要的信息，请与程序开发者联系！');"
		response.write"javascript:history.go(-1)</SCRIPT>"
		response.end
	else
%>
<HTML>
<HEAD>
<TITLE>修改<%= rs("title") %>内容</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<link href='Include/Admin_Style.CSS' rel='stylesheet' type='text/css'>
</HEAD>
<body topmargin="0">
<table width="100%" border="3" cellpadding="1" align="center" bordercolor="#FFFFFF" cellspacing="0">
  <tr>
    <td>
      <FORM name="searchForm" action="?" method="post">
	  <input name="id" type="hidden" value="<%= Trim(Request.QueryString("id")) %>">
	  <input name="action" type="hidden" value="edit">
        <TABLE width="100%" border="0" align=center cellpadding="0" cellspacing="1"  class="sortbutton">
          <tr>
            <td height=25 colspan="2" align="center"><b>修改<%= rs("title") %>内容</b></td>
          </tr>
          <TR ALIGN="center">
            <TD>
	<TABLE width="100%" border="0" cellpadding="5" cellspacing="2" bordercolorlight="#CEE7FF" bordercolordark="#CEE7FF" style="border-collapse: collapse">
                <TR>
                  <TD width="131" align="right"><b>信息标题：</b></td>
                  <TD width="739" valign="middle"><input type="text" name="title" class="smallInput" size="50" value="<%= rs("title") %>"></TD>
                </TR>
                <TR>
                  <TD align="right"><b>是否显示：</b></td>
                  <TD valign="middle"><input type="radio" name="zhuangtai" id="zhuangtai" value="0" <% If int(rs("zhuangtai"))=0 Then Response.Write("checked")%>>
                    显示 
                      <input type="radio" name="zhuangtai" id="zhuangtai" value="1" <% If int(rs("zhuangtai"))=1 Then Response.Write("checked")%>>
                    隐藏</TD>
                </TR>
                <TR>
                  <TD align="right"><b>详细信息：</b></TD>
                  <TD><textarea name="content" style="display:none"><%= rs("content") %></textarea>
                     <iframe ID="eWebEditor1" src="editor/ewebeditor.asp?id=content" frameborder="0" scrolling="no" width="617" HEIGHT="450"></iframe></TD>
                </TR>
				<TR height="40">
                  <TD colspan="2" align="center" height="40"><input type="submit" name="Submit" value=" 提　交 保 存">
                  &nbsp;&nbsp;&nbsp;<input type="reset" name="Submit2" value=" 重　新 添 写"></TD></TR>
            </TABLE></TD>
          </TR>
        </TABLE>
      </form>
    </td>
  </tr>
</table>
</BODY>
</HTML>
<%
	end if
	rs.close
	set rs=nothing
	call closeconn()
%>
