企业网站建设毕业论文(致谢+开题报告+中期报告+源程序) 第9页
ParaValue = Replace(ParaValue, "cast", "cast")
ParaValue = Replace(ParaValue, "and", "and")
ParaValue = Replace(ParaValue, "or", "or")
End if
SafeRequest=ParaValue
End function
%>
4.3、购物车处理核心代码:
<%
select case action
case "del"
conn.execute "delete from qm_action where actionid="&request.QueryString("actionid")
if request.QueryString("ll")=22 then
response.redirect "myuser.asp?action=favorites"
else
response.redirect "productsbuy.asp?action=show"
end if
response.End
case "add"
'//商品,判断是否存在
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from products where pro_id="&proid,conn,1,1
if session("viplx")="普通会员" then
danjia=rs_s("scjg")
else
danjia=rs_s("vipprice")
end if
kucun=rs_s("kucun")
proname=rs_s("pro_name")
shjiaid=rs_s("shjiaid")
rs_s.close
set rs_s=nothing
if kucun<=0 then
response.write "<script language=javascript>alert('您选购的商品“"&proname&"”暂时缺货不能放到购物车里,请选购其它商品!');window.close();</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select proid,username,procount,zonger from qm_action where username='"&username&"' and proid="&proid&" and zhuangtai=7",conn,1,3
if rs.recordcount=1 then
if kucun<(rs("procount")+1) then
response.write "<script language=javascript>alert('您选购的商品“"&proname&"”暂时缺货不能放到购物车里,请选购其它商品!');window.close();</script>"
response.end
end if
rs("zonger")=(rs("procount")+1)*danjia
rs("procount")=rs("procount")+1
rs.update
rs.close
set rs=nothing
response.Redirect "productsbuy.asp?action=show"
else
'//添加购物
rs.close
set rs=server.CreateObject("adodb.recordset")
rs.open "select proid,username,shjiaid,zhuangtai,zonger,procount from qm_action",conn,1,3
rs.addnew
rs("proid")=proid
rs("username")=username
rs("zhuangtai")=7
rs("procount")=1
rs("shjiaid")=shjiaid
rs("zonger")=danjia
rs.update
rs.close
set rs=nothing
response.Redirect "productsbuy.asp?action=show"
end if
case "show"
'//////////////////
%> <%set rs=server.CreateObject("adodb.recordset")
rs.open "select qm_action.actionid,qm_action.proid,qm_action.procount,qm_action.zonger,qm_action.shjiaid,products.
pro_name,products.scjg,products.vipprice from products inner join qm_action on products.pro_id=qm_action.proid where qm_action.username='"&session("vipName")&"' and qm_action.zhuangtai=7",conn,1,1 %> <%shuliang=rs.recordcount
jianshu=0
zongji=0
do while not rs.eof%><tr bgcolor="#FFFFFF"><td height="30" width="26%" class="table-xia" align="center"><a href=productshopxp.asp? ><%=rs("pro_name")%></a><input name=proid type=hidden value="<%=rs("proid")%>"><input name=actionid type=hidden value="<%=rs("actionid")%>"> </td><td width="17%" height="30" align="center" class="table-xia"><%if session("viplx")="VIP会员" then
response.write rs("vipprice")
else
response.write rs("scjg")
end if%>元</td><td align="center" width="15%" height="30" class="table-xia"><input class=wenbenkuang name=procount value="<%=rs("procount")%>" size=5></td><td align="center" width="15%" height="30" class="table-xia"><font color=red><%=rs("zonger")%></font>元</td><td align="center" width="12%" height="30" class="table-xia"><a href=productsbuy.asp?action=del&actionid=<%=rs("actionid")%>><img src=/qmsz/yyy/images/trash.gif border=0></a> </td> </tr> <%
jianshu=jianshu+rs("procount")
zongji=zongji+rs("zonger")
rs.movenext
loop
rs.close
set rs=nothing%> <tr bgcolor="#FFFFFF"><td height=30 colspan=6 align=center class=table-xia> 购物车里有商品:<font color=red><%=shuliang%></font> 种 总数:<font color=red><%=jianshu%></font> 件 共计:<font color=red><%=zongji%></font> 元 您有预存款:<%=session("yc")%> 元 </td></tr>
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页
企业网站建设毕业论文(致谢+开题报告+中期报告+源程序) 第9页下载如图片无法显示或论文不完整,请联系qq752018766