<!--#include virtual="inc/General.inc.asp"-->
<%
CheckManageUser()
set rs = server.createobject("adodb.recordset")
rs.open "select * from Company",conn,1,3
if not rs.eof then
	if Request("Actions")="Edit" then
		WindowTitle = Request("WindowTitle")
		CompanyName = Request("CompanyName")
		Address = Request("Address")
		Post = Request("Post")
		Telphone = Request("Telphone")
		Fax = Request("Fax")
		Email = Request("Email")
		rs("WindowTitle") = WindowTitle
		rs("CompanyName") = CompanyName
		rs("Address") = Address
		rs("Post") = Post
		rs("Telphone") = Telphone
		rs("Fax") = Fax
		rs("Email") = Email
		rs.update
	else
		WindowTitle = rs("WindowTitle")
		CompanyName = rs("CompanyName")
		Address = rs("Address")
		Post = rs("Post")
		Telphone = rs("Telphone")
		Fax = rs("Fax")
		Email = rs("Email")
	end if
else
	if Request("Actions")="Edit" then
		WindowTitle = Request("WindowTitle")
		CompanyName = Request("CompanyName")
		Address = Request("Address")
		Post = Request("Post")
		Telphone = Request("Telphone")
		Fax = Request("Fax")
		Email = Request("Email")
		rs.AddNew
		rs("WindowTitle") = WindowTitle
		rs("CompanyName") = CompanyName
		rs("Address") = Address
		rs("Post") = Post
		rs("Telphone") = Telphone
		rs("Fax") = Fax
		rs("Email") = Email
		rs.update
	end if
end if
if Request("Actions")="Edit" then
	set fso = server.createobject("scripting.filesystemobject")
	if fso.FileExists(server.mappath("/js/Const.js"))=false then
		fso.CreateTextFile(server.mappath("/js/Const.js"))
	end if
	set file = fso.OpenTextFile(server.mappath("/js/Const.js"),2)
	file.writeline "var WindowTitle=""" & WindowTitle & """;"
	file.writeline "var CompanyName=""" & CompanyName & """;"
	file.writeline "var Address=""" & Address & """;"
	file.writeline "var Post=""" & Post & """;"
	file.writeline "var Telphone=""" & Telphone & """;"
	file.writeline "var Fax=""" & Fax & """;"
	file.writeline "var Email=""" & Email & """;"
	file.Close
	set file = nothing
	set fso = nothing
end if
rs.close
set rs=nothing
%>
<html>

<head>
<title>后台管理系统</title>
<link rel="stylesheet" href="../../css/main.css">
<script language="javascript" src="../../js/yzqm.js.asp"></script>
</head>

<body topmargin="0" leftmargin="0">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
	<td height="25" bgcolor="#EFEFEF" class="dtd" style="color:#FF6600">&nbsp;当前位置：信息设置</td>
  </tr>
  <tr>
	<td>
	  <table border="0" cellpadding="1" cellspacing="0" width="99%" align="right">
		<tr>
		  <td height="10"></td>
		</tr>
		<tr>
		  <td>
			<table border="0" cellpadding="1" cellspacing="1" width="50%" bgcolor="#CCCCCC">
			  <form name="CompanyForm" method="get" action="Company.asp">
			  <input type="hidden" name="Actions" value="Edit">
			  <tr height="23" bgcolor="#EFEFEF">
				<td width="30%" align="right">公司名称：</td>
				<td width="70%" bgcolor="#FFFFFF" class="entxt">&nbsp;<input type="text" name="CompanyName" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')" class="inbox" value="<%=CompanyName%>"></td>
			  </tr>
			  <tr height="23" bgcolor="#EFEFEF">
				<td align="right">网站标题：</td>
				<td bgcolor="#FFFFFF">&nbsp;<input type="text" name="WindowTitle" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')" class="inbox" value="<%=WindowTitle%>"></td>
			  </tr>
			  <tr height="23" bgcolor="#EFEFEF">
				<td align="right">地　　址：</td>
				<td bgcolor="#FFFFFF">&nbsp;<input type="text" name="Address" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')" class="inbox" value="<%=Address%>"></td>
			  </tr>
			  <tr height="23" bgcolor="#EFEFEF">
				<td align="right">邮政编码：</td>
				<td bgcolor="#FFFFFF">&nbsp;<input type="text" name="Post" onchange="this.value=this.value.replace(/\D/gi,'')" class="inbox" value="<%=Post%>"></td>
			  </tr>
			  <tr height="23" bgcolor="#EFEFEF">
				<td align="right">联系电话：</td>
				<td bgcolor="#FFFFFF">&nbsp;<input type="text" name="Telphone" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')" class="inbox" value="<%=Telphone%>"></td>
			  </tr>
			  <tr height="23" bgcolor="#EFEFEF">
				<td align="right">传　　真：</td>
				<td bgcolor="#FFFFFF">&nbsp;<input type="text" name="Fax" onchange="this.value=this.value.replace(/[^0-9\-\()]/gi,'')" class="inbox" value="<%=Fax%>"></td>
			  </tr>
			  <tr height="23" bgcolor="#EFEFEF">
				<td align="right">电子邮件：</td>
				<td bgcolor="#FFFFFF">&nbsp;<input type="text" name="Email" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')" class="inbox" value="<%=Email%>"></td>
			  </tr>
			  <tr height="33" bgcolor="#EFEFEF">
				<td colspan="4" align="center"><input type="submit" value=" 确定 ">　　　　<input type="reset" value=" 重置 "></td>
			  </tr>
			  </form>
			</table>
		  </td>
		</tr>
	  </table>
	</td>
  </tr>
</table>
</body>

<html>
<%set rs1=nothing
CloseConnection()%>