<!--#include file="conn.asp"-->
<%
if session("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');history.go(-1);</script>"
response.End
else
if request.cookies("timesshop")("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');history.go(-1);</script>"
response.End
end if
end if
if session("rank")>1 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你无权管理网站设置！');history.go(-1);</script>"
response.End
end if

dim action
action=trim(request.form("action"))
if action="save" then
set rs=server.CreateObject("adodb.recordset")
rs.Open "select webname,musicid,musicurl,webemail,address,postcode,tel,qq,copyright,weblogo,weburl,webbanner,bigbanner,bgclr1,bgclr2,bgclr3,bgclr4,bgclr5,bgclr6,bgclr7,bgclr8,webimg1,webimg2,webimg3,webimg4,webimg5,webimg12,webbj1,webbj2 from config ",conn,1,3
rs("webname")=trim(request.form("webname"))
rs("webemail")=trim(request.form("webemail"))
rs("address")=trim(request.form("address"))
rs("postcode")=trim(request.form("postcode"))
rs("tel")=trim(request.form("tel"))
rs("qq")=trim(request.form("qq"))
rs("copyright")=trim(request.form("copyright"))
rs("weblogo")=trim(request.form("weblogo"))
rs("webbanner")=trim(request.form("webbanner"))
rs("bigbanner")=trim(request.form("bigbanner"))
rs("bgclr1")=trim(request.form("bgclr1"))
rs("bgclr2")=trim(request.form("bgclr2"))
rs("bgclr3")=trim(request.form("bgclr3"))
rs("bgclr4")=trim(request.form("bgclr4"))
rs("bgclr5")=trim(request.form("bgclr5"))
rs("bgclr6")=trim(request.form("bgclr6"))
rs("bgclr7")=trim(request.form("bgclr7"))
rs("bgclr8")=trim(request.form("bgclr8"))
rs("webimg1")=trim(request.form("webimg1"))
rs("webimg2")=trim(request.form("webimg2"))
rs("webimg3")=trim(request.form("webimg3"))
rs("webimg4")=trim(request.form("webimg4"))
rs("webimg5")=trim(request.form("webimg5"))
Dim strIntro
For i = 1 To Request.Form("webimg12").Count 
strIntro = strIntro & Request.Form("webimg12")(i) 
Next 
rs("webimg12")=strIntro
rs("webbj1")=trim(request.form("webbj1"))
rs("webbj2")=trim(request.form("webbj2"))
rs("weburl")=trim(request.form("weburl"))
rs("musicurl")=trim(request.form("musicurl"))
rs("musicid")=request.form("musicid")
rs.update
rs.close
set rs=nothing
response.Write "<script language=javascript>alert('网站资料修改成功！');history.go(-1);</script>"
end if%>
<title>网站设置</title>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#6699cc">
  <tr> 
    <td height="16"> <div align="center"><font color="#FFFFFF">
        <SCRIPT LANGUAGE="javascript">
                function foreColor(n)
{
  var arr = showModalDialog("selcolor.html", "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0");
  if(arr==null)return;
  if(n==null)return;
  if(n==1){form1.table_title_color.value=arr;}
  if(n==2){form1.table_topic_light_color.value=arr;}
  if(n==3){form1.table_topic_dark_color.value=arr;}
  if(n==4){form1.table_border_color.value=arr;}
  if(n==5){form1.forum_bgcolor.value=arr;}
  if(n==6){form1.text_color.value=arr;}
  if(n==7){form1.textt_color.value=arr;}
  if(n==8){form1.textb_color.value=arr;}
  changecolor();
}</SCRIPT>
        <SCRIPT LANGUAGE="vbscript">
                public function changecolor()
                color1.bgcolor=form1.table_title_color.value
                color2.bgcolor=form1.table_topic_light_color.value
                color3.bgcolor=form1.table_topic_dark_color.value
                color4.bgcolor=form1.table_border_color.value
                color5.bgcolor=form1.forum_bgcolor.value
		color6.bgcolor=form1.text_color.value
		color7.bgcolor=form1.textt_color.value
		color8.bgcolor=form1.textb_color.value
                end function
                </SCRIPT>
        网站信息设置</font></div></td>
  </tr>
  <tr> 
    <td height="107" valign="top" bgcolor="#FFFFFF"> <table width="100%" border="0" align="center" cellpadding="3" cellspacing="0">
        <form name="form1" method="post" action="config.asp?action=save">
          <%set rs=server.CreateObject("adodb.recordset")
            rs.Open "select webname,musicurl,musicid,webemail,address,postcode,tel,qq,copyright,weblogo,weburl,webbanner,bigbanner,bgclr1,bgclr2,bgclr3,bgclr4,bgclr5,bgclr6,bgclr7,bgclr8,webimg1,webimg2,webimg3,webimg4,webimg5,webimg12,webbj1,webbj2 from config",conn,1,1%>
          <tr> 
            <td COLSPAN="3"><DIV ALIGN="CENTER"><strong><font size="2">基本信息</font></strong></DIV></td>
          </tr>
          <tr> 
            <td width="16%">网站网址：</td>
            <td COLSPAN="2"><INPUT NAME="weburl" TYPE="text" ID="weburl" SIZE="28" VALUE="<%=trim(rs("weburl"))%>"></td>
          </tr>
          <tr> 
            <td>网站名称：</td>
            <td COLSPAN="2"> <input name="webname" type="text" id="webname" size="28" value="<%=trim(rs("webname"))%>"> 
            </td>
          </tr>
          <tr> 
            <td>网站Email：</td>
            <td COLSPAN="2"> <input name="webemail" type="text" id="webemail" size="28" value="<%=trim(rs("webemail"))%>"> 
            </td>
          </tr>
          <tr> 
            <td>公司地址：</td>
            <td COLSPAN="2"> <input name="address" type="text" id="address" size="28" value="<%=trim(rs("address"))%>"> 
            </td>
          </tr>
          <tr> 
            <td>公司邮编：</td>
            <td COLSPAN="2"> <input name="postcode" type="text" id="postcode" size="28" value="<%=trim(rs("postcode"))%>"	onKeyPress	= "return regInput(this,	/^[0-9]*$/,		String.fromCharCode(event.keyCode))"
		onpaste		= "return regInput(this,	/^[0-9]*$/,		window.clipboardData.getData('Text'))"
		ondrop		= "return regInput(this,	/^[0-9]*$/,		event.dataTransfer.getData('Text'))"
		> </td>
          </tr>
          <tr> 
            <td>公司电话：</td>
            <td COLSPAN="2"> <input name="tel" type="text" id="tel" size="28" value="<%=trim(rs("tel"))%>"> 
            </td>
          </tr>
          <tr> 
            <td>联系 <strong>QQ</strong>：</td>
            <td COLSPAN="2"><input name="qq" type="text" id="qq" size="28" value="<%=trim(rs("qq"))%>"></td>
          </tr>
          <tr> 
            <td>网站版权：</td>
            <td COLSPAN="2"> <input name="copyright" type="text" size="28" value="<%=trim(rs("copyright"))%>"> 
            </td>
          </tr>
          <tr> 
            <td valign="top">公司简介：</td>
            <td COLSPAN="2"> <INPUT type="hidden" name="webimg12" value="<% = Server.HtmlEncode(rs("webimg12")) %>">	
              <iframe ID="webimg12" src="htmledit/ewebeditor.asp?id=webimg12&style=standard" frameborder="0" scrolling="no" width="550" HEIGHT="350"></iframe> 
            </td>
          </tr>
          <tr> 
            <td height="5" COLSPAN="3">&nbsp; </td>
          </tr>
          <tr> 
            <td height="0" COLSPAN="3"><DIV ALIGN="CENTER"><strong><font size="2">颜色配置</font></strong></DIV></td>
          </tr>
          <tr> 
            <TD>表格背景</TD>
            <td colspan="2"><INPUT NAME="bgclr1" TYPE="text" ID="bgclr1" SIZE="28" VALUE="<%=trim(rs("bgclr1"))%>"> 
              <A HREF="#" ONCLICK=foreColor(1)><IMG SRC=../images/cgcolor.gif ALT="调色板" BORDER="0" WIDTH="9" HEIGHT="10"></A></td>
          </tr>
          <tr> 
            <TD>深色表格 </TD>
            <td colspan="2"><INPUT NAME="bgclr2" TYPE="text" ID="bgclr2" SIZE="28" VALUE="<%=trim(rs("bgclr2"))%>"> 
              <A HREF="#" ONCLICK=foreColor(1)><IMG SRC=../images/cgcolor.gif ALT="调色板" BORDER="0" WIDTH="9" HEIGHT="10"></A></td>
          </tr>
          <tr> 
            <TD>浅色表格 </TD>
            <td colspan="2"><INPUT NAME="bgclr3" TYPE="text" ID="bgclr3" SIZE="28" VALUE="<%=trim(rs("bgclr3"))%>"> 
              <A HREF="#" ONCLICK=foreColor(1)><IMG SRC=../images/cgcolor.gif ALT="调色板" BORDER="0" WIDTH="9" HEIGHT="10"></A></td>
          </tr>
          <tr> 
            <TD>主体颜色 </TD>
            <td colspan="2"><INPUT NAME="bgclr4" TYPE="text" ID="bgclr4" SIZE="28" VALUE="<%=trim(rs("bgclr4"))%>"> 
              <A HREF="#" ONCLICK=foreColor(1)><IMG SRC=../images/cgcolor.gif ALT="调色板" BORDER="0" WIDTH="9" HEIGHT="10"></A></td>
          </tr>
          <tr> 
            <td height="11" COLSPAN="3"><DIV ALIGN="CENTER"><font size="2"><strong>图片设置</strong></font></DIV></td>
          </tr>
          <tr> 
            <td height="11">网站Logo：</td>
            <td height="0" WIDTH="28%"><INPUT NAME="weblogo" TYPE="text" ID="weblogo" SIZE="28" VALUE="<% = rs("weblogo") %>"></td>
            <td height="0" WIDTH="56%"><input type="button" name="Submit12" value="上传图片" onClick="window.open('upfile.asp?formname=form1&editname=weblogo&uppath=images/guanggao&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')"></td>
          </tr>
          <tr> 
            <td height="22" colspan="3"> <div align="center"> 
                <input type="submit" name="Submit" value="提 交">
                <input name="action" type="hidden" value="save">
                &nbsp;&nbsp; 
                <input type="reset" name="Submit2" value="恢 复">
              </div></td>
          </tr>
        </form>
      </table>
      <%rs.Close
          set rs=nothing
		  conn.close
		  set conn = Nothing %>
    </td>
  </tr>
</table>
<!--#include file="footer.asp"--> 
</body>
</html>
<script>
	function regInput(obj, reg, inputStr)
	{
		var docSel	= document.selection.createRange()
		if (docSel.parentElement().tagName != "INPUT")	return false
		oSel = docSel.duplicate()
		oSel.text = ""
		var srcRange	= obj.createTextRange()
		oSel.setEndPoint("StartToStart", srcRange)
		var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
		return reg.test(str)
	}
</script>
