<!--#include file="conn.asp"-->
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/css.css" rel="stylesheet" type="text/css">
<style>
td{font-size:9pt;line-height:120%;color:#353535} 
body{font-size:9pt;line-height:120%} 

a:link          { color: #000000; text-decoration: none }
a:visited       { color: #000000; text-decoration: none }
a:active        { color: #000000; text-decoration: none }
a:hover         { color: #336699; text-decoration: none; position: relative; right: 0px; top: 1px }
</style>
</head>
<body bgcolor="#799AE1">
<%dim action,songid
songid=request.QueryString("id")
action=request.QueryString("action")
set rs=server.CreateObject("adodb.recordset")
select case action
'/////修改送货方式
case "songhuosave"
rs.open "select * from shop_songhuo where songid="&songid,conn,1,3
rs("subject")=trim(request("subject"))
rs("songidorder")=request("songidorder")
rs("jsmoney")=request("jsmoney")
rs("fangshi")=0
rs.update
rs.close
response.write "<script language=javascript>alert('成功修改了送货方式！');history.go(-1);</script>"
response.End
'/////添加送货方式
case "songhuoadd"
rs.open "select * from shop_songhuo",conn,1,3
rs.addnew
rs("subject")=trim(request("subject"))
rs("songidorder")=request("songidorder")
rs("jsmoney")=request("jsmoney")
rs("fangshi")=0
rs.update
rs.close
response.write "<script language=javascript>alert('成功添加了新的送货方式！');history.go(-1);</script>"
response.End
'/////删除送货方式
case "songhuodel"
conn.execute "delete from shop_songhuo where songid="&songid
response.redirect "fangshi.asp?action=songhuo"
'/////删除支付方式
case "zhifudel"
conn.execute "delete from shop_songhuo where songid="&songid
response.redirect "fangshi.asp?action=zhifu"
'////修改支付方式
case "zhifusave"
rs.open "select * from shop_songhuo where songid="&songid,conn,1,3
rs("subject")=trim(request("subject"))
rs("songidorder")=request("songidorder")
rs("fangshi")=1
rs.update
rs.close
response.write "<script language=javascript>alert('成功修改了支付方式！');history.go(-1);</script>"
response.End
'/////添加支付方式
case "zhifuadd"
rs.open "select * from shop_songhuo",conn,1,3
rs.addnew
rs("subject")=trim(request("subject"))
rs("songidorder")=request("songidorder")
rs("fangshi")=1
rs.update
rs.close
response.write "<script language=javascript>alert('成功添加了新的支付方式！');history.go(-1);</script>"
response.End
end select
set rs=nothing
%>
<table width="80%" border="1" cellspacing="0" cellpadding="1" bordercolor="#6699FF" align="center">
  <tr> 
    <td> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td background="../images/back_3.gif" rowspan="2"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="12v">
              <tr> 
                <td class="12v" > 
                  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber3" height="0" width="100%">
                    <tr> 
                      <td> 
                        <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
                          <tr> 
                            <td> 
                              <div align="center"><font color="#000000"><a href="fangshi.asp?action=songhuo">修改送货方式</a></font></div>
                            </td>
                            <td> 
                              <div align="center"><font color="#000000"><a href="fangshi.asp?action=zhifu">修改支付方式</a></font></div>
                            </td>
                          </tr>
                          <tr bgcolor="#E8F1FF"> 
                            <td height="124" colspan="2"> <br>
                              <%select case action
	case "songhuo"%>
                              <table width="80%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
                                <tr> 
                                  <td bgcolor="#E8F1FF"> 
                                    <div align="center">送货方式</div>
                                  </td>
                                  <td bgcolor="#E8F1FF"> 
                                    <div align="center">加收金额</div>
                                  </td>
                                  <td bgcolor="#E8F1FF"> 
                                    <div align="center">排 序</div>
                                  </td>
                                  <td bgcolor="#E8F1FF"> 
                                    <div align="center"></div>
                                  </td>
                                </tr>
                                <%dim i,j
		set rs=server.CreateObject("adodb.recordset")
		rs.open "select * from shop_songhuo where fangshi=0 order by songidorder",conn,1,1
		i=rs.recordcount
		do while not rs.eof%>
                                <tr> 
                                  <form name="form1" method="post" action="fangshi.asp?action=songhuosave&id=<%=rs("songid")%>">
                                    <td bgcolor="#E8F1FF"> 
                                      <div align="center"> 
                                        <input name="subject" type="text" id="subject" size="14" value=<%=trim(rs("subject"))%>>
                                      </div>
                                    </td>
                                    <td bgcolor="#E8F1FF"> 
                                      <div align="center"> 
                                        <input name="jsmoney" type="text" id="jsmoney" size="4" value=<%=formatnumber(rs("jsmoney"),2)%> onKeyPress	= "return regInput(this,	/^\d*\.?\d{0,2}$/,		String.fromCharCode(event.keyCode))" 
		onpaste		= "return regInput(this,	/^\d*\.?\d{0,2}$/,		window.clipboardData.getData('Text'))"
		ondrop		= "return regInput(this,	/^\d*\.?\d{0,2}$/,		event.dataTransfer.getData('Text'))">
                                        元</div>
                                    </td>
                                    <td bgcolor="#E8F1FF"> 
                                      <div align="center"> 
                                        <input name="songidorder" type="text" id="songidorder" size="2" value=<%=rs("songidorder")%> 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'))">
                                      </div>
                                    </td>
                                    <td bgcolor="#E8F1FF"> 
                                      <div align="center"> 
                                        <input type="submit" name="Submit" value="修 改">
                                        &nbsp;<a href="fangshi.asp?action=songhuodel&id=<%=rs("songid")%>" onClick="return confirm('您确定进行删除操作吗？')"><font color="#FF0000">删除</font></a> 
                                      </div>
                                    </td>
                                  </form>
                                </tr>
                                <%rs.movenext
		loop
		rs.close
		set rs=nothing%>
                                <tr> 
                                  <form name="form2" method="post" action="fangshi.asp?action=songhuoadd">
                                    <td bgcolor="#E8F1FF"> 
                                      <div align="center"> 
                                        <input name="subject" type="text" id="subject" size="14">
                                      </div>
                                    </td>
                                    <td bgcolor="#E8F1FF"> 
                                      <div align="center"> 
                                        <input name="jsmoney" type="text" id="jsmoney" size="4" onKeyPress	= "return regInput(this,	/^\d*\.?\d{0,2}$/,		String.fromCharCode(event.keyCode))" 
		onpaste		= "return regInput(this,	/^\d*\.?\d{0,2}$/,		window.clipboardData.getData('Text'))"
		ondrop		= "return regInput(this,	/^\d*\.?\d{0,2}$/,		event.dataTransfer.getData('Text'))">
                                        元</div>
                                    </td>
                                    <td bgcolor="#E8F1FF"> 
                                      <div align="center"> 
                                        <input name="songidorder" type="text" id="songidorder" value=<%=i+1%> size="2" 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'))">
                                      </div>
                                    </td>
                                    <td bgcolor="#E8F1FF"> 
                                      <div align="center"> 
                                        <input type="submit" name="Submit3" value="添 加">
                                      </div>
                                    </td>
                                  </form>
                                </tr>
                              </table>
                              <%case "zhifu"%>
                              <table width="80%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
                                <tr> 
                                  <td bgcolor="#E8F1FF"> 
                                    <div align="center">支付方式</div>
                                  </td>
                                  <td bgcolor="#E8F1FF"> 
                                    <div align="center">排 序</div>
                                  </td>
                                  <td bgcolor="#E8F1FF"> 
                                    <div align="center"></div>
                                  </td>
                                </tr>
                                <%set rs=server.CreateObject("adodb.recordset")
		  rs.open "select * from shop_songhuo where fangshi=1 order by songidorder",conn,1,1
		  j=rs.recordcount
		  do while not rs.eof%>
                                <tr> 
                                  <form name="form1" method="post" action="fangshi.asp?action=zhifusave&id=<%=rs("songid")%>">
                                    <td bgcolor="#E8F1FF"> 
                                      <div align="center"> 
                                        <input name="subject" type="text" id="subject" size="14" value=<%=trim(rs("subject"))%>>
                                      </div>
                                    </td>
                                    <td bgcolor="#E8F1FF"> 
                                      <div align="center"> 
                                        <input name="songidorder" type="text" id="songidorder" size="2" value=<%=rs("songidorder")%> 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'))">
                                      </div>
                                    </td>
                                    <td bgcolor="#E8F1FF"> 
                                      <div align="center"> 
                                        <input type="submit" name="Submit2" value="确 认">
                                        &nbsp;<a href="fangshi.asp?action=zhifudel&id=<%=rs("songid")%>" onClick="return confirm('您确定进行删除操作吗？')"><font color="#FF0000">删除</font></a> 
                                      </div>
                                    </td>
                                  </form>
                                  <%rs.movenext
		  loop
		  rs.close
		  set rs=nothing%>
                                </tr>
                                <tr> 
                                  <form name="form1" method="post" action="fangshi.asp?action=zhifuadd">
                                    <td bgcolor="#E8F1FF"> 
                                      <div align="center"> 
                                        <input name="subject" type="text" id="subject" size="14">
                                      </div>
                                    </td>
                                    <td bgcolor="#E8F1FF"> 
                                      <div align="center"> 
                                        <input name="songidorder" type="text" id="songidorder" value=<%=j+1%> size="2" 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'))">
                                      </div>
                                    </td>
                                    <td bgcolor="#E8F1FF"> 
                                      <div align="center"> 
                                        <input type="submit" name="Submit32" value="添 加">
                                      </div>
                                    </td>
                                  </form>
                                </tr>
                              </table>
                              <%end select%>
                              <br>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<br>
<table width="80%" border="1" cellspacing="0" cellpadding="1" bordercolor="#6699FF" align="center">
  <tr> 
    <td> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td background="../images/back_3.gif" rowspan="2"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="12v">
              <tr> 
                <td class="12v" > 
                  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber3" height="0" width="100%">
                    <tr> 
                      <td> 
                        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#006600">
                          <tr> 
                            <td bgcolor="#FFFFFF" height="20"> 
                              <div align="center"><font color="#000000">操作注意事项及说明</font></div>
                            </td>
                          </tr>
                          <tr> 
                            <td bgcolor="#E8F1FF" height="39"> 
                              <table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
                                <tr> 
                                  <td><font color="#FF0000">·不要在表格中填写非法字符！<br>
                                    ·详细支付方式请在&quot;其它信息设置--&gt;付款方式&quot;中说明！</font></td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<!--#include file="copyright.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>