?? gouwu.asp
字號:
<!--
┌─ o91.com───────────────┐
│ 動感購物商務平臺WWW.SNSN.NET版權所有 │
│ 設計:模糊視線13855119911 QQ:9912515 │
└────────────────────┘
-->
<!--#include file="conn.asp"-->
<!--#include file="fuction.asp" -->
<%
dim shopid,username,action
action=request.QueryString("action")
if trim(request.cookies("snsn")("username"))="" then
username=session("tmp_usersessionid")
else
username=trim(request.cookies("snsn")("username"))
end if
shopid=request.QueryString("id")
'//刪除收藏
select case action
case "del"
if Not isChkInteger(request.QueryString("actionid")) then
%>
<script language=javascript>
alert("參數錯誤!");
window.close();
</script>
<%
response.end
end if
conn.execute "delete from shop_action where actionid="&request.QueryString("actionid")
if request.QueryString("ll")=22 then
response.redirect "myuser.asp?action=shoucang"
else
response.redirect "gouwu.asp?action=show"
end if
response.End
case "add"
'//商品,判斷是否存在
if not isChkInteger(shopid) then
%>
<script language=javascript>
alert("參數錯誤!");
window.close();
</script>
<%
response.end
end if
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from shop_snsn where shopid="&shopid,conn,1,1
if trim(request.cookies("snsn")("username"))="" then
danjia=rs_s("shichangjia")
else
if request.Cookies("snsn")("reglx")=1 then
danjia=rs_s("huiyuanjia")
else
danjia=rs_s("vipjia")
end if
end if
kucun=rs_s("kucun")
shopname=rs_s("shopname")
rs_s.close
set rs_s=nothing
if kucun<=0 then
response.write "<script language=javascript>alert('你選購的商品“"&shopname&"”暫時缺貨不能放到購物車里,請選購其它商品!');window.history.go(-1);</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select shopid,username,shopcount,zonger from shop_action where username='"&checkFFSQLStr(username)&"' and shopid="&shopid&" and zhuangtai=7",conn,1,3
if rs.recordcount=1 then
if kucun<(rs("shopcount")+1) then
response.write "<script language=javascript>alert('你選購的商品“"&shopname&"”暫時缺貨不能放到購物車里,請選購其它商品!');window.history.go(-1);</script>"
response.end
end if
rs("zonger")=(rs("shopcount")+1)*danjia
rs("shopcount")=rs("shopcount")+1
rs.update
rs.close
set rs=nothing
response.Redirect "gouwu.asp?action=show"
else
'//添加購物
rs.close
set rs=server.CreateObject("adodb.recordset")
rs.open "select shopid,username,zhuangtai,zonger,shopcount from shop_action",conn,1,3
rs.addnew
rs("shopid")=shopid
rs("username")=username
rs("zhuangtai")=7
rs("shopcount")=1
rs("zonger")=danjia
rs.update
rs.close
set rs=nothing
response.Redirect "gouwu.asp?action=show"
end if
case "show"
'//////////////////
%>
<!--#include file="webconfig.asp"-->
<!--#include file="fuction.asp"-->
<html>
<head>
<title><%=webname%>--我的購物車</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css.css" rel="stylesheet" type="text/css">
<!--#include file="webtop.asp"--><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onMouseOver="window.status='【<%=webname%>】<%=weburl%> 如果您喜歡本站,別忘了把本站介紹給您的好友哦!:)';return true"> <table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="1" bgcolor="C9C9C8"><img src="../images/block.gif" width="1" height="1"></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="168" align="left" valign="top">
<!--#include file="top_login.asp"-->
</td>
<td width="22" align="left" valign="top"><a href="about.asp?action=lxwm"><img src="images/pic_004.gif" width="23" height="136" border="0"></a></td>
<td width="586" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<%if d1="" then%>
<%else%>
<a href=<%=d1url%> target="_blank"><img src=<%=x1%> width="<%=x1w%>" height="<%=x1h%>" border="0"></a>
<%end if%>
<%if d2="" then%>
<%else%>
<a href=<%=d2url%> target="_blank"><img src=<%=x2%> width="<%=x2w%>" height="<%=x2h%>" border="0"></a>
<%end if%>
<%if d3="" then%>
<%else%>
<a href=<%=d3url%> target="_blank"><img src=<%=x3%> width="<%=x3w%>" height="<%=x3h%>" border="0"></a>
<%end if%>
<%if d4="" then%>
<%else%>
<a href=<%=d4url%> target="_blank"><img src=<%=x4%> width="<%=x4w%>" height="<%=x4h%>" border="0"></a>
<%end if%>
</td>
<td width="22" align="center" valign="top"><a href="about.asp?action=lxwm"><img src="images/pic_003.gif" width="23" height="136" border="0"></a>
</td>
<td width="168" align="center">
<!--#include file="top_ad.asp"-->
</td>
</tr>
</table></td>
</tr>
</table></td>
<td width="1" bgcolor="C9C9C8"><img src="../images/block.gif" width="1" height="1"></td>
</tr>
</table>
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="1" bgcolor="C9C9C8"><img src="../images/block.gif" width="1" height="1"></td>
<td> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="168" valign="top">
<!--#include file="left.asp"-->
</td>
<td width="1" bgcolor="C9C9C8"><img src="images/block.gif" width="1" height="1"></td>
<td valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/bg1_4color_.jpg"><img src=images/bg1_4color_.jpg" width="1" height="3"></td>
</tr>
</table>
<br> <table width="98%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td height="1" bgcolor="cccccc"><img src="images/dot_03.gif" width="9" height="1" border="0"></td>
</tr>
<tr>
<td height="25" bgcolor="efefef"> <strong> <img src="images/dot_03.gif" width="9" height="9" border="0">
</strong><b>我的購物車</b></td>
</tr>
<tr>
<td height="1" bgcolor="cccccc"><img src="images/dot_03.gif" width="9" height="1" border="0"></td>
</tr>
</table>
<br>
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select shop_action.actionid,shop_action.shopid,shop_action.shopcount,shop_action.zonger,shop_snsn.shopname,shop_snsn.shichangjia,shop_snsn.huiyuanjia,shop_snsn.vipjia from shop_snsn inner join shop_action on shop_snsn.shopid=shop_action.shopid where shop_action.username='"&username&"' and shop_action.zhuangtai=7",conn,1,1
%>
<table width=96% border=0 align=center cellpadding=0 cellspacing=1 bgcolor="#CCCCCC">
<form name='form1' method='post' action=xgsl.asp>
<tr bgcolor="f1f1f1">
<td width=223 height="22"> <div align=center>商品名稱</div></td>
<td width=99 height="22"> <div align=center>單價
<%if request.cookies("snsn")("reglx")=2 then %>
(VIP)
<%else%>
(會員)
<%end if%>
</div></td>
<td width=49 height="22"> <div align=center>VIP價格</div></td>
<td width=83 height="22"> <div align=center>數量</div></td>
<td width=77 height="22"> <div align=center>總價</div></td>
<td width=24 height="22"> <div align=center>刪</div></td>
</tr>
<%shuliang=rs.recordcount
jianshu=0
zongji=0
do while not rs.eof%>
<tr bgcolor="#FFFFFF">
<td width="223" height="22" bgcolor="#FFFFFF" style='PADDING-LEFT: 5px'>
<div align=left><a href=list.asp?id=<%=rs("shopid")%> target=_blank><%=rs("shopname")%></a>
<input name=shopid type=hidden value="<%=rs("shopid")%>" >
<input name=actionid type=hidden value="<%=rs("actionid")%>" >
</div></td>
<td width="99" height="22" bgcolor="#FFFFFF"> <div align=center>
<%
if request.Cookies("snsn")("reglx")=2 then
response.write rs("vipjia")
else
response.write rs("huiyuanjia")
end if%>
元</div></td>
<td width="49" height="22" bgcolor="#FFFFFF"> <div align=center><%=rs("vipjia")%>
</div></td>
<td width="83" height="22" bgcolor="#FFFFFF"> <div align=center><font color=#dd6600>
<input name=shopcount value="<%=rs("shopcount")%>" size=6 class="wenbenkuang">
</font></div></td>
<td width="77" height="22" bgcolor="#FFFFFF"> <input type=hidden value=<%=rs("zonger")%> name="zonger">
<div align=center><font color=#FF3300><%=rs("zonger")%></font>元</div></td>
<td width="24" height="22"> <div align=center> <a href=gouwu.asp?action=del&actionid=<%=rs("actionid")%>>
<img src=images/trash.gif width=15 height=17 border=0></a></div></td>
</tr>
<%
jianshu=jianshu+rs("shopcount")
zongji=zongji+rs("zonger")
rs.movenext
loop
rs.close
set rs=nothing%>
<tr bgcolor="#FFFFFF">
<td height=30 colspan=6 bgcolor="#FFFFFF"> <div align=center>
<input name="Submit32" type="button" class="go-wenbenkuang" value="返回繼續購物" onClick="javascript:window.history.go(-1)">
<input name="Submit2" type="submit" class="go-wenbenkuang" value="修改數量" onClick="this.form.action='xgsl.asp';this.form.submit()">
<input name="Submit222" type="submit" class="go-wenbenkuang" value="清空購物車" onClick="this.form.action='qkgwc.asp';this.form.submit()">
<input name="Submit222" type="submit" class="go-wenbenkuang" value="去收銀臺" onClick="this.form.action='jszx.asp';this.form.submit()">
</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height=36 colspan=6 bgcolor="#FFFFFF"> <div align=center>
購物車里有商品:<%=shuliang%>件 總數:<%=jianshu%>件 共計:<%=zongji%>元 您有預存款:<%=request.cookies("snsn")("yucun")%>元
<%if request("lx")<>1 then %>
<br>
購物車將在6分鐘后自動關閉
<script language="Javascript">
function closeinfo(){window.close();}
setTimeout("closeinfo()", 600000);
</script>
<%end if%>
</div></td>
</tr>
<%set snsn=server.CreateObject("adodb.recordset")
snsn.open "select * from shop_action_jp where username='"&checkFFSQLStr(request.cookies("snsn")("username"))&"' and zhuangtai=7",conn,1,1
if snsn.recordcount>0 then%>
<tr bgcolor="#FFFFFF">
<td colspan=5 bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><IMG height=5 src="images/block.gif" width=1></td>
</tr>
</table>
<table width="96%" border="0" cellspacing="1" cellpadding="1" bgcolor="#CCCCCC" align="center">
<tr bgcolor="#FFFFFF">
<td height="22" colspan="3"><b>您已選擇的獎品清單</b></td>
</tr>
<tr align="center" bgcolor="f1f1f1">
<td height="22">獎品名稱</td>
<td height="22">使用積分</td>
<td height="22">刪除</td>
</tr>
<%
while not snsn.eof%>
<tr bgcolor="#FFFFFF">
<td height="22">
<%
set snsn1=server.CreateObject("adodb.recordset")
snsn1.open "select * from shop_jiangpin where shopid="&snsn("shopid"),conn,1,1
if snsn1.recordcount=1 then
response.write "<a href='listjp.asp?id="&snsn("shopid")&"' target=_blank>"&snsn1("shopname")&"</a>"
end if
snsn1.close
set snsn1=nothing%>
</td>
<td height="22" align="center"><%=snsn("jifen")%></td>
<td height="22" align="center"><a href="jifen.asp?actionid=<%=snsn("actionid")%>&action=del&ll=22"><img src=images/trash.gif width=15 height=17 border=0></a></td>
</tr>
<%
snsn.movenext
wend%>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><IMG height=5 src="images/block.gif" width=1></td>
</tr>
</table></td>
</tr>
<%end if
snsn.close
set snsn=nothing%>
</form>
</table>
<br>
<div align="center">
<!-- <!--#include file="gouwuliucheng.asp"-->
</div>
</td>
</tr>
</table></td>
<td width="1" bgcolor="C9C9C8"><img src="../images/block.gif" width="1" height="1"></td>
</tr>
</table>
<%
end select%>
<!--#include file="copyright.asp"-->
</body>
</html>
<SCRIPT LANGUAGE="JavaScript">
<!--
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
function checkk()
{
if(checkspace(document.form2.searchkey.value)&&((document.form2.action.value=="3")||(document.form2.action.value=="1"))) {
document.form2.searchkey.focus();
alert("請輸入查訊關鍵字!");
return false;
}
document.form2.submit();
}
//-->
</script>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -