⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shoucang.asp

📁 网络商店源码 实现商品浏览 购物车 后台管理等
💻 ASP
字号:

<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<!--#include file="fuction.asp"-->
<!--#include file="webtop.asp"-->
      <%
if request.cookies("snsn")("username")="" then
response.write "<script language=javascript>alert('对不起,您还没有登录!');window.history.go(-1);</script>"
response.End
end if
dim shopid,username,action
action=request.QueryString("action")
username=trim(request.cookies("snsn")("username"))
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")=1 then
response.redirect "user.asp?action=shoucang"
else
response.redirect "shoucang.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=server.CreateObject("adodb.recordset")
rs.open "select shopid,username from shop_action where username='"&checkFFSQLStr(username)&"' and shopid="&shopid&" and zhuangtai=6",conn,1,1
if not rs.eof and not rs.bof then
response.write "<script language=javascript>alert('对不起,此商品已存在于您的收藏架中,不可以重复添加!');window.location.href='shoucang.asp?action=show';</script>"
response.end
rs.close
set rs=nothing
else
'//判断收藏数
if rs.recordcount=10 then
response.write "<script language=javascript>alert('对不起,您最多只能收藏10件商品!');window.location.href='shoucang.asp?action=show';</script>"
response.end
else
rs.close
set rs=nothing
'//添加收藏
set rs=server.CreateObject("adodb.recordset")
rs.open "select shopid,username,zhuangtai,zonger from shop_action",conn,1,3
rs.addnew
rs("shopid")=shopid
rs("username")=username
rs("zhuangtai")=6
rs("zonger")=0
rs.update
end if
rs.close
response.Redirect "shoucang.asp?action=show"
set rs=nothing
end if

case "show"
'//////////////////%><html>
<head> 
<title><%=webname%>--我的收藏架</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onMouseOver="window.status='【<%=webname%>】<%=weburl%> 如果您喜欢本站,别忘了把本站介绍给您的好友哦!:)';return true"> 
<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>&nbsp;&nbsp;<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>
            <%
set rs=server.CreateObject("adodb.recordset")
rs.open "select shop_action.actionid,shop_action.shopid,shop_snsn.shopname,shop_snsn.shichangjia,shop_snsn.huiyuanjia,shop_snsn.vipjia,shop_snsn.dazhe from shop_snsn inner join  shop_action on shop_snsn.shopid=shop_action.shopid where shop_action.username='"&checkFFSQLStr(request.cookies("snsn")("username"))&"' and shop_action.zhuangtai=6",conn,1,1 
%>
            <table width=96% border=0 align=center cellpadding=0 cellspacing=1 bgcolor="#CCCCCC">
              <form name='form1' method='post' action="sctogw.asp">
                <tr bgcolor="f1f1f1"> 
                  <td width=8% height="25" > 
                    <div align=center><strong><font color=#666666>选择</font></strong></div></td>
                  <td width=42% height="25" > 
                    <div align=center><strong><font color=#666666>商品名称</font></strong></div></td>
                  <td width=14% height="25" > 
                    <div align=center><strong><font color=#666666>市场价</font></strong></div></td>
                  <td width=14% height="25" > 
                    <div align=center><strong><font color=#666666>会员价</font></strong></div></td>
                  <td width=14% height="25" > 
                    <div align=center><strong><font color=#666666>VIP 
                      价</font></strong></div></td>
                  <td width=8% height="25" > 
                    <div align=center><strong><font color=#666666>删除</font></strong></div></td>
                </tr>
                <%do while not rs.eof%>
                <tr bgcolor="#FFFFFF"> 
                  <td height="25" > <div align=center> 
                      <input name=shopid type=checkbox checked value=<%=rs("shopid")%>>
                    </div></td>
                  <td height="25"  STYLE='PADDING-LEFT: 5px'> <div align=left><a href=list.asp?id=<%=rs("shopid")%> target=_blank><%=rs("shopname")%></a>
                    </div></td>
                  <td height="25" > <div align=center><%=formatnumber(rs("shichangjia"),2)%>元</div></td>
                  <td height="25" > <div align=center><font color=#dd6600><%=formatnumber(rs("huiyuanjia"),2)%>元</font></div></td>
                  <td height="25" > <div align=center><font color=#FF3300><%=formatnumber(rs("vipjia"),2)%>元</font></div></td>
                  <td height="25" > <div align=center> <a href=shoucang.asp?action=del&actionid=<%=rs("actionid")%>> 
                      <img src=images/trash.gif width=15 height=17 border=0></a></div></td>
                </tr>
                <%
rs.movenext
loop
rs.close
set rs=nothing
%>
                <tr> 
                  <td height=36 colspan=6 bgcolor=#FFFFFF class="table-xiayou"> 
                    <div align=center> 
                      <input name="Submit2" type="submit" class="go-wenbenkuang" value="放入购物车" onFocus="this.blur()">
                      <input name="Submit32" type="button" class="go-wenbenkuang" value="返回继续购物" onClick="javascript:window.history.go(-1)">
                    </div></td>
                </tr>
              </form>
            </table>
            <p>&nbsp;</p>
            <p><br>
              <script language="Javascript">
function closeinfo(){window.close();}
setTimeout("closeinfo()", 600000);
</script>
              <%
end select%>
            </p>
          </td>
        </tr>
      </table></td>
    <td width="1" bgcolor="C9C9C8"><img src="../images/block.gif" width="1" height="1"></td>
  </tr>
</table>
<!--#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 + -