<% data_path="../../" 'ACC连接数据库路径，对SQL无效 %>
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
  <!--#include file="../checkrole.asp"-->
 <%
      call checkuser("ds")
 
 
if issession=0 then
gsid=Replace_Text(request.Cookies("Yxmemberid"))
else
gsid=session("id")
end if
 
  Response.Buffer = true
  Response.ExpiresAbsolute=now()-1
  Response.Expires=0
  Response.CacheControl="no-cache"
 
if Not ChkPost then 
		response.write "<script language='javascript'>"
		response.write"parent.location.href='"&HOPE_InstallDir&"login/login1.asp';</SCRIPT>"
		response.end
end if
  
 keyid=replace_text(request("keyid"))
 mytype=replace_text(request("type"))

set rs=conn.execute("select buyorder,saleorder from Websen_emailorder where gsid="&gsid&"")
orderbuy=rs("buyorder")
if orderbuy<>"" then
  if instr(orderbuy,",")>0 then
  Arrob=split(orderbuy,",")
  end if
end if
ordersale=rs("saleorder")
if ordersale<>"" then
  if instr(ordersale,",")>0 then
  Arros=split(ordersale,",")
  end if
end if

if mytype="buy" then
select case keyid
case 0
conn.execute("update Websen_emailorder set buyorder='' where gsid="&gsid&"")
case 1
conn.execute("update Websen_emailorder set buyorder='"&replace(orderbuy,Arrob(0)&",","")&"' where gsid="&gsid&"")
case 2
conn.execute("update Websen_emailorder set buyorder='"&replace(orderbuy,","&Arrob(1),"")&"' where gsid="&gsid&"")
case 3
conn.execute("update Websen_emailorder set buyorder='"&replace(orderbuy,","&Arrob(2),"")&"' where gsid="&gsid&"")
case else
Response.Redirect ("index.asp")
end select
elseif mytype="sale" then
select case keyid
case 0
conn.execute("update Websen_emailorder set saleorder='' where gsid="&gsid&"")
case 1
conn.execute("update Websen_emailorder set saleorder='"&replace(ordersale,Arros(0)&",","")&"' where gsid="&gsid&"")
case 2
conn.execute("update Websen_emailorder set saleorder='"&replace(ordersale,","&Arros(1),"")&"' where gsid="&gsid&"")
case 3
conn.execute("update Websen_emailorder set saleorder='"&replace(ordersale,","&Arros(2),"")&"' where gsid="&gsid&"")
case else
Response.Redirect ("index.asp")
end select
else
Response.Redirect ("index.asp")
end if
%>

<%
rs.close
set rs=nothing
conn.close
set conn=nothing

response.Redirect ("ordermodify_begin.asp")
%>