<%
if request.cookies("buyok")("admin")="" then response.write "<meta http-equiv='refresh' content='0;URL=../admin.asp'>"
%>
<!--#include file="../include/config.asp"-->
<script language=javascript src=../include/mouse.js></script>
 <%
sub checkmanage(str)
Set mrs = conn.Execute("select * from manage where username='"&request.cookies("buyok")("admin")&"'")
if not (mrs.bof and mrs.eof) then
manage=mrs("manage")
if instr(manage,str)<=0 then
response.write "<script language='javascript'>"
response.write "alert('警告：您没有此项操作的权限！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
else
session("buyok_admin_login")=0
end if
else 
response.write "<script language='javascript'>"
response.write "alert('没有登陆，不能执行此操作！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
end if
set mrs=nothing
end sub
%>
<%call checkmanage("01")%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../images/css.css" type=text/css rel=stylesheet>
<LINK href="../list/newhead.css" type=text/css rel=stylesheet>
</head>
<BODY bgcolor="#D9EAFC">
<%
action=request("ok")
if action="" then 
Set rs = conn.Execute("select * from bconfig") 
%>
<table height="5"><tr><td></td></tr></table>
<TABLE cellSpacing=0 cellPadding=0 width=95% border=0 style="BORDER-RIGHT: #b1bfee 1px solid; BORDER-TOP: #b1bfee 1px solid; BORDER-LEFT: #b1bfee 1px solid; BORDER-BOTTOM: #b1bfee 1px solid" 
>
  <TBODY>
    <TR>
      <TD width="90%" bgColor=#f4f5fd><font color="#000000">　<B><font color="#FF0000">&nbsp;商品配送及费用设置</font></B></font></TD>
      <TD bgColor=#f4f5fd height=30><font color="#000000"></font></TD>
    </TR>
  </TBODY>
</TABLE>
		  <table height="5"><tr><td></td></tr></table>

<table width="95%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#b1bfee">
  <form action=config5.asp method=post name=setup>
    <tr bgcolor="#FFFFFF">
      <td width=20% align=right>配送方式一</td>
      <td> <input type=text value="<%=rs("pei1")%>" name=pei1 style='width=80%' maxlength=20> 
        &nbsp;&nbsp; <img src=../images/admin/memo.gif alt="第一种配送方式和费用必须填写<br><font color=red>注意：20字内</font>"> 
      </td>
    </TR>
    <tr bgcolor="#FFFFFF">
      <td width=20% align=right>费用</td>
      <td> <input type=text value="<%=rs("fei1")%>" name=fei1 size="5" maxlength=3>
        元 </td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width=20% align=right>配送方式二</td>
      <td> <input type=text value="<%=rs("pei2")%>" name=pei2 style='width=80%' maxlength=20> 
        &nbsp;&nbsp; <img src=../images/admin/memo.gif alt="如没有可空出"> </td>
    </TR>
    <tr bgcolor="#FFFFFF">
      <td width=20% align=right>费用</td>
      <td> <input type=text value="<%=rs("fei2")%>" name=fei2 size="5" maxlength=3>
        元 </td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width=20% align=right>配送方式三</td>
      <td> <input type=text value="<%=rs("pei3")%>" name=pei3 style='width=80%' maxlength=20> 
        &nbsp;&nbsp; <img src=../images/admin/memo.gif alt="如没有可空出"> </td>
    </TR>
    <tr bgcolor="#FFFFFF">
      <td width=20% align=right>费用</td>
      <td> <input type=text value="<%=rs("fei3")%>" name=fei3 size="5" maxlength=3>
        元 </td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width=20% align=right>配送方式四</td>
      <td> <input type=text value="<%=rs("pei4")%>" name=pei4 style='width=80%' maxlength=20> 
        &nbsp;&nbsp; <img src=../images/admin/memo.gif alt="如没有可空出"> </td>
    </TR>
    <tr bgcolor="#FFFFFF">
      <td width=20% align=right>费用</td>
      <td> <input type=text value="<%=rs("fei4")%>" name=fei4 size="5" maxlength=3>
        元</td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width=20% align=right>配送方式五</td>
      <td> <input type=text value="<%=rs("pei5")%>" name=pei5 style='width=80%' maxlength=20> 
        &nbsp;&nbsp; <img src=../images/admin/memo.gif alt="如没有可空出"> </td>
    </TR>
    <tr bgcolor="#FFFFFF">
      <td width=20% align=right>费用</td>
      <td> <input type=text value="<%=rs("fei5")%>" name=fei5 size="5" maxlength=3>
        元</td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width=20% align=right>配送方式六</td>
      <td> <input type=text value="<%=rs("pei6")%>" name=pei6 style='width=80%' maxlength=20> 
        &nbsp;&nbsp; <img src=../images/admin/memo.gif alt="如没有可空出"> </td>
    </TR>
    <tr bgcolor="#FFFFFF">
      <td width=20% align=right>费用</td>
      <td> <input type=text value="<%=rs("fei6")%>" name=fei6 size="5" maxlength=3>
        元</td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width=20% align=right>免邮费设置</td>
      <td> 购物满 
        <input type=text value="<%=rs("mianyoufei")%>" name="mianyoufei" size="5" maxlength="5">
        元免邮费 &nbsp; &nbsp; &nbsp;<br>
        提示语 
        <input type=text value="<%=rs("mianyoufei_msg")%>" name="mianyoufei_msg" size="34" maxlength="20"> 
        &nbsp;&nbsp; <img src=../images/admin/memo.gif alt="购物满一定金额免费配送<br>此提示语在客户购物填写订单时显示"> 
      </td>
    </TR>
    <tr bgcolor="#FFFFFF">
      <td colspan=2><INPUT name="ok" TYPE="hidden" value="ok">
        <INPUT name=action TYPE="submit" value="保存设置"> &nbsp;</td>
    </tr>
  </form>
</table>
		  <table height="5"><tr><td></td></tr></table>

<%
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
if action="ok" then
if trim(request.form("pei1"))="" or trim(request.form("fei1"))="" then
response.write "<script language='javascript'>"
response.write "alert('出错了，第一种配送方式与费用为必填项！');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
on error resume next'忽略中间错误
if not isNumeric(request.form("fei1")) then er=1
if isNumeric(request.form("fei1")) and request.form("fei1")<0 then er=1
if request.form("fei2")<>"" then'第2个非空时
if not isNumeric(request.form("fei2")) then er=1
if isNumeric(request.form("fei2")) and request.form("fei2")<0 then er=1
end if
if request.form("fei3")<>"" then'第3个非空时
if not isNumeric(request.form("fei3")) then er=1
if isNumeric(request.form("fei3")) and request.form("fei3")<0 then er=1
end if
if request.form("fei4")<>"" then'第4个非空时
if not isNumeric(request.form("fei4")) then er=1
if isNumeric(request.form("fei4")) and request.form("fei4")<0 then er=1
end if
if request.form("fei5")<>"" then'第5个非空时
if not isNumeric(request.form("fei5")) then er=1
if isNumeric(request.form("fei5")) and request.form("fei5")<0 then er=1
end if
if request.form("fei6")<>"" then'第6个非空时
if not isNumeric(request.form("fei6")) then er=1
if isNumeric(request.form("fei6")) and request.form("fei6")<0 then er=1
end if
if er=1 then
response.write "<script language='javascript'>"
response.write "alert('出错了，费用必须为大于或等于0的数值！');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
if trim(request.form("mianyoufei"))="" or (not isNumeric(request.form("mianyoufei"))) then
response.write "<script language='javascript'>"
response.write "alert('“出错了，免邮费设置”填写不完整，或填写的数据不符要求！');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from bconfig"
rs.open sql,conn,1,3
rs("pei1")=trim(request.form("pei1"))
rs("pei2")=trim(request.form("pei2"))
rs("pei3")=trim(request.form("pei3"))
rs("pei4")=trim(request.form("pei4"))
rs("pei5")=trim(request.form("pei5"))
rs("pei6")=trim(request.form("pei6"))
rs("fei1")=request.form("fei1")
if request.form("fei2")<>"" then rs("fei2")=request.form("fei2")
if request.form("fei3")<>"" then rs("fei3")=request.form("fei3")
if request.form("fei4")<>"" then rs("fei4")=request.form("fei4")
if request.form("fei5")<>"" then rs("fei5")=request.form("fei5")
if request.form("fei6")<>"" then rs("fei6")=request.form("fei6")
rs("mianyoufei")=trim(request.form("mianyoufei"))
rs("mianyoufei_msg")=trim(request.form("mianyoufei_msg"))
if trim(request.form("mianyoufei_msg"))="" then rs("mianyoufei_msg")="购买满"&trim(request.form("mianyoufei"))&"元免邮费"
rs.update
url="config5.asp"
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write "<script language='javascript'>"
response.write "alert('操作成功，您设置的信息已保存！');"
response.write "location.href='"&url&"';"
response.write "</script>"
end if%>
