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

📄 basket.asp

📁 自做的购物网站
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="css.asp"-->
<head>
<link href=css.css rel=STYLESHEET type=text/css>
<title><%if session("user_name")<>"" then%>
<%=session("user_name")%>的购物车
<%else
response.write "购物车"
end if%>
</title>

<b> 
<%
if session("user_name")="" then
	response.write "<BR>"
    response.write "1.你尚未登录!请登录后再订购本站商品!"
    response.write "<br>2.第一次来本站,请先注册会员(免费)!"
	response.write "<BR>"
end if

if trim(request("hw_id"))="" then
    response.write "没有此货物"
    response.end
end if
dim rs,sql
sql="select * from hw where hw_id="&request("hw_id")
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,3
%>
<body topmargin="0"> <br>
<table border="0" width="400" cellspacing="0" cellpadding="0">
  <tr> 
    <td height="16"> <form method="POST" action="buy.asp?action=buy&hw_id=<%=rs("hw_id")%>&hw_name=<%=rs("hw_name")%>&hw_cash=<%if session("user_type")="会员" then%>                 <%=rs("hw_cash")%>			                  <%else%>				               <%=rs("daili")%>			                  <%end if%> ">
        <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#525e6b cellSpacing=0 
      cellPadding=0 width="100%" align=center border=1>
          <TBODY>
            <TR> 
              <TD width="100%"> <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 
            cellSpacing=0 cellPadding=0 width="100%" border=0>
                  <TBODY>
                    <TR> 
                      <TD vAlign=top width=300> <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 
                  cellSpacing=0 cellPadding=0 width="100%" 
                  background="images/pics2/infobg.gif" 
                  border=0>
                          <TBODY>
                            <TR> 
                              <TD width=45><IMG height=32 
                        src="images/pics2/icon.gif" 
                        width=40 border=0></TD>
                              <TD vAlign=middle><font color="#FFFFFF">所选购的商品信息</font> 
                              </TD>
                              <TD width=43> <P align=right><IMG height=32 
                        src="images/pics2/edge(1).gif" 
                        width=43 border=0></P></TD>
                            </TR>
                          </TBODY>
                        </TABLE></TD>
                      <TD align=right 
                background="images/pics2/rightbg.gif"> <IMG 
                  alt=- 
                  src="images/pics2/space1.gif" width="3" height="32"></TD>
                    </TR>
                  </TBODY>
                </TABLE></TD>
            </TR>
            <TR> 
              <TD width="100%"> <TABLE id=AutoNumber6 style="BORDER-COLLAPSE: collapse" 
            borderColor=#111111 cellSpacing=0 cellPadding=2 width="100%" 
            border=0>
                  <TBODY>
                    <TR> 
                      <TD width="100%"><br>
                        <table width="90%" border="0" align="center" cellpadding="0" cellspacing="1" background="IMAGES/pics2/infobg.gif">
                          <tr background="IMAGES/pics2/infobg.gif"> 
                            <td width="155" height="25"> 
                              <div align="center"><font color="#FFFFFF">商品名称</font></div></td>
                            <td width="60" height="25"> <div align="center"><font color="#FFFFFF">商品单价</font></div></td>
                            <td width="60" height="25"> <div align="center"><font color="#FFFFFF">订购数量</font></div></td>
                            <td width="80" height="25"> <div align="center"><font color="#FFFFFF">确认购买</font></div></td>
                          </tr>
                          <tr> 
                            <td width="155" height="30" bgcolor="#FFFFFF"> <div align="center"><font color="#FF0000"><%=rs("hw_name")%></font></div></td>
                            <td width="60" height="30" bgcolor="#FFFFFF"> <div align="center"> 
                                <%if session("user_type")="会员" then%>
                                <%=rs("hw_cash")%> 
                                <%else%>
                                <%=rs("daili")%> 
                                <%end if%>
                                元</div></td>
                            <td width="60" height="30" bgcolor="#FFFFFF"> <div align="center"> 
                                <select size="1" name="count">
                                  <%for i = 1 to 100%>
                                  <option><%=i%></option>
                                  <%next%>
                                </select>
                              </div></td>
                            <td width="80" height="30" bgcolor="#FFFFFF"> <div align="center"> 
                                <input name=B1 type=image id="B1" 
      src="IMAGES/pics2/s_button000.gif" alt=投诉 
      align=absMiddle width="45" height="20" cache tppabs="">
                              </div></td>
                          </tr>
                        </table>
                        <br>
                      </TD>
                    </TR>
                  </TBODY>
                </TABLE></TD>
            </TR>
            <TR> 
              <TD width="100%" height="20" bgColor=#3e3e4b>&nbsp; </TD>
            </TR>
          </TBODY>
        </TABLE>
      </form></td>
  </tr>
  <tr> 
    <td height="30" valign="top"><table width="83%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="33%"><a href="buy.asp"><img src="IMAGES/pics/lookbcar.gif" width="100" height="20" border="0"></a></td>
          <td width="33%"><a href="clear.asp"><img src="IMAGES/pics/relbcar.gif" width="100" height="20" border="0"></a></td>
          <td width="33%"><a href="cash.asp"><img src="IMAGES/pics/gobuy.gif" width="100" height="20" border="0"></a></td>
        </tr>
      </table></td>
  </tr>
  <%rs.close
