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

📄 check.asp

📁 一套很早的多用户电子商务程序
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="util.asp" -->
<!--#include file="conn.asp" -->
<%
If Session("LoginSuccess")="" Then
Response.Write ("<script>alert('对不起,你还没有登录,不能购买商品和查看购物车!');javascript:window.close()</script>")
response.end()
end if
shopname=request("shopname")
if session("shop")="" then
  session("shop")=shopname
end if
If Session("shop")<>shopname Then
   response.redirect"shoperror.asp"
 End If
ProductList = Session("ProductList")
Products = Split(Request("cpbm"), ", ")
For I=0 To UBound(Products)
   PutToShopBag Products(I), ProductList
Next

Session("ProductList") = ProductList



ProductList = Session("ProductList")
If Len(ProductList) =0 Then
 Response.Redirect "Nothing.asp"
 response.end
end if

If Request("MySelf") = "Yes" Then
   ProductList = ""
   Products = Split(Request("cpbm"), ", ")
   For I=0 To UBound(Products)
      PutToShopBag Products(I), ProductList
   Next
   Session("ProductList") = ProductList
End If
If Len(ProductList) = 0 Then
 Response.Redirect "Nothing.asp"
 response.end
end if
set rs=server.createobject("adodb.recordset")
sql = "Select * From Product"
sql = sql & " Where Product_Id In (" & ProductList & ")"
rs.open sql,conn,3,3
'response.Write(ProductList)
'response.End()

%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type=text/css>.main {
	FONT-SIZE: 9pt
}
.main1 {
	FONT-SIZE: 14px
}

</STYLE>
<title>物品清单</title>




<script language="Javascript">
//函数名:fucCheckNUM
//功能介绍:检查是否为数字
//参数说明:要检查的数字
//返回值:1为是数字,0为不是数字
function fucCheckNUM(NUM)
{
	var i,j,strTemp;
	strTemp="0123456789";
	if ( NUM.length== 0)
		return 0
	for (i=0;i<NUM.length;i++)
	{
		j=strTemp.indexOf(NUM.charAt(i));	
		if (j==-1)
		{
		//说明有字符不是数字
			return 0;
		}
	}
	//说明是数字
	return 1;
}

function clean() 
 { 
 //订单取消后转向另一页面
  window.location.href="clear.asp"
  }
</script>
<SCRIPT language=javascript id=clientEventHandlersJS>
<!--
function form1_onsubmit() 
{
newprice="Q_" & rs("Product_Id")
 	if ((fucCheckNUM(document.FORM1.newprice.value)==0) )
	{	alert ("会员价有非法字符,请填写正确会员价。");
		document.FORM1.newprice.focus();
		return false;
	}
//-->
}
</SCRIPT>
</head>
<body background="pic/user/bg.jpg" topmargin="5">
<table width="100%" border="0" cellspacing="0">
  <tr>
    <td width="80%" valign="top">
<form Action="Check.asp" Method="POST" onsubmit="return form1_onsubmit()" >
        <div align="center">
          <input type="hidden" name="MySelf" value="Yes">
          <input type="hidden" name="shopname" value="<%=session("shop")%>">
          <font color="#FF0000" class=main1 >以下是您选购的物品清单</font> </div>
        <div align="center"><center>
            <table border="1" cellpadding="0" cellspacing="0" width="524" bordercolorlight="#0000FF" bordercolordark="#FFFFFF" class=main>
              <tr bgcolor="#0066FF"> 
                <td width="59"  height="22" align="center"><font color="#FFFFFF">商品编号</font></td>
                <td width="191"  height="22" align="center"><font color="#FFFFFF">商品名称</font></td>
                <td width="76" height="22" align="center"><font color="#FFFFFF">商品价格</font></td>
                <td width="77"  height="22" align="center"><font color="#FFFFFF">商品数量</font></td>
                <td width="34"  height="22" align="center"><font color="#FFFFFF">购买</font></td>
                <td width="73"  height="22" align="center"><font color="#FFFFFF">总价</font></td>
        </tr>
<%
   Sum = 0
   While Not rs.EOF
     Quatity = CInt( Request( "Q_" & rs("Product_Id")) )
     If Quatity <= 0 Then 
        Quatity = CInt( Session(rs("Product_Id")) )
        If Quatity <= 0 Then Quatity = 1
     End If
     Session(rs("Product_Id")) = Quatity
     Sum = Sum + ccur(rs("P_NewPrice")) * Quatity
%>
        <tr>
          <td align="center" width="59"><%=rs("Product_ID")%>
</td>
          <td align="center" width="191"><%=rs("Product_Name")%>
</td>
          <td align="center" width="76"><%=rs("P_NewPrice")%>
</td>
          <td align="center" width="77"><input Name="<%="Q_" & rs("Product_Id")%>" Value="<%=Quatity%>" Size="3"></td>
          <td Align="center" width="34"><input Type="CheckBox" Name="cpbm" Value="<%=rs("Product_Id")%>" Checked> 
</td>
          <td Align="center" width="73"><%=ccur(rs("P_NewPrice"))*Quatity%>.00元
</td>
        </tr>
<%
      rs.MoveNext
   Wend
%>
        
		
		<tr>
      <td Align="Right" ColSpan="6" width="520"><font Color="Red">总价格=人民币 <%=Sum%>.00元</font></td>  
        </tr>
      </table>
      </center></div><blockquote>
        <p align="center">
        <input Type="submit" Value="确认更改" name="B1" style="font-size: 9pt">&nbsp;&nbsp;&nbsp; 
        <input type="button" value="继续购物" name="B2" onclick="window.close();" style="font-size: 9pt">&nbsp;&nbsp;&nbsp; 
        <input type="button" value="订单取消" name="B3" onclick="javascript:window.location='Clear.asp'" style="font-size: 9pt">&nbsp;&nbsp;&nbsp; 
        <input type="button" value="去收银台" name="B4" onclick="window.open('PayMent.asp');window.close();" style="font-size: 9pt">
      </blockquote>
    </form>
    </td>
  </tr></table>
<%
rs.close
conn.close
%>
</body>
</html>

⌨️ 快捷键说明

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