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

📄 basket.asp

📁 ASP入门与提高实用教程 源文件(上传网站)
💻 ASP
字号:
<!--#include file="conn.asp"-->
<head>
<link href=style.css rel=STYLESHEET type=text/css>
<title><%if session("user_name")<>"" then%>
<%=session("user_name")%>的购物篮
<%else
response.write "购物篮"
end if%>
</title>
</head>
<center>
<%
if session("user_name")="" then
    response.write "你尚未登录或不是本站会员!"
    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
%>
<table border="0" width="400" cellspacing="0" cellpadding="0">

    <td width="100%" bgcolor="#FF9933" height="18">  
      <p align="center">物品信息  <tr>
      <p align="center">
  </tr>
  <tr>

    <td width="100%"><form method="POST" action="buy.asp?action=buy&hw_id=<%=rs("hw_id")%>&hw_name=<%=rs("hw_name")%>&hw_cash=<%=rs("hw_cash")%>">
      <table border="0" width="100%" cellspacing="1">
        <tr>
          <td width="100%">
            <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#66CCFF">
              <tr>
                <td width="20%">商品编号</td>
                <td width="20%">商品名称</td>
                <td width="20%">商品单价</td>
                <td width="20%">订购数量</td>
                <td width="20%">确认购买</td>
              </tr>
              <tr>
                <td width="20%"><%=rs("hw_id")%></td>
                <td width="20%"><%=rs("hw_name")%></td>
                <td width="20%"><%=rs("hw_cash")%>元</td>
                <td width="20%"><select size="1" name="count">
                  <%for i = 1 to 100%><option><%=i%></option><%next%>
                  </select></td>
                <td width="20%"><input type="submit" value="确定" name="B1"></td>
              </tr>
            </table>
          </td>
        </tr>
      </table></form>
    </td>  </tr>

<%rs.close
%>
  <tr>
    <td width="100%"></td>
  </tr>
  <tr>
    <td width="100%"><a href="buy.asp">查看购物栏</a> <a href="cash.asp" target="blank">收银台</a> 
      <a href="clear.asp">清空购物栏</a></td>
  </tr>
  <tr>
    <td width="100%" bgcolor="#FF9933" height="18">
      <p align="center">你已选购的货物如下</td>
  </tr>
  <tr>
    <td width="100%" bgcolor="#66CCFF">
      <table border="0" width="100%" cellspacing="1">
        <tr>
          <td width="20%" bgcolor="#FFFFFF">商品编号</td>
          <td width="20%" bgcolor="#FFFFFF">商品名称</td>
          <td width="20%" bgcolor="#FFFFFF">商品单价</td>
          <td width="20%" bgcolor="#FFFFFF">订购数量</td>
          <td width="20%" bgcolor="#FFFFFF">合计</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 width="100%" bgcolor="#FFFFFF" colspan="5">你没有选择任何商品</td>
        </tr>
        <%else
        do while not rs.eof%>
        <tr>
          <td width="20%" bgcolor="#FFFFFF"><%=rs("hw_id")%></td>
          <td width="20%" bgcolor="#FFFFFF"><%=rs("hw_name")%></td>
          <td width="20%" bgcolor="#FFFFFF"><%=rs("hw_cash")%>元</td>
          <td width="20%" bgcolor="#FFFFFF"><%=rs("basket_count")%></td>
          <td width="20%" bgcolor="#FFFFFF"><%=rs("basket_count")*rs("hw_cash")%>元</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 width="80%" bgcolor="#FFFFFF" colspan="4">总计</td>
          <td width="20%" bgcolor="#FFFFFF"><font color=red><%=totalcash%></font>元</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td width="100%"></td>
  </tr>
</table>

⌨️ 快捷键说明

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