%>
  <tr> 
    <td height="18"><TABLE style="BORDER-COLLAPSE: collapse" borderColor=#525e6b cellSpacing=0 
      cellPadding=0 width="100%" align=center border=1>
        <TBODY>
          <TR> 
            <TD width="100%"> <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 
            cellSpacing=0 cellPadding=0 width="100%" border=0>
                <TBODY>
                  <TR> 
                    <TD vAlign=top width=300> <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 
                  cellSpacing=0 cellPadding=0 width="100%" 
                  background="images/pics2/infobg.gif" 
                  border=0>
                        <TBODY>
                          <TR> 
                            <TD width=45><IMG height=32 
                        src="images/pics2/icon.gif" 
                        width=40 border=0></TD>
                            <TD vAlign=middle><font color="#FFFFFF">你已选购的商品如下 
                              </font></TD>
                            <TD width=43> <P align=right><IMG height=32 
                        src="images/pics2/edge(1).gif" 
                        width=43 border=0></P></TD>
                          </TR>
                        </TBODY>
                      </TABLE></TD>
                    <TD align=right 
                background="images/pics2/rightbg.gif"> <IMG 
                  alt=- 
                  src="images/pics2/space1.gif" width="3" height="32"></TD>
                  </TR>
                </TBODY>
              </TABLE></TD>
          </TR>
          <TR> 
            <TD width="100%"> <TABLE id=AutoNumber6 style="BORDER-COLLAPSE: collapse" 
            borderColor=#111111 cellSpacing=0 cellPadding=2 width="100%" 
            border=0>
                <TBODY>
                  <TR> 
                    <TD width="100%"><br>
                      <table width="90%" border="0" align="center" cellspacing="1" background="IMAGES/pics2/infobg.gif">
                        <tr> 
                          <td width="110" height="25"> <div align="center"><font color="#FFFFFF">商品名称</font></div></td>
                          <td width="52" height="20"> <div align="center"><font color="#FFFFFF">商品单价</font></div></td>
                          <td width="45" height="20"> <div align="center"><font color="#FFFFFF">数量</font></div></td>
                          <td width="70" height="20"> <div align="center"><font color="#FFFFFF">合计</font></div></td>
                          <td height="20" width="60"> <div align="center"><font color="#FFFFFF">取消</font></div></td>
                        </tr>
                        <%sql="select * from basket where user_name='"&session("user_name")&"' and basket_check=false"
        rs.open sql,conn,3,3
        if rs.eof then
        %>
                        <tr> 
                          <td height="25" colspan="5" bgcolor="#FFFFFF">你没有选择任何商品</td>
                        </tr>
                        <%else
        do while not rs.eof%>
                        <tr> 
                          <td width="110" height="25" bgcolor="#FFFFFF"> <div align="center"><%=rs("hw_name")%> 
                            </div></td>
                          <td width="52" height="25" bgcolor="#FFFFFF"> <div align="center"><%=rs("hw_cash")%> 
                              元</div></td>
                          <td width="45" height="25" bgcolor="#FFFFFF"> <div align="center"><%=rs("basket_count")%> 
                            </div></td>
                          <%a=0%>
                          <td height="25" bgcolor="#FFFFFF"> <div align="center"><%=rs("basket_count")*rs("hw_cash")%> 
                              元</div></td>
                          <td height="25" bgcolor="#FFFFFF" width="60"> <div align="center"><a href="clear.asp?basket_id=<%=rs("basket_id")%>"><u><img src="IMAGES/pics2/s_button000-2.gif" width="45" height="20" border="0"></u></a></div></td>
                        </tr>
                        <%totalcash=totalcash+(rs("basket_count")*rs("hw_cash"))%>
                        <%rs.movenext
        loop
        end if
        rs.close
        set rs=nothing
        conn.close
        set conn=nothing
        %>
                        <tr> 
                          <td height="25" colspan="3" bgcolor="#FFFFFF"> 
                            <div align="center">总计</div></td>
                          <td height="25" bgcolor="#FFFFFF" colspan="2"> 
                            <div align="center"><font color=red><%=totalcash%></font> 
                              元</div></td>
                        </tr>
                      </table>
                      <br>
                    </TD>
                  </TR>
                </TBODY>
              </TABLE></TD>
          </TR>
          <TR> 
            <TD width="100%" height="20" bgColor=#3e3e4b>&nbsp; </TD>
          </TR>
        </TBODY>
      </TABLE> </td>
  </tr>
  <tr> 
    <td height="16"> </form> </td>
  </tr>
  <tr> 
    <td>&nbsp; </td>
  </tr>
  <tr> 
    <td></td>
  </tr>
</table>

⌨️ 快捷键说明

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