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

📄 basket.asp

📁 商品订单管理:商品分类管理 添加与修改商品 管理订单 投诉订单 反馈信息 商品留言管理 管理网站用户:管理用户 管理后台管理员 新闻公告管理:新闻添加(支持图片新闻) 修改删除 首页公告设置 网站常规
💻 ASP
字号:

<!--#include file="conn.asp"--><head>
<link href=img/css.css rel=STYLESHEET type=text/css>
<title><%if session("user_name")<>"" then%>
<%=session("user_name")%>'s cart 
<%else
response.write "My cart"
end if%>
</title></head>
<body topmargin="0"><b>
<%
if session("user_name")="" then
        response.write  "<br>"
	response.write "<center>"
	response.write  "1.Already our member, Please Login First!"
        response.write "<br>"
	response.write  "<br>2.New to our, If you want to login, you'll need to register first.<a href=reg.asp target=_blank><font color=#FF0000> register </font></a>!"
	response.write  "<br>"
    response.end
end if

if trim(request("hw_id"))="" then
    response.write "the product is not found."
    response.end
end if

hw_id = Request.QueryString("hw_id")
If Not(isNumeric(hw_id)) Then
Response.Write "<p align=center>The wrong URL.</p>"
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
%></b>
<p>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr> 
    <td align="center" bgcolor="#23508C"><font color="#000000"><b>
    <img border="0" src="img/promo_list_top.gif" width="100%" height="4"></td></tr>
  <tr> 
    <td height="18" align="center" bgcolor="#DBC2B0"><b><font color="#F4F4F4">The products you want to buy:</font></b></td></tr><tr> 
    <td height="16"> <form name="form1" method="POST" action="buy.asp?action=buy&hw_id=<%=rs("hw_id")%>&hw_name=<%=rs("hw_name")%>&isbn=<%=rs("isbn")%>&hw_cash=<%if session("user_type")="会员" then%>                 <%=rs("hw_cash")%>			                  <%else%>				               <%=rs("daili")%>			                  <%end if%> "  onSubmit="return onlyNum()">
        <table border="0" width="100%" cellspacing="0" height="34" cellpadding="0">
          <tr bgcolor="#FFFFFF"> 
            <td bgcolor="#F5EFE7">
            <div align="center">
              <center>
              <table width="90%" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
                <tr background="img/tile_bg.gif"> 
                  <td width="95" height="25"> <div align="center">Name</div></td>
                  <td width="60" height="25"> <div align="center">Price</div></td>
                  <td width="60" height="25"> <div align="center">Points</div></td>
                  <td width="60" height="25"> <div align="center">Count</div></td>
                  <td width="80" height="25"> <div align="center">Order</div></td>
                </tr>
                <tr> 
                  <td width="95" height="30"> <div align="center"><%=rs("hw_name")%></div></td>
                  <td width="60" height="30"> <div align="center"> 
                      <%if session("user_type")="member" then%>
                      <%=rs("hw_cash")%> 
                      <%else%>
                      <%=rs("daili")%> 
                      <%end if%>
                      Yuan</div></td>
                      <td width="60" height="25"> <div align="center"><%=rs("isbn")%></div></td>
                  <td width="60" height="30"> <div align="center"> 
                      <input name="count" type="text" size=3>
                    </div></td>
                  <td width="80" height="30"> <div align="center">
                      <input name=B1 type=image id="B1" 
      src="img/ok.gif" alt=order 
      align=absMiddle width="45" height="20" cache tppabs="">
                    </div></form></td>
                </tr>
              </table>
              </center>
            </div></tr>
        </table>
      </td>
  </tr>
  <tr> 
    <td height="30" valign="top" bgcolor="#F5EFE7"><table width="83%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="33%"><a href="buy.asp"><img src="img/lookbcar.gif" width="100" height="20" border="0"></a></td>
          <td width="33%"><a href="clear.asp"><img src="img/relbcar.gif" width="100" height="20" border="0"></a></td>
          <td width="33%"><a href="cash.asp"><img src="img/gobuy.gif" width="100" height="20" border="0"></a></td>
        </tr>
      </table></td>
  </tr>
  <%rs.close
%>
  <tr> 
    <td align="center">
    <img border="0" src="img/promo_list_top.gif" width="100%" height="4"></td>
  </tr>
  <tr> 
    <td height="18" align="center" bgcolor="#DBC2B0"><b><font color="#F4F4F4">The products in your cart:</font></b></td>
  </tr>
  <tr> 
    <td height="16">
        <table border="0" width="100%" cellspacing="0" height="34" cellpadding="0">
          <tr>   
         <td bgcolor="#F5EFE7"><br>
            <div align="center">
              <center>
            <table width="90%" border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0">
              <tr> 
                <td width="95" height="25"><div align="center">Name</div></td>
                <td width="60" height="20"><div align="center">Price</div></td>
                <td width="60" height="20"><div align="center">Points</div></td>
                <td width="60" height="20"><div align="center">Count</div></td>
                <td width="80" height="20"><div align="center">Total Price</div></td>
                <td width="80" height="20"><div align="center">Total Points</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 width="100%" height="25" colspan="6">No product in your cart.</td>
              </tr>
              <%else
        do while not rs.eof%>
              <tr> 
                <td width="155" height="25"><div align="center"><%=rs("hw_name")%> 
                  </div></td>
                <td width="60" height="25"><div align="center"><%=rs("hw_cash")%> 
                  元</div></td>
                  <td width="60" height="25"><div align="center"><%=rs("isbn")%></div></td>
                <td width="60" height="25"><div align="center"><%=rs("basket_count")%> 
                  </div></td>
                <%a=0%>
                <td width="80" height="25"> <div align="center"><%=rs("basket_count")*rs("hw_cash")%> 
                  元</div></td>
                <td width="80" height="25"> <div align="center"><%=rs("basket_count")*rs("isbn")%> 
                  元</div></td>
              </tr>
              <%totalcash=totalcash+(rs("basket_count")*rs("hw_cash"))%>
              <%totalisbn=totalisbn+(rs("basket_count")*rs("isbn"))%>
              <%rs.movenext
        loop
        end if
        rs.close
        set rs=nothing
        conn.close
        set conn=nothing
        %>
              <tr> 
                <td height="25" colspan="6"><div align="center">You should Pay:<font color=red><%=totalcash%></font>RMB Received Points:<%=totalisbn%></div></td>
              </tr>
            </table>
              </center>
          </div>
            <table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
                <tr> 
                  <td valign="middle"><div align="center"><img src="img/seperator.gif" width="359" height="1"></div></td>
                </tr>
              </table></td>
          </tr>
        </table>
      </form></td>
  </tr>
</table>
<script language=javascript>
function onlyNum()
{
  if(isNaN(form1.count.value)){    
	alert("Please input number!");
	return false;
	}
	return true;
}
</script>

⌨️ 快捷键说明

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