📄 foodhold.asp
字号:
<!--#include file="conn.asp"-->
<!-- #include file="shopconn.asp" -->
<%
if Request.Cookies("NC")="" or Request.Cookies("NC")="访客" then
Response.Write("对不起,您不是社区用户,请先注册!")
Response.End
else
dim foodid,act,username
dim brs,tmpsx,foodlasted,fooddate,foodlast,foodnum,foodmoney
%><HTML><HEAD><title>超级市场 → 使用商品</title><%call shophead()%><TABLE cellpadding="0" cellspacing="0" width=700>
<TR>
<TD align="center"><%
foodid=request("foodid")
if foodid="" then
response.write "<script>alert('请从正当渠道进来,谢谢!');history.go(-1);</script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from [foodbuy] where id=" & foodid
rs.open sql,connshop,1,1
if rs.eof and rs.bof then
%>
<table><tr><td align=center>恭喜,操作成功!</td></tr>
<%response.write "<meta http-equiv=refresh content=""1;url=shoped.asp"">"%>
<tr><td>系统将自动在3秒后返回购物车,您现在可以选择下面操作:
<UL><li><a href=shoped.asp><font color=#000000>返回我的购物车</font></a></li>
<li><a href=shop.asp><font color=#000000>返回商店列表</font></a></li></UL>
</td></tr></table>
<%
response.end
end if
username=rs("userid")
if lcase(username)<>lcase(membername) then
response.write "<script>alert('小朋友,不能乱动别人的东西!');history.go(-1);</script>"
response.end
end if
fooddate=rs("fooddate")
foodlast=rs("foodlast")
foodnum=rs("foodnum")
foodmoney=rs("foodmoney")
foodpic=rs("foodpic")
showtype=rs("show")
rs.close
set rs=nothing
foodlasted=datediff("d",cdate(fooddate),now)
act=request("act")
if act="sell" then
call fsell()
elseif act="drop" then
call fdrop()
end if
sub fsell()
if foodlasted<=foodlast then
set rs2=server.createobject("adodb.recordset")
faceshow="face_"&cint(showtype+2)
sql="select "&faceshow&" from [user] where NC='"&username&"'"
rs2.open sql,connshop,1,3
if not Rs2.eof then
rs2(0)="userface/face.gif"
rs2.update
rs2.close
set rs2=nothing
end if
set rs=server.createobject("adodb.recordset")
sql="delete from foodbuy where id="&foodid
rs.open sql,connshop,1,3
sql="select JQ from [HY] where NC='"&membername&"'"
rs.Open sql,conn,1,3
if not Rs.eof then
rs(0)=rs(0)+foodmoney*foodnum\2
rs.Update
end if%>
<table><tr><td align=center><%=face%>恭喜,物品交易成功!您获得<font color=red><%=foodmoney*foodnum\2%></font>元钱。</td></tr><%response.write "<meta http-equiv=refresh content=""3;url=shoped.asp"">"%><tr><td>系统将自动在3秒后返回购物车,您现在可以选择下面操作:
<UL><li><a href=shoped.asp><font color=#000000>返回我的购物车</font></a></li>
<li><a href=shop.asp><font color=#000000>返回商店列表</font></a></li></UL>
</td></tr></table>
<%else
set rs2=server.createobject("adodb.recordset")
faceshow="face_"&cint(showtype+2)
sql="select "&faceshow&" from [user] where NC='"&username&"'"
rs2.open sql,connshop,1,3
if not Rs2.eof then
rs2(0)="userface/face.gif"
rs2.update
rs2.close
set rs2=nothing
end if
set rs=server.createobject("adodb.recordset")
sql="delete from foodbuy where id="&foodid
rs.open sql,connshop,1,3%>
<table><tr><td align=center>由于您的物品已过了保质期,系统已强制回收销毁以免流入市场。</td></tr>
<%response.write "<meta http-equiv=refresh content=""3;url=shoped.asp"">"%>
<tr><td>系统将自动在3秒后返回购物车,您现在可以选择下面操作:
<UL><li><a href=shoped.asp><font color=#000000>返回我的购物车</font></a></li>
<li><a href=shop.asp><font color=#000000>返回商店列表</font></a></li></UL>
</td></tr></table>
<%end if
end sub
sub fdrop()
set rs2=server.createobject("adodb.recordset")
faceshow="face_"&cint(showtype+2)
sql="select "&faceshow&" from [user] where NC='"&username&"'"
rs2.open sql,connshop,1,3
if not Rs2.eof then
rs2(0)="userface/face.gif"
rs2.update
rs2.close
set rs2=nothing
end if
set rs=server.createobject("adodb.recordset")
sql="delete from [foodbuy] where id="& foodid
rs.open sql,connshop,1,3%>
<table><tr><td align=center>恭喜,物品丢弃成功!</td></tr>
<%response.write "<meta http-equiv=refresh content=""3;url=shoped.asp"">"%>
<tr><td>系统将自动在3秒后返回购物车,您现在可以选择下面操作:
<UL><li><a href=shoped.asp><font color=#000000>返回我的购物车</font></a></li>
<li><a href=shop.asp><font color=#000000>返回商店列表</font></a></li></UL>
</td></tr></table>
<%response.end
end sub%>
</td></tr></table></center></body></html>
<%
end if
connshop.close
set connshop=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -