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

📄 cash.asp

📁 自做的购物网站
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="css.asp"-->
<title>收银台</title>
<%
if session("user_name")="" then
    response.write  "<br>"
	response.write "<center>"
	response.write  "1.你尚未登录!请登录后再订购本站图书!"
    response.write "<br>2.第一次来本站,请先注册会员(免费)!"
	response.write  "<br>"
	response.write  "<br>"

    response.end
end if

dim sql,rs
set rs=server.createobject("adodb.recordset")
if request("action")="buy" then

if request("count")="" then
    count=1
else
    count=request("count")
end if

if request("hw_id")="" then
    response.write "没有此货物!"
else
    hw_id=request("hw_id")
end if

sql="select * from basket where hw_id='"&hw_id&"' and user_name='"&session("user_name")&"' and basket_check=false"
rs.open sql,conn,3,3
if rs.eof then
rs.addnew
rs("hw_id")=hw_id
rs("user_name")=session("user_name")
rs("basket_count")=count
rs("basket_date")=now()
rs("hw_name")=request("hw_name")
rs("hw_cash")=request("hw_cash")
rs("user_type")=request("user_type")
else
rs("basket_count")=int(rs("basket_count"))+int(count)
end if
rs.update
rs.close
%>
</b></FONT>
<%end if%>
<br>
<table width="400" border="0" cellspacing="0" cellpadding="0" align="center" height="25">
  <tr> 
    <td height="25" valign="top"> <form method="POST" action="cashsave.asp">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" >
          <tr> 
            <td valign="top"><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><font color="#FFFFFF"><IMG height=32 
                        src="images/pics2/icon.gif" 
                        width=40 border=0></font></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="195" 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>
                                <%
      user_name=session("user_name")
      sql="select * from basket where user_name='"&user_name&"' and basket_check=false"
      rs.open sql,conn,3,3
      if rs.eof then
          response.write "你没有订购任何商品"
      else
      do while not rs.eof
      %>
                                <tr> 
                                  <td width="195" height="25" bgcolor="#FFFFFF"><div align="center"><font color=red><%=rs("hw_name")%></font></div></td>
                                  <td width="60" height="25" bgcolor="#FFFFFF"><div align="center"><%=rs("hw_cash")%>元</div></td>
                                  <td width="60" height="25" bgcolor="#FFFFFF"><div align="center"><%=rs("basket_count")%></div></td>
                                  <td width="80" height="25" bgcolor="#FFFFFF"><div align="center"><%=rs("hw_cash")*rs("basket_count")%>元 
                                    </div></td>
                                </tr>
                                <%totalcash=totalcash+(rs("hw_cash")*rs("basket_count"))%>
                                <%rs.movenext
      loop
      end if
      rs.close
      %>
                                <tr> 
                                  <td height="25" bgcolor="#FFFFFF"><div align="center"><b class="dz1">总计:<font color=red><%=totalcash%></font>元</b></div></td>
                                  <td height="25" colspan="3" bgcolor="#FFFFFF"><div align="center"><b class="dz1"> 
                                      <input 
      align=absMiddle alt=确认 cache name="B1" 
      src="IMAGES/pics2/s_button000.gif" type=image tppabs="" width="45" height="20">
                                      </b></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>
        </table>
      </form></td>
  </tr>
</table>

⌨️ 快捷键说明

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