📄 sellauc.asp
字号:
<!-- #include file="top_cnbbr.asp" -->
<!-- #include file="ChkSession.asp" -->
<%
if SYS_UserSellCheck=1 then
Dim RsUserSellCheck
Set RsUserSellCheck=Server.CreateObject("ADODB.RecordSet")
RsUserSellCheck.Open "Select regvalidated,degrade from Users Where RegAdmin='N' and RegID="& LoginedUserID
if RsUserSellCheck.Eof then Call AlertInfo("用户登陆超时,请重新登陆!","login.asp",1)
if RsUserSellCheck("degrade")<>"身份证" then Call AlertInfo("出错了,系统限制只有通过身份证认证的用户才可以发布商品!","Sell.asp",1)
RsUserSellCheck.Close
Set RsUserSellCheck=nothing
end if
Dim RegStep
RegStep=CheckStr(Trim(Request("RegStep")))
if Not isNum(RegStep) then
RegStep=1
else
RegStep=Clng(RegStep)
if RegStep>3 or RegStep<1 then RegStep=1
end if
if Regstep=1 then Call AlertInfo("操作失败,请先选择商品拍卖方式1!","Sell.asp",1)
Dim sType,TempTypeName
sType=CheckStr(Trim(Request("stype")))
if not isNum(sType) then Call AlertInfo("操作失败,请先选择正确的商品拍卖方式!","Sell.asp",1)
if sType=1 then
TempTypeName="拍卖"
elseif sType=2 then
TempTypeName="一口价"
else
Call AlertInfo("操作失败,请先选择正确的商品拍卖方式!","Sell.asp",1)
end if
Dim RegAct
RegAct=CheckStr(Trim(Request.Form("RegAct")))
if Not isNum(RegAct) then
RegAct=0
else
RegAct=Clng(RegAct)
if RegAct<1 or RegAct>2 then RegAct=0
end if
Dim EditAct
EditAct=CheckStr(Trim(Request.Form("EditAct")))
if Not isNum(EditAct) then EditAct=0
Dim eEditAct,eName,eType,eClassPath,eAucBuyPrice,eAucStartPrice,eAucMiniIncrement,eAucReservePrice,eAucTotalNum,eAucNum,eAucOldNew,eContent,eCloseTime,eAucPayStyle,ePayForTM,eAucTM1,eAucTM2
eEditAct=0
Dim AucID
AucID=CheckStr(Trim(Request("AucID")))
if isNum(AucID) then
Dim RsEditAuc
Sql="Select AucItemTitle,AucType,BBR_ClassPath,AucCurrentBid,AucBuyPrice,AucStartingBid,AucMinimumIncrement,AucReservePrice,AucTotalNum,AucNum,BBR_AucOldNew,aucDescription,aucAvailDate,AucCloseDate,AucEnded,AucItemOwner,BBR_AlipayStatus,BidTimes,ykjBidTimes,BBR_AucPayStyle,BBR_PayForTM,BBR_AucTM1,BBR_AucTM2 from auctions where Aucended='N' and BBR_Auc_Success=0 and AucItemOwner="& LoginedUserID &" and AucID="& AucID
Set RsEditAuc=Server.CreateObject("ADODB.RecordSet")
RsEditAuc.Open Sql,conn,1,1
if RsEditAuc.Eof then Call AlertInfo("出错了,此商品已经过期或者已经被删除!","",0)
eName=RsEditAuc("AucItemTitle")
eType=RsEditAuc("AucType")
eClassPath=RsEditAuc("BBR_CLassPath")
eAucBuyPrice=RsEditAuc("AucBuyPrice")
eAucStartPrice=RsEditAuc("AucStartingBId")
eAucMiniIncrement=RsEditAuc("AucMinimumIncrement")
eAucReservePrice=RsEditAuc("AucReservePrice")
eAucTotalNum=RsEditAuc("AucTotalNum")
eAucNum=RsEditAuc("AucNum")
eAucOldNew=RsEditAuc("BBR_AucOldNew")
eContent=ReHtmlEncode(RsEditAuc("AucDescription"))
eCloseTime=RsEditAuc("AucCloseDate")
if eType=1 and RsEditAuc("BidTimes")>0 then Call AlertInfo("出错了,商品已经有人出价,不能再更新此信息!","",0)
if eType=2 and RsEditAuc("YkjBidTimes")>0 then Call AlertInfo("出错了,商品已经有人出价,不能再更新此信息!","",0)
eAucPayStyle=RsEditAuc("BBR_AucPayStyle")
ePayForTM=RsEditAuc("BBR_PayForTM")
eAucTM1=RsEditAuc("BBR_AucTM1")
eAucTM2=RsEditAuc("BBR_AucTM2")
RsEditAuc.Close
Set RsEditAuc=nothing
eEditAct=1
end if
if RegStep=3 And RegAct=2 then
Call Cnbbr_CheckPost(0)
Dim RepeatSell
RepeatSell=CheckStr(Trim(Request.Cookies(Super_User)("BBRRndSellCode")))
if RepeatSell="" then
SellAuc
else
if Not isDate(RepeatSell)then
Call AlertInfo("操作异常,请返回重新填写!","Sell.asp",1)
else
if Clng(DateDiff("s",RepeatSell,now()))<60 then
Call AlertInfo("出错了,商品发布速度过快,请返回先休息一下!","",0)
else
SellAuc
end if
end if
end if
Sub SellAuc()
Dim sName,sType,sYkj,sStartPrice,sMiniIncrement,sReservePrice,sAmount,sOldNew,sDays,sContent
sName=HtmlEncode(CheckStr(Trim(Request.Form("sName"))))
sType=CheckStr(Trim(Request.Form("sType")))
sStartPrice=CheckStr(Trim(Request.Form("sStartPrice")))
sMiniIncrement=CheckStr(Trim(Request.Form("sMiniIncrement")))
sReservePrice=CheckStr(Trim(Request.Form("sReservePrice")))
sYkj=CheckStr(Trim(Request.Form("sYkj")))
sAmount=CheckStr(Trim(Request.Form("sAmount")))
sOldNew=CheckStr(Trim(Request.Form("sOldNew")))
sDays=CheckStr(Trim(Request.Form("sDays")))
sContent=CheckStr(Trim(Request.Form("sContent")))
if Len(sName)<2 then Call AlertInfo("操作失败,你填写的商品名称长度必须大于2个字符!","",0)
if Len(sContent)<2 then Call AlertInfo("操作失败,你填写的商品描述长度必须大于2个字符!","",0)
if not isNum(sType) then Call AlertInfo("操作失败,请选择正确的商品拍卖方式!","",0)
if sType=1 then
if not isNum(sStartPrice) then Call AlertInfo("操作失败,商品起拍价格必须填写数字!","",0)
if not isNum(sMiniIncreMent) then Call AlertInfo("操作失败,商品价格最小加价幅度必须填写数字!","",0)
if not isNum(sReservePrice) then Call AlertInfo("操作失败,商品保留价格必须填写数字!","",0)
elseif sType=2 then
if not isNum(sYkj) then Call AlertInfo("操作失败,商品一口价价格必须填写数字!","",0)
else
Call AlertInfo("操作失败,请选择正确的商品拍卖方式!","Sell.asp",1)
end if
if not isNum(sAmount) then Call AlertInfo("操作失败,商品数量必须填写数字!","",0)
if not isNum(sOldNew) then Call AlertInfo("操作失败,请选择正确的商品新旧程度!","",0)
Dim BBR_S1,BBR_S2,BBR_S3,BBR_S4,BBR_ClassPath
BBR_S1=CheckStr(Trim(Rst("S1")))
BBR_S2=CheckStr(Trim(Rst("S2")))
BBR_S3=CheckStr(Trim(Rst("S3")))
BBR_S4=CheckStr(Trim(Rst("S4")))
if Not isNum(BBR_S1) then BBR_S1=0
if Not isNum(BBR_S2) then BBR_S2=0
if Not isNum(BBR_S3) then BBR_S3=0
if Not isNum(BBR_S4) then BBR_S4=0
BBR_ClassPath=Cstr(BBR_S1&"|"&BBR_S2&"|"&BBR_S3&"|"&BBR_S4)
BBR_ClassPath=Replace(BBR_ClassPath,"|0","")
if Cstr(BBR_ClassPath)="0" then Call AlertInfo("请选择商品所属分类!","",0)
Dim AucStartTime,AucCloseTime
AucStartTime=Now()
if isDate(eCloseTime) then AucStartTime=eCloseTime
AucCloseTime=DateAdd("d",sDays,AucStartTime)
Dim sAucPayStyle,sPayForTM,sAucTM1,sAucTM2
sAucPayStyle=CheckStr(Trim(Request.Form("sAucPayStyle")))
sPayForTM=CheckStr(Trim(Request.Form("sPayForTM")))
sAucTM1=CheckStr(Trim(Request.Form("sAucTM1")))
sAucTM2=CheckStr(Trim(Request.Form("sAucTM2")))
if Not isNum(sAucPayStyle) then Call AlertInfo("操作失败,请选择正确的商品付款方式!","",0)
if Not isNum(sPayForTM) then Call AlertInfo("操作失败,请选择正确的商品运费支付方式!","",0)
if Not isNum(sAucTM1) then Call AlertInfo("操作失败,请选择正确的商品平邮费用!","",0)
if Not isNum(sAucTM2) then Call AlertInfo("操作失败,请选择正确的商品快递费用!","",0)
if isNum(AucID) and EditAct=1 then
if sType=1 then
Sql="Update Auctions Set AucItemTitle='"& sName &"',BBR_ClassPath='"& BBR_ClassPath &"',AucCurrentBid="& sStartPrice &",AucStartingBid="& sStartPrice &",AucMinimumIncrement="& sMiniIncrement &",AucReservePrice="& sReservePrice &",AucTotalNum=(AucTotalNum-AucNum)+"& sAmount &",AucNum="& sAmount &",BBR_AucOldNew="& sOldNew &",aucDescription='"& sContent &"',aucCloseDate='"& AucCloseTime &"',BBR_AucPayStyle="& sAucPayStyle &",BBR_PayForTM="& sPayForTM &",BBR_AucTM1="& sAucTM1 &",BBR_AucTM2="& sAucTM2 &" where AucID="& AucID
else
Sql="Update Auctions Set AucItemTitle='"& sName &"',BBR_ClassPath='"& BBR_ClassPath &"',AucCurrentBid="& sYkj &",AucBuyPrice="& sYkj &",AucTotalNum=(AucTotalNum-AucNum)+"& sAmount &",AucNum="& sAmount &",BBR_AucOldNew="& sOldNew &",aucDescription='"& sContent &"',aucCloseDate='"& AucCloseTime &"',BBR_AucPayStyle="& sAucPayStyle &",BBR_PayForTM="& sPayForTM &",BBR_AucTM1="& sAucTM1 &",BBR_AucTM2="& sAucTM2 &" where AucID="& AucID
end if
else
if sType=1 then
Sql="Insert Into Auctions (AucItemTitle,AucType,BBR_ClassPath,AucCurrentBid,AucStartingBid,AucMinimumIncrement,AucReservePrice,AucTotalNum,AucNum,BBR_AucOldNew,aucDescription,aucAvailDate,AucCloseDate,AucEnded,AucItemOwner,BBR_AlipayStatus,BBR_AucPayStyle,BBR_PayForTM,BBR_AucTM1,BBR_AucTM2) values ('"& sName &"',"& sType &",'"& BBR_ClassPath &"',"& sStartPrice &","& sStartPrice &","& sMiniIncrement &","& sReservePrice &","& sAmount &","& sAmount &","& sOldNew &",'"& sContent &"','"& AucStartTime &"','"& AucCloseTime &"','N',"& LoginedUserID &",1,"& sAucPayStyle &","& sPayForTM &","& sAucTM1 &","& sAucTM2 &")"
else
Sql="Insert Into Auctions (AucItemTitle,AucType,BBR_ClassPath,AucCurrentBid,AucBuyPrice,AucTotalNum,AucNum,BBR_AucOldNew,aucDescription,aucAvailDate,AucCloseDate,AucEnded,AucItemOwner,BBR_AlipayStatus,BBR_AucPayStyle,BBR_PayForTM,BBR_AucTM1,BBR_AucTM2) values ('"& sName &"',"& sType &",'"& BBR_ClassPath &"',"& sYkj &","& sYkj &","& sAmount &","& sAmount &","& sOldNew &",'"& sContent &"','"& AucStartTime &"','"& AucCloseTime &"','N',"& LoginedUserID &",1,"& sAucPayStyle &","& sPayForTM &","& sAucTM1 &","& sAucTM2 &")"
end if
end if
Conn.Execute(Sql)
if Err then
Call AlertInfo("操作异常,请返回重新填写!","",0)
else
Dim LastAucID
if isNum(AucID) and EditAct=1 then
LastAucID=AucID
Response.Cookies(Super_User)("BBRRndSellCode")=now()
session("aucitemtitle")=sName
session("aucid")=LastAucID
session("aucowner")=LoginedUserID
Call AlertInfo("恭喜你,商品信息更新成功!请继续更新图片信息~~","SellAuc_Success.asp?AucID="& LastAucID ,1)
else
if SysCount(2,1)=True and ClassAucCount(BBR_ClassPath,1)=True and UserAucCount(LoginedUserID,1)=True then
Dim RsLastAucID
Set RsLastAucID=Server.CreateObject("ADODB.RecordSet")
RsLastAucID.Open "Select AucID from Auctions where AucItemOwner="& LoginedUserID &" and AucType="& sType,Conn,1,1
RsLastAucID.MoveLast
LastAucID=RsLastAucID("AucID")
RsLastAucID.Close
Set RsLastAucID=nothing
Response.Cookies("BBRRndSellCode")=now()
session("aucitemtitle")=sName
session("aucid")=LastAucID
session("aucowner")=LoginedUserID
Call AlertInfo("恭喜你!你的商品已经成功上架了,现转向商品缩略图上传页面~~~","SellAuc_Success.asp?AucID="& LastAucID ,1)
else
Call AlertInfo("操作异常,请返回重新填写!!","",0)
end if
end if
end if
End Sub
else
Dim EditActionStr
if eEditAct=1 then EditActionStr=""
Response.Write Cnbbr_Head
Dim SiteMenu_Width,SiteMenu_Left,SiteMenu_Right
SiteMenu_Width=SYS_BodyCenterWidth
SiteMenu_Left="Sell.asp|[menu]|商品发布||[menu]||###|[menu]|填写商品信息"
SiteMenu_Right=""
Response.Write CnbbrSiteMenu(SiteMenu_Width,SiteMenu_Left,SiteMenu_Right)
%>
<!-- 商品信息发布导航条 -->
<table align="center" border="0" cellpadding="2" cellspacing="2" width="<%=SYS_BodyCenterWidth%>" class="td">
<tbody>
<tr>
<td width="55%"><img src="Images/Spacer.gif" border="0" alt=""></td>
<%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -