📄 biditem.asp
字号:
<!-- #include file="inc/info.asp" -->
<!-- #include file="inc/const.asp" -->
<!-- #include file="conn.asp" -->
<%
sUserName = "" & session("user")
sPassword = "" & session("pass")
iBidPlaced = FVal(Request.Form("Bid"))
iItemID = FVal(Request.Form("ItemID"))
lBidderID = 0
sBidderEmail = ""
lCatID = 0
bidSQL = "SELECT * FROM Auctions WHERE aucID =" & SQLVal(iItemID)
set bidRS = conn.Execute(bidSQL)
If NOT bidRS.EOF Then
iCurrentBidder = FVAL(bidRs("aucCurrentBidder"))
sItemTitle = "" & bidRS.Fields("aucItemTitle")
vCloseDate = bidRS.Fields("aucCloseDate")
lOwnerID = FVal(bidRS("aucItemOwner"))
lCatID = FVal(bidRS.Fields("catid"))
If FVal(bidRS.Fields("aucCurrentBid")) > 0 Then
iBidNeeded = FVal(bidRS.Fields("aucMinimumIncrement") + bidRS.Fields("aucCurrentBid"))
Else
iBidNeeded = FVal(bidRS.Fields("aucStartingBid"))
End If
Else
iCurrentBidder = 0
sItemTitle = ""
vCloseDate = ""
End If
Response.Write "<TABLE BORDER=""0"" CELLPADDING=""5"" CELLSPACING=""0""><TR><TD>"
If UserRegistered Then
If CheckBid Then
PlaceBid
If iCurrentBidder > 0 Then
SendOutbidEmail
End If
End If
End If
Response.Write "</TD></TR></TABLE>"
BidRS.Close
Set BidRS = Nothing
TableFoot
DoPagebotter
CloseDBConn
Sub PlaceBid
uiSQL = "SELECT * FROM users WHERE regUserName = " & SQLStr(sUserName) & " AND regPassword = " & SQLStr(sPassword) & " "
Set UserRS = conn.Execute(uiSQL)
If NOT UserRS.EOF Then
lBidderID = FVal(UserRS.Fields("regID"))
sBidderEmail = "" & UserRS.Fields("regEmail")
End If
UserRS.Close
Set UserRS = Nothing
pbSQL = "UPDATE Auctions Set " & _
" aucCurrentBid = " & SQLVal(iBidPlaced) & _
" , aucCurrentBidder = " & SQLVal(lBidderID) & " " & _
" WHERE aucID = " & SQLVal(iItemID)
'Response.write pbSQL & "<BR>"
conn.Execute(pbSQL)
upBidsSQL = "INSERT INTO Bids (bidItemID, BidAmount, BidDate, bidBidderID) VALUES( " & _
SQLVal(iItemID) & ", " & _
SQLVal(iBidPlaced) & ", " & _
SQLDate(NOW) & ", " & _
SQLVal(lBidderID) & " ) "
conn.Execute(upBidsSQL)
'Response.Write upBidsSQL & "<BR>"
If len(sBidderEmail) > 0 Then
SendBidEmail
End If
sBidMsg = "" & Replace(GLS_SuccessfulBid, "%BIDAMOUNT%", FCurrency(iBidPlaced))
sBidMsg = Replace(sBidMsg, "%ITEMNO%", iItemID)
sBidMsg = Replace(sBidMsg, "%ITEMTITLE%", sItemTitle)
Response.Write gsAuctionTextOpen & sBidMsg & "<BR>"
Response.Write GLS_PrintConfirm & "<BR><P>"
Response.Write "<A HREF=""QAViewAuctions.asp?catID=" & lCatID & """>" & GLS_GoToCategory & "</A><BR>"
Response.Write "<A HREF=""QAViewItem.asp?ItemID=" & iItemID & """>" & GLS_GoToItem & "</A><BR>" & gsAuctionTextClose
End Sub
Sub SendBidEmail
sBody = "" & ReadFile(Server.MapPath("templates\QABidNotice.txt"))
sBody = Replace(sBody, "%AUCURL%", gsAucURL)
sBody = Replace(sBody, "%TITLE%", sItemTitle)
sBody = Replace(sBody, "%BID%", FCurrency(iBidPlaced))
sBody = Replace(sBody, "%AUCID%", iItemID)
sBody = Replace(sBody, "%AUCCLOSE%", DispShortDateTime(vCloseDate))
sBody = sBody & Chr(13) & Chr(10) & "Powered by QuickAuction ?vqqq.com"
sSubject = GetFirstLine(sBody)
SendEmailMessage sBidderEmail, gsAdminEmail, sSubject, sBody
End Sub
Sub SendOutbidEmail
emailSQL = "SELECT regID, regEmail FROM users WHERE regID = " & SQLVal(iCurrentBidder)
Set emailRS = conn.Execute(emailSQL)
If NOT emailRS.EOF Then
sBody = "" & ReadFile(Server.MapPath("templates\QAOutbidNotice.txt"))
sBody = Replace(sBody, "%AUCURL%", gsAucURL)
sBody = Replace(sBody, "%TITLE%", sItemTitle)
sBody = Replace(sBody, "%BID%", FCurrency(iBidPlaced))
sBody = Replace(sBody, "%AUCID%", iItemID)
sBody = Replace(sBody, "%AUCCLOSE%", DispShortDateTime(vCloseDate))
sBody = sBody & Chr(13) & Chr(10) & "Powered by QuickAuction ?vqqq.com"
sTo = "" & emailRS.Fields("regEmail")
sSubject = GetFirstLine(sBody)
SendEmailMessage sTo, gsAdminEmail, sSubject, sBody
End If
emailRS.Close
set emailRS = Nothing
End Sub
Function CheckBid
If iBidPlaced >= iBidNeeded AND lOwnerID <> lBidderID Then
CheckBid = True
Else
Response.Write(gsAuctionTextOpen & GLS_BidError & gaAuctionTextClose & "<BR>")
If iBidPlaced < iBidNeeded Then
Response.Write gsErrorTextOpen & GLS_BidBelowMin & "<BR>" & gsErrorTextClose
End If
If lOwnerID = lBidderID Then
Response.Write gsErrorTextOpen & GLS_BidOwner & "<BR>" & gsErrorTextClose
End If
Response.Write(gsAuctionTextOpen & GLS_GoBack & "<BR>" & gsAuctionTextClose)
CheckBid = False
End If
End Function
Function UserRegistered
regSQL = "SELECT * FROM users WHERE regUsername = " & SQLStr(sUserName) & " AND regPassword = " & SQLStr(sPassword) & " "
Set regRS = conn.Execute(regSQL)
If NOT regRS.EOF Then
UserRegistered = True
lBidderID = regRS("regID")
Else
Response.Write(gsAuctionTextOpen & GLS_LoginErr & "<BR>")
Response.Write(GLS_GoBack & "<BR><BR>")
Response.Write(GLS_HowToRegister & gsAuctionTextClose)
UserRegistered = False
End If
regRS.Close
Set regRS = Nothing
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -