<!--#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
if Not isNumeric(request.form("webbj6")) then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('积分转预存款的比例必须是数字！');history.go(-1);</script>"
response.End
end if
if Not isNumeric(request.form("webbj5")) then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('购物免邮费设置必须是数字！');history.go(-1);</script>"
response.End
end if
if Not isNumeric(request.form("webimg9")) then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('小图片大小的宽度必须是数字！');history.go(-1);</script>"
response.End
end if
if Not isNumeric(request.form("webimg10")) then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('小图片大小的高度必须是数字！');history.go(-1);</script>"
response.End
end if
if Not isNumeric(request.form("webimg7")) then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('注册送积分数必须是数字！');history.go(-1);</script>"
response.End
end if
if Not isNumeric(request.form("webimg13")) then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('推荐人奖励积分必须是数字！');history.go(-1);</script>"
response.End
end if

set rs=server.CreateObject("adodb.recordset")
rs.Open "select webimg7,webimg13,webimg9,webimg10,webbj3,webbj4,webbj5,webbj6,webbj7,webbj8,webbj9,webimg6 from config ",conn,1,3
rs("webimg7")=trim(request.form("webimg7"))
rs("webimg13")=trim(request.form("webimg13"))
rs("webimg9")=trim(request.form("webimg9"))
rs("webimg10")=trim(request.form("webimg10"))
rs("webbj3")=trim(request.form("webbj3"))
rs("webbj4")=trim(request.form("webbj4"))
rs("webbj5")=trim(request.form("webbj5"))
rs("webbj6")=trim(request.form("webbj6"))
rs("webbj7")=trim(request.form("webbj7"))
rs("webbj8")=trim(request.form("webbj8"))
rs("webbj9")=trim(request.form("webbj9"))
rs("webimg6")=trim(request.form("webimg6"))
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">
        网站高级设置</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="setup.asp">
          <%set rs=server.CreateObject("adodb.recordset")
            rs.Open "select webimg6,webimg7,webimg13,webimg9,webimg10,webbj3,webbj4,webbj5,webbj6,webbj7,webbj8,webbj9 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%" height="20">商品小图宽度：</td>
            <td COLSPAN="2"><INPUT NAME="webimg9" TYPE="text" ID="webimg9" SIZE="28" VALUE="<% = rs("webimg9") %>"></td>
          </tr>
          <tr> 
            <td height="20">商品小图高度：</td>
            <td COLSPAN="2"><INPUT NAME="webimg10" TYPE="text" ID="webimg10" SIZE="28" VALUE="<% = rs("webimg10") %>"></td>
          </tr>
          <tr> 
            <td height="22">免邮费设置：</td>
            <td height="22" colspan="2"><INPUT NAME="webbj5" TYPE="text" ID="webbj5" SIZE="28" VALUE="<% = rs("webbj5") %>">
              （购物满多少免附加邮费，设置成0表示关闭此功能）</td>
          </tr>
          <tr> 
            <td height="20">积分转预存款比例：</td>
            <td COLSPAN="2"><INPUT NAME="webbj6" TYPE="text" ID="webbj6" SIZE="28" VALUE="<% = rs("webbj6") %>"></td>
          </tr>
          <tr> 
            <td height="20">是否允许匿名购物：</td>
            <td COLSPAN="2"><select name="webimg6" id="webimg6">
				<option value="0" <% if rs("webimg6")="0" Then Response.write("Selected") %>>关闭</option>
			    <option value="1" <% if rs("webimg6")="1" Then Response.write("Selected") %>>允许</option>
              </select>
			</td>
          </tr>
		   <tr> 
            <td height="20">注册送积分：</td>
            <td COLSPAN="2"><INPUT NAME="webimg7" TYPE="text" ID="webimg7" SIZE="28" VALUE="<% = rs("webimg7") %>"></td>
          </tr>
		   <tr> 
            <td height="20">推荐人奖励积分：</td>
            <td COLSPAN="2"><INPUT NAME="webimg13" TYPE="text" ID="webimg13" SIZE="28" VALUE="<% = rs("webimg13") %>"></td>
          </tr>
          <tr> 
            <td colspan="3" align="center"><font size="2"><strong>邮件设置(服务器要支持相应的邮件组件才能正常发信)</strong></font></td>
          </tr>
          <tr> 
            <td height="22">邮件服务器地址：</td>
            <td width="28%" height="22"><INPUT NAME="webbj7" TYPE="text" ID="webbj7" SIZE="28" VALUE="<% = rs("webbj7") %>"></td>
            <td width="56%" height="22">&nbsp;</td>
          </tr>
          <tr> 
            <td height="22">邮件登录用户名：</td>
            <td height="22"><INPUT NAME="webbj8" TYPE="text" ID="webbj8" SIZE="28" VALUE="<% = rs("webbj8") %>"></td>
            <td height="22">&nbsp;</td>
          </tr>
          <tr> 
            <td height="22">邮件登录密码：</td>
            <td height="22"><strong> 
              <INPUT NAME="webbj9" TYPE="password" ID="webbj9" SIZE="28" VALUE="<% = rs("webbj9") %>">
              </strong></td>
            <td height="22">&nbsp;</td>
          </tr>
		            <tr> 
            <td height="22">邮件附加的签名：</td>
            <td height="22"><INPUT NAME="webbj3" TYPE="text" ID="webbj3" SIZE="28" VALUE="<% = rs("webbj3") %>"></td>
            <td height="22">&nbsp;</td>
          </tr>
		            <tr> 
            <td height="22">使用的邮件组件：</td>
            <td height="22"><select name="webbj4" id="webbj4">
				<option value="Nothing" <% if rs("webbj4")="Nothing" Then Response.write("Selected") %>>关闭</option>
			    <option value="Jmail" <% if rs("webbj4")="Jmail" Then Response.write("Selected") %>>Jmail</option>
                <option value="CDONTS" <% if rs("webbj4")="CDONTS" Then Response.write("Selected") %>>CDONTS</option>
              </select></td>
            <td height="22">&nbsp;</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>
