<!--#include file="inc/right.asp"--> 
<!--#include file="inc/conn.asp"-->
<%
action=Request("action")
id=Request("id")
if action="yes" Then
 set rs=server.createobject("adodb.recordset") 
 sql="select * from site where id=1" 
 rs.open sql,conn,1,2
 rs("SiteName")=Request.Form("SiteName")
 rs("ys")=Request.Form("ys")
 rs("Description")=Request.Form("content")
 rs("Copyright")=Request.Form("Copyright")
 rs.update
 rs.close
set rs=nothing
 response.write"<script language=JavaScript>alert('操作成功！');"
 response.write"location.href='SiteConfig.asp?action=edit'</script>"
end if
%>
<html>
<head>
<title><%=sysConfig%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/main.css" rel="stylesheet" type="text/css">
<script LANGUAGE="JavaScript">
function check()
{
  if (document.add.SiteName.value=="")
     {
      alert("请填写预约名称！")
      document.add.SiteName.focus()
      document.add.SiteName.select()
      return
     }
 
  if (document.add.content.value=="")
     {
      alert("请填写基本说明！")
      document.add.content.focus()
      document.add.content.select()
      return
     }
 
  if (document.add.Copyright.value=="")
     {
      alert("请填写版权信息！")
      document.add.Copyright.focus()
      document.add.Copyright.select()
      return
     }
	 
     document.add.submit()
}
</script>
<script charset="utf-8" src="../Editor/kindeditor.js"></script>
<script charset="utf-8" src="../Editor/lang/zh_CN.js"></script>
<script charset="utf-8" src="../Editor/plugins/code/prettify.js"></script>
<script>
KindEditor.ready(function(K) {
	var editor = K.create('textarea[name="content"]', {
        cssPath : '../Editor/plugins/code/prettify.css',
		uploadJson : '../Editor/upload_json.asp',
		fileManagerJson : '../Editor/file_manager_json.asp',
		allowFileManager : true,
		afterBlur : function() {
		this.sync();
		K.ctrl(document, 13, function() {
		K('form[name=add]')[0].submit();
		});
		K.ctrl(this.edit.doc, 13, function() {
		K('form[name=add]')[0].submit();
		});
		}
	});
		prettyPrint();
});
</script>
</head>
<body>
<%if action="edit" then
set rs=server.createobject("adodb.recordset") 
Tid=Request("id")
sql="select * from site where id=1"
rs.open sql,conn,1,1
if not rs.eof Then
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td bgcolor="#FFFFFF"><br>
      <form name="add" method="post" action="SiteConfig.asp">
      <table width="96%"  border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#aec3de">
		<tr align="center" bgcolor="#F2FDFF">
          <td width="100%" class="optiontitle" colspan="2">页面信息设置</td>	
        </tr>
        <tr> 
          <td align="right" bgcolor="#FFFFFF">页面名称：</td>
          <td bgcolor="#FFFFFF"><input name="SiteName" type="text" id="SiteName" value="<%=rs("SiteName")%>" size="40" maxlength="50"></td>
        </tr>
        <tr> 
          <td align="right" bgcolor="#FFFFFF">预约开关：</td>
          <td bgcolor="#FFFFFF"><input name="ys" type="radio" value="1"<%if rs("ys")=1 then Response.Write("checked") end if%>>开
          <input name="ys" type="radio" value="0"<%if rs("ys")=0 then Response.Write("checked") end if%>> 关</td>
        </tr>
        <tr> 
         <td align="right" bgcolor="#FFFFFF">基本说明：</td>
         <td bgcolor="#FFFFFF"><textarea id="editor_id" name="content" cols="100" rows="8" style="width:680px;height:300px;"><%=Server.HTMLEncode(rs("Description"))%></textarea></td>
        </tr>
        <tr> 
         <td align="right" bgcolor="#FFFFFF">版权信息：</td>
         <td bgcolor="#FFFFFF"><textarea name="Copyright" cols="110" rows="3" id="Copyright"><%=rs("Copyright")%></textarea></td>
        </tr>
        <tr> 
         <td colspan="2" align="center" bgcolor="#FFFFFF">
            <input type="hidden" name="action" value="yes">
          <input type="button" name="Submit2" value="提交" onClick="check()">
          <input type="button" name="Submit2" value="返回" onClick="history.back(-1)">
		  <input name="id" type="hidden" id="id" value="<%=rs("id")%>">	</td>
       </tr>
      </table>
</form>
    </td>
  </tr>
</table>
<%
end if
end if
%>  
</body>
</HTML>