%
sub Orderdetail()
yanzheng=request("yanzheng")
if request.form("edit")="修改" then
set rs=Server.Createobject("ADODB.RecordSet")
sql="select * from billinfo where bi_orderid='"&yanzheng&"'"
rs.Open sql,conn,1,3
rs("bi_mobile")=request("bi_mobile")
rs("bi_fphone")=request("bi_fphone")
rs("bi_fpostcode")=request("bi_fpostcode")
rs("bi_faddress")=request("bi_faddress")
rs("bi_money")=request("bi_money")
rs("bi_count")=request("bi_count")
rs("bi_flag")=request("bi_flag")
rs("bi_ischeck")=request("bi_ischeck")
if request("bi_ischeck")=1 then
rs("bi_admin")=session("admin")
rs("bi_admindate")=now()
end if
rs.update
sql="update ryzl set grade="&request("bi_money")&" where sqr_bh='"&rs("bi_userid")&"'"
conn.execute sql
rs.close
set rs=nothing
response.write "修改成功"
response.write "
"
response.end
elseif request.form("edit")="修改订单" then
yanzheng=request("yanzheng")
set rs=Server.Createobject("ADODB.RecordSet")
sql="select * from OrderDetail where ol_orderid='"&yanzheng&"'"
rs.Open sql,conn,1,3
userid = rs("ol_userid")
Sum=0
Num=0
While Not rs.EOF
Quatity = CInt(Request("Q_" & rs("ol_id")))
If cstr(Quatity) = "" then Quatity = 0
If Quatity < 0 Then
Quatity = Cint(rs("Quantity"))
If Quatity < 0 Then Quatity = 0
End If
buyPrice = Cdbl(rs("ol_prodprice"))
Sum = Sum + ccur(buyPrice * Quatity)
Num = Num + Quatity
conn.execute("update orderDetail set ol_prodcount="&Quatity&" where ol_id="&rs("ol_id"))
rs.movenext
Wend
conn.execute("update billinfo set bi_money="&Sum&",bi_count="&Num&" where bi_orderid='"&yanzheng&"'")
rs.close
set rs=nothing
response.write "修改成功"
response.write "
"
response.end
end if
sqlinfo = "select * from billinfo where bi_orderid='"&yanzheng&"'"
set rsorder=Server.Createobject("ADODB.RecordSet")
rsorder.Open sqlinfo,conn,1,3
if rsorder.eof and rsorder.bof then
response.write "
对不起!订单错误,请您仔细检查!
如果还有问题,请联系网站管理员 |
"
response.write "
"
response.end
else
%>
订单号:<%=rsorder("bi_orderid")%>
<%
rs.close
set rs=nothing
%>
|
|
<%
end if
set rsorder=nothing
end sub
%>