<!--#include file="conn.asp"-->
<%
if session("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');location.href='index.asp' ;</script>"
response.End
else
if request.cookies("sundxshop")("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');location.href='index.asp' ;</script>"
response.End
end if
end if

dim action,actionid
actionid=SafeRequest("id",1)
action=FormatSQL(SafeRequest("action",0))
goods=SafeRequest("dan",1)
username=SafeRequest("username",0)
select case action
case "orderok"
if session("rank")>2 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你无权修改订单产品！');history.go(-1);</script>"
response.End
end if


set rs=server.CreateObject("adodb.recordset")
rs.open "select * from orders where actionid="&actionid,conn,1,3
rs("productnum")=trim(request.form("productnum"))
rs("vipprice")=trim(request.form("vipprice"))
rs("priced")=trim(request.form("priced"))
rs("score")=trim(request.form("score"))
rs("paid") =trim(request.form("priced"))*trim(request.form("productnum"))+trim(request.form("vipprice"))
rs.Update
rs.close
set rs1=nothing
conn.close
set conn=nothing

response.Write "<script language=javascript>alert('修改成功！');location.href='vieworder.asp?dan="&goods&"&username="&username&"';</script>"
response.End

case "del"
if session("rank")>2 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你无权删除订单产品！');history.go(-1);</script>"
response.End
end if
conn.execute "delete from orders where actionid="&actionid
set rs=nothing
response.Write "<script language=javascript>alert('删除成功！');history.go(-1);</script>"
response.End

end select
%>

