<!--#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:#ffffff"><span class="STYLE3">&nbsp;操作说明：系统绑定的支付方式不可以删除！如不需要，可对其进行隐藏操作！</span><br />
              </span></td>
      </tr>
    </table></td>
  </tr>
</table>
<br>
<%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_songhuo where songid="&songid
response.write "<script language=javascript>alert('成功删除了支付方式！');location.href='pay_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_songhuo where songid="&songid,conn,1,3
rs("subject")=trim(request("subject"))
rs("songidorder")=request("songidorder")
if request("xs")<>"" then
rs("xs")=request("xs")
end if
rs.update
rs.close
response.write "<script language=javascript>alert('成功修改了支付方式！');location.href='pay_manage.asp';</script>"
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_songhuo",conn,1,3
rs.addnew
rs("subject")=trim(request("subject"))
rs("songidorder")=request("songidorder")
rs("xs")=1
rs.update
rs.close
response.write "<script language=javascript>alert('成功添加了新的支付方式！');location.href='pay_manage.asp';</script>"
response.End
end select
set rs=nothing
%>
<table width="95%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#999999">
  <tr bgcolor="#cccccc">
    <td height="22">
    <div align="center">ID</div></td>
    <td align="center">支付方式</td>
    <td height="22">
    <div align="center">排 序</div></td>
    <td height="22">
    <div align="center"></div></td>
  </tr>
  <%set rs=server.CreateObject("adodb.recordset")
		  rs.open "select * from shop_songhuo order by songidorder",conn,1,1
		  j=rs.recordcount
		  do while not rs.eof%>
  <tr bgcolor="#F3F3F3">
    <form name="form2" method="post" action="pay_manage.asp?action=save&id=<%=rs("songid")%>">
      <td>
        <div align="center">
          <%=rs("songid")%>      </div></td>
      <td align="center"><input name="subject" type="text"  class="wenbenkuang" id="subject3" size="22" value="<%=trim(rs("subject"))%>" <%if rs("songid")=1 or rs("songid")=2 then%>readOnly<%end if%>></td>
      <td>
        <div align="center">
          <input name="songidorder"   class="wenbenkuang" type="text" id="songidorder" size="5" value=<%=rs("songidorder")%> onKeyPress="return event.keyCode>=46&&event.keyCode<=57">
      </div></td>
      <td>
                 
<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")=1 or rs("songid")=2 then%>
系统绑定
<%else%> 
<a href="pay_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="pay_manage.asp?action=add" onSubmit="return ck1()">
	<Script language=javascript>	
 function ck1()
  {
 
   if(form1.songidorder.value=="")
  {
  alert("请输入排序")
  form1.songidorder.focus()
  return false
  }
   if(form1.subject.value=="")
  {
  alert("请输入支付方式")
  form1.subject.focus()
  return false
  }
  

  
}
</script>
      <td>
        <div align="center">      </div></td>
      <td align="center"><input name="subject"  class="wenbenkuang" type="text" id="subject" size="22"></td>
      <td>
        <div align="center">
          <input name="songidorder"  class="wenbenkuang" type="text" id="songidorder" value=<%=j+1%> size="5" 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>
        <div align="center">
          <input type="submit" name="Submit32"  class="go-wenbenkuang" value="添 加">
      </div></td>
    </form>
  </tr>
</table>
<br>
<!--#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>