<!--#include file="conn.asp"-->
<!--#include file="adminset.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
end if
if session("flag")>2 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
if qx4<>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
%>
<html>
<head>
<title>网软志成在线购物系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="../css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.STYLE1 {color: #FF0000}
.STYLE3 {color: #000000}
-->
</style></head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1%" height="28">&nbsp;</td>
    <td width="99%"><table width="100%" border="0" cellspacing="0" cellpadding="5">
      <tr>
        <td width="77%" height="27" style="font-size:14px;color:#ffffff">&nbsp;<strong><font color="#000000">网软志成购物后台管理系统 &gt;&gt; 货运管理 &gt;&gt; 送货方式管理 </font></strong></td>
        <td width="23%" style="font-size:14px;color:#ffffff"><span class="STYLE1">* 为必添项目</span></td>
      </tr>
      <tr>
        <td height="20" colspan="2" style="font-size:12px;color:#000000"><span class="STYLE3">&nbsp;操作说明：<br>
          &nbsp;<span class="STYLE1">1、当选中精确计算时：送货货费用＝各省的运费浮动系数×物品重量×送货费 </span></span>！<br>
          <span class="STYLE3">&nbsp;</span><span class="STYLE1">2、当选中优惠延续时：如</span>“满<span class="STYLE1">100</span>免<span class="STYLE1">10</span>”那么“满<span class="STYLE1">200</span>免<span class="STYLE1">20</span>”以此类推 ！<span class="STYLE1"><br>
          <span class="STYLE3">&nbsp;</span>3、当不选中优惠延续时：如</span>“满<span class="STYLE1">100</span>免<span class="STYLE1">10</span>”那么“满<span class="STYLE1">200</span>还是免<span class="STYLE1">10</span>” ！<br />
              </span></td>
      </tr>
    </table></td>
  </tr>
</table>

<%dim action,songid
songid=request.QueryString("id")
action=request.QueryString("action")
set rs=server.CreateObject("adodb.recordset")
select case action
case "del"
if session("flag")>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
conn.execute "delete from shop_sys where songid="&songid
response.write "<script language=javascript>alert('成功删除了送货方式！');location.href='shfangshi_manage.asp';</script>"
response.End
'////修改支付方式
case "save"
if session("flag")>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
rs.open "select * from shop_sys where songid="&songid,conn,1,3
rs("fsh")=trim(request("fsh"))
rs("fy")=trim(request("fy"))
rs("je")=trim(request("je"))
rs("mje")=trim(request("mje"))
rs("px")=request("px")
if request("xs")<>"" then
rs("xs")=request("xs")
end if
if request("jinque")="" then
rs("jinque")=0
else
rs("jinque")=request("jinque")
end if
if request("leitei")="" then
rs("leitei")=0
else
rs("leitei")=request("leitei")
end if
rs.update
rs.close
response.write "<p align=center><font color=red>设置成功!<br>2秒钟后返回上页!</font>"
response.write "<meta http-equiv=""refresh"" content=""2;url=shfangshi_manage.asp"">"
response.End
'/////添加支付方式
case "add"
if session("flag")>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
rs.open "select * from shop_sys",conn,1,3
rs.addnew
rs("fsh")=trim(request("fsh2"))
rs("fy")=trim(request("fy2"))
rs("je")=trim(request("je2"))
rs("mje")=trim(request("mje2"))
rs("px")=request("px2")
rs("xs")=1
if request("jinque")="" then
rs("jinque")=0
else
rs("jinque")=request("jinque")
end if
if request("leitei")="" then
rs("leitei")=0
else
rs("leitei")=request("leitei")
end if

rs.update
rs.close
response.write "<p align=center><font color=red>添加成功!<br>2秒钟后返回上页!</font>"
response.write "<meta http-equiv=""refresh"" content=""2;url=shfangshi_manage.asp"">"
response.End
end select
set rs=nothing
%>

<table width="95%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#999999">
  <tr bgcolor="#cccccc">
    <td width="3%" height="22">
    <div align="center">ID</div></td>
    <td width="5%" align="center">排 序</td>
    <td width="13%" height="22">
    <div align="center">送货方式</div></td>
    <td width="7%" align="center">送货费</td>
    <td width="7%" align="center">精确计算</td>
    <td width="28%" align="center">优惠方式</td>
    <td width="7%" align="center">优惠延续</td>
    <td width="24%" height="22">
    <div align="center">操作</div></td>
  </tr>
  <%set rs=server.CreateObject("adodb.recordset")
		  rs.open "select * from shop_sys where songid>2 order by px",conn,1,1
		  j=rs.recordcount
		  do while not rs.eof%>
  <tr bgcolor="#F3F3F3">
    <form name="form2" method="post" action="shfangshi_manage.asp?action=save&id=<%=rs("songid")%>">
      <td>
        <div align="center">
          <%=rs("songid")%>      </div></td>
      <td align="center"><input name="px"  class="wenbenkuang" type="text" id="px" size="3" value=<%=rs("px")%> onKeyPress="return event.keyCode>=48&&event.keyCode<=57">      </td>
      <td>
        <div align="center">
          <input name="fsh" type="text"  class="wenbenkuang" id="subject4" size="15" value="<%=trim(rs("fsh"))%>"  <%if rs("songid")=3 or rs("songid")=2 then%> readOnly<%end if%>>
</div></td>
      <td align="center"><input name="fy" type="text"  class="wenbenkuang" id="fy" value="<%=trim(rs("fy"))%>" size="6" onKeyPress="return event.keyCode>=46&&event.keyCode<=57"></td>
      <td align="center"><input name="jinque" type="checkbox" id="jinque" value="1" <%if rs("jinque")=1 then%>checked<%end if%> ></td>
      <td align="center">满
      <input name="je" type="text"  class="wenbenkuang" id="fsh3" value="<%=trim(rs("je"))%>" size="6" onKeyPress="return event.keyCode>=46&&event.keyCode<=57">
      免
      <input name="mje" type="text"  class="wenbenkuang" id="je" value="<%=trim(rs("mje"))%>" size="6" onKeyPress="return event.keyCode>=46&&event.keyCode<=57">
送货费</td>
      <td align="center"><input name="leitei" type="checkbox" id="leitei" value="1" <%if rs("leitei")=1 then%>checked<%end if%>></td>
      <td align="left"><input name="xs" type="radio" value="1" <%if rs("xs")=1 then%>checked<%end if%> >
          显
          <input type="radio" name="xs" value="2" <%if rs("xs")=2 then%>checked<%end if%>>
          隐
          <input name="Submit" type="submit" class="go-wenbenkuang" value="修改">
          <%if rs("songid")=3 or rs("songid")=2 or rs("songid")=1 then%>
        系统绑定
		  <%else%>
		  <a href="shfangshi_manage.asp?action=del&id=<%=rs("songid")%>" onClick="return confirm('您确定进行删除操作吗？')"><font color="#FF0000">删除</font></a>
		  <%end if%></td>
    </form>
    <%rs.movenext
		  loop
		  rs.close
		  set rs=nothing%>
  </tr>
  <tr bgcolor="#F3F3F3">
    <form name="form1" method="post" action="shfangshi_manage.asp?action=add" onSubmit="return ck1()">
	<Script language=javascript>	
 function ck1()
  {
 
   if(form1.px2.value=="")
  {
  alert("请输入排序")
  form1.px2.focus()
  return false
  }
   if(form1.fsh2.value=="")
  {
  alert("请输入送货方式")
  form1.fsh2.focus()
  return false
  }
  
   if(form1.fy2.value=="")
  {
  alert("请输入送货费")
  form1.fy2.focus()
  return false
  }
  
   if(form1.je2.value=="")
  {
  alert("请输入满多少")
  form1.je2.focus()
  return false
  }
  
   if(form1.mje2.value=="")
  {
  alert("请输入满多少免多少")
  form1.mje2.focus()
  return false
  }
  
}
</script>

	
      <td>
        <div align="center">      </div></td>
      <td align="center">      <input name="px2"  class="wenbenkuang" type="text" id="px2" value=<%=j+1%> size="3" onKeyPress="return event.keyCode>=48&&event.keyCode<=57"></td>
      <td>
        <div align="center">
          <input name="fsh2"  class="wenbenkuang" type="text" id="fsh2" size="15">
</div></td>
      <td align="center"><input name="fy2"  class="wenbenkuang" type="text" id="fy2" size="6" onKeyPress="return event.keyCode>=46&&event.keyCode<=57"></td>
      <td align="center"><input name="jinque" type="checkbox" id="jinque" value="1"></td>
      <td align="center">满
        <input name="je2"  class="wenbenkuang" type="text" id="je2" size="6" onKeyPress="return event.keyCode>=46&&event.keyCode<=57">
免
<input name="mje2"  class="wenbenkuang" type="text" id="mje2" size="6" onKeyPress="return event.keyCode>=46&&event.keyCode<=57">
送货费</td>
      <td align="center"><input name="leitei" type="checkbox" id="leitei" value="1"></td>
      <td>
        <div align="center">
          <input type="submit" name="Submit32"  class="go-wenbenkuang" value="添 加" >
      </div></td>
    </form>
  </tr>
</table>
<!--#include file="copyright.asp"-->
<p>&nbsp;</p>
<p>&nbsp;</p>
</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>
