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

📄 shopping_list.asp

📁 一套集网上购物和商品管理为一体的强大的网上商店(商城)系统
💻 ASP
字号:
<!-- #include file="conn.asp" -->
<!--#include file="webconfig.asp"-->
<%
'url=request.servervariables("HTTP_REFERER")
if  session("userid")="" then
  //response.write "<script>alert('你还未登陆,或登陆已超时,请重新登陆!!');</script>"
  response.write "<script>this.location.href='login_window.asp';</script>"
  response.end
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=webname%></title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="include/top.asp" -->
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr valign="top"> 
    <td bgcolor="#FFFFFF" align="center"> 
      <%
if session("userid")="" then
response.redirect "login_window.asp"
else
%>
      <table width="770" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
          <td align="center" valign="top" bgcolor="#FFFFFF"> 
            <table cellspacing=0 cellpadding=2 width="94%" align=center border=0>
              <tbody> 
              <tr> 
                <td width="50%"><b><font color="#006600" size="3"><img src="images/shopcar.gif" width="45" height="45" align="absmiddle">我的购物车:</font></b></td>
                <td align="right" valign="bottom"><font color="#006600">价格单位:元(人民币)</font></td>
              </tr>
              </tbody> 
            </table>
            <table cellspacing=1 cellpadding=2 width="94%" border=0 class="table_front">
              <tbody> 
                <tr class="th_front1"> 
                  <td width=30 height=21 align="center"><b>序号</b></td>
                  <td align="center"><b>商品名称</b></td>
                  <td width="50" align="center"><b>市场价</b></td>
                  <td width=50 align="center"><b>会员价</b></td>
                  <td width=50 align="center"><b>VIP价</b></td>
                  <td width=100 align="center"><b>购买数量</b></td>
                  <td width=60 align="center"><b>小计</b></td>
                  <td width=60 align="center"><b>立即节省</b></td>
                  <td width=60 align="center"><b>删除商品</b></td>
              </tr>
              <%
sql="select * from Net008_orderlist_temp where userid='"&session("userid")&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql ,conn,1,2
if rs.recordcount<1 then
response.write"<font size=5 color=ff0000>Sorry!你的购物车里暂无产品!</font>"
response.write "<a href='index.asp' target='_blank'><img src='images/buy_B_jxxg.gif' width='126' height='34' border='0'></a>"
'response.end
end if
const maxperpage=50 '定义每一页显示的数据记录的常量                                   
dim currentpage '定义当前页的变量                                   
rs.pagesize=maxperpage                                   
currentpage=request.querystring("pageid")                                   
if currentpage="" then                                   
currentpage=1                                   
elseif currentpage<1 then                                   
currentpage=1                                   
else                                   
currentpage=clng(currentpage)                                   
	if currentpage > rs.pagecount then                                   
	currentpage=rs.pagecount                                   
	end if                                   
end if                                   
'如果变量currentpage的数据类型不是数值型                                   
'就1赋给变量currentpage                                   
if not isnumeric(currentpage) then                                   
currentpage=1                                   
end if                                   
dim totalput,n '定义变量                                   
totalput=rs.recordcount                                   
if totalput mod maxperpage=0 then                                   
n=totalput\maxperpage                                   
else                                   
n=totalput\maxperpage+1                                   
end if                                   
if n=0 then                                   
n=1                                   
end if                                   
rs.move(currentpage-1)*maxperpage                                   
i=0                                   
do while i< maxperpage and not rs.eof     
%>
                <tr class="th_front2"> 
                  <td width=30 height=21 align="center"> 
                    <%response.write i+1
%>
                </td>
                  <td align="center"> 
                    <%
productid=rs("productid")
sql_temp="select * from Net008_productlist where id="&cint(productid)
set rs_temp=server.createobject("adodb.recordset")
rs_temp.open sql_temp,conn,1,2
productsort=left(rs_temp("productsortsub"),1)
response.write "<a href='showproduct.asp?id="&rs_temp("id")&"' class=LeftTypeLink target=_blank>"
response.write rs_temp("productname")
response.write "</a>"
%>
                </td>
                  <td width="50" align="center"> 
                    <%
marketprice=rs_temp("marketprice")
response.write marketprice
%>
                </td>
                  <td width="50" align="center"> 
                    <%
newprice=rs_temp("newprice")
response.write newprice
%>
                </td>
                  <td width="50" align="center"> 
                    <%
vipprice=rs_temp("vipprice")
response.write vipprice
%>
                </td>
                  <td width="100" align="center"> 
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <form method="post" action="shopping_modi_number.asp?id=<%=rs("id")%>">
                      <tr> 
                        <td align="center"> 
                          <input size=3 value=<%=rs("buynumber")%> name=buynumber>
                          <b> 
                          <input type="submit" name="Submit2" value="修改" class="sinput">
                          </b></td>
                      </tr>
                    </form>
                  </table>
                </td>
                  <td width="60" align="center"> 
                    <%
buynumber=rs("buynumber")
if session("userlevel")=2 then
	totalprice=vipprice*buynumber
else
	totalprice=newprice*buynumber
end if
	response.write "<font color=0000ff>"&totalprice&"</font>"
%>
                </td>
                  <td width=60 align="center"> 
                    <%
if session("userlevel")=2 then
	diffprice=marketprice-vipprice
else
	diffprice=marketprice-newprice
end if
response.write diffprice*buynumber

//算原价,新鲜价,VIP价总和
sum_marketprice=sum_marketprice+marketprice*buynumber
sum_newprice=sum_newprice+newprice*buynumber
sum_vipprice=sum_vipprice+vipprice*buynumber
%>
                </td>
                  <td width="60" align="center"><a href="shopping_del.asp?id=<%=rs("id")%>" class="LeftTypeLink">不买这个</a></td>
              </tr>
              <%
    i=i+1                                  
    rs.movenext                                  
    loop       
%>
              </tbody> 
            </table>
            <table cellspacing=0 cellpadding=0 width=94% align=center border=0>
              <tbody> 
              <tr align=left> 
                <td width="33%" height=24> 商品原价总计:<%=sum_marketprice%>元 </td>
                <td align=middle width="34%" height=24><strong><font color="#FF0000"> 
                  <%if session("userlevel")=2 then%>
                  VIP价总计:<%=sum_vipprice%>元 
                  <%else%>
                  会员价总计:<%=sum_newprice%>元 
                  <%end if%>
                  </font></strong></td>
                <td align=right width="33%" height=24>您共节省:<font color=0000ff> 
                  <%if session("userlevel")=2 then response.write sum_marketprice-sum_vipprice else response.write sum_marketprice-sum_newprice end if%>
                  </font>元</td>
              </tr>
              <tr valign="middle"> 
                <td colspan=3 height="30"><b></b></td>
              </tr>
              </tbody> 
            </table>
            <table cellspacing=0 cellpadding=0 width=94% align=center border=0>
              <tbody> 
              <tr valign="middle"> 
                <td align=center>如果您还想挑选其它商品,请点<br>
                  击“继续选购”找你喜欢的商品</td>
                <td align=center><a href="javascript:self.close()"><img src="images/buy_B_jxxg.gif" width="126" height="34" border="0"></a></td>
                <td align="center">&nbsp;</td>
                <td align="center"> <a href="reckoning.asp"><img src="images/buy_B_jzh.gif" width="126" height="34" border="0"></a></td>
                <td>如果您已经挑选完商品,请<br>
                  点击“立即结帐”进入提交订单<br>
                  并填写收货信息! </td>
              </tr>
              <tr valign="middle"> 
                <td height="35" align=center>&nbsp;</td>
                <td align=center>&nbsp;</td>
                <td align="center" width="50">&nbsp;</td>
                <td align="center">&nbsp;</td>
                <td align="center">&nbsp;</td>
              </tr>
              </tbody> 
            </table>
          </td>
        </tr>
      </table>
      <%
end if
%>
    </td>
  </tr>
</table>
<!-- #include file="include/bottom.asp" -->
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -