📄 saveaucbid.asp
字号:
<!-- #include file="inc/char.asp" -->
<!-- #include file="conn.asp" -->
<!-- #include file="head.asp" -->
<!-- #include file="admin/css.asp" -->
<%
response.buffer=true
sUser=session("user")
auc_title=rst("auc_title")
auc_place=rst("auc_place")
zhifu=rst("zhifu")
getnum=rst("getnum")
yunfei=rst("yunfei")
bid_price=Rst("bid_price")
auc_id=FVal(Rst("auc_id"))
aucItemOwner=trim(rst("aucItemOwner"))
application.lock
sql ="select regid,regadmin,credit from users where regusername='"&suser&"'"
set rs=conn.execute(sql)
'--------判断是否注册了详细资料或者是否通过资料审核---------
if rs.eof then
response.write "<script language=javascript>alert('你还没有填写详细信息或者你注册的资料还没有通过审核');this.location.href='vqqqinfo_change.asp';</script>"
response.end
'--------判断帐号是否被锁定---------
elseif rs("regadmin")="Y" then
response.write "<script language=javascript>alert('你的帐号已经被管理员锁定,请联系管理员!');this.location.href='index.asp';</script>"
response.end
'---------------------------------------------------------
elseif rs("credit")<cint(rst("limit")) then
response.write "<script language=javascript>alert('卖家要求信用等级限制,你的等级未能满足要求!');this.location.href='index.asp';</script>"
response.end
end if
if not rs.eof then
BidderID=rs("regid")
if aucItemOwner =trim(rs("regid")) then
response.write "<script language=javascript>alert('你是此商品的卖家,不能参加竞价!');history.back(-1);</script>"
response.end
rs.close
set rs=nothing
else
sql1="select aucid,aucitemowner,aucCurrentBid,aucnum,bidtimes from auctions where aucItemTitle='"&auc_title&"'"
set rs=conn.execute(sql1)
if not rs.eof then
bidItemID=rst("auc_id")
sellerID=rs("aucitemowner")
bidtimes=rs("bidtimes")
if rst("bidtype")="bid" then
if cdbl(bid_price) <= cdbl(rs("aucCurrentBid")) or bid_price="" then
response.write "<script language=javascript>alert('您的出价必须比现价和竞价梯度高!请返回重新填写');history.back(-1);</script>"
response.end
end if
end if
if cdbl(getnum) > cdbl(rs("aucnum")) then
response.write "<script language=javascript>alert('您填写的数量不能大于可购数量!请返回重新填写');history.back(-1);</script>"
response.end
end if
end if
end if
end if
if rs("aucnum")=0 then
response.write "<script language=javascript>alert('此商品已经结束!');history.back(-1);</script>"
response.end
end if
if rst("bidtype")="bid" then
PlaceBid
elseif rst("bidtype")="ykjbid" then
PlaceykjBid
else
errors("你的出价方式错误,请选择正确的出价方式!")
end if
response.write "<script language=javascript>alert('出价成功!');this.location.href='aucinfo.asp?aucid="&auc_ID&"';</script>"
application.unlock
%>
<%
Sub PlaceBid
pbSQL = "UPDATE Auctions Set " & _
" aucCurrentBid = " & SQLVal(bid_price) & _
" , aucCurrentBidder = " & SQLVal(BidderID) & " " & _
" , bidtimes = "&bidtimes + 1& " " & _
" WHERE aucID = " & SQLVal(auc_id)
conn.Execute(pbSQL)
upBidsSQL = "INSERT INTO Bids (bidItemID,BidAmount,BidDate,bidBidderID,bidnum) VALUES( " & _
SQLVal(bidItemID) & ", " & _
SQLVal(bid_price) & ", '" & _
NOW()& "', " & _
SQLVal(BidderID) & " ," & _
SQLVal(getnum) & ") "
conn.Execute(upBidsSQL)
End Sub
'-------一口价----------
Sub PlaceykjBid
pbSQL = "UPDATE Auctions Set " & _
" aucnum = aucnum- " & SQLVal(getnum) & _
" , ykjbidtimes = "&ykjbidtimes + 1& " " & _
" WHERE aucID = " & SQLVal(auc_id)
conn.Execute(pbSQL)
upykjBidsSQL = "INSERT INTO ykjBids (ykjbidItemID,ykjBidAmount,ykjBidDate,ykjbidsellerID,ykjbidBidderID,ykjbidnum) VALUES( " & _
SQLVal(bidItemID) & ", " & _
SQLVal(bid_price) & ", '" & _
NOW()& "', " & _
SQLVal(sellerID) & " ," & _
SQLVal(BidderID) & " ," & _
SQLVal(getnum) & ") "
conn.Execute(upykjBidsSQL)
End Sub
%>
<!-- #include file="bottom.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -