<!--#include file="conn.asp"-->
<%dim dingdan,action
action=request.QueryString("action")
dingdan=request.QueryString("dan")
select case action
case "save"
if request("zhuangtai")<>"" then
set rs=server.CreateObject("adodb.recordset")
rs.Open "select zhuangtai from shop_action where dingdan='"&dingdan&"'",conn,1,3
do while not rs.EOF
rs("zhuangtai")=request("zhuangtai")
rs.Update
rs.MoveNext
loop
rs.Close
set rs=nothing
end if
response.Write "<script language=javascript>alert('订单状态修改成功！');history.go(-1);</script>"
case "del"
set rs=server.CreateObject("adodb.recordset")
rs.open "select username,dingdan from shop_action where dingdan='"&dingdan&"' " ,conn,1,1
'先判断此订单是不是操作人的
if request.Cookies("bookshop")("username")<>trim(rs("username")) then
response.Write "您无权删除此订单!"
response.End
end if
conn.execute "delete from shop_action where dingdan='"&dingdan&"' "
response.Write "<script language=javascript>alert('订单删除成功！');history.go(-1);</script>"
end select

%>