📄 check.asp
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="util.asp" -->
<!--#include file="conn.asp" -->
<%
'判断顾客同一张订单里是否在同一个商场选购货物
shopname=request("shopname")
if session("shop")="" then
session("shop")=shopname
end if
If Session("shop")<>shopname Then
response.redirect"shoperror.asp"
End If
'读取session值写入变量中/////////////
ProductList = Session("ProductList")
'split函数表示返回一个以 逗号分隔的数组////////
Products = Split(Request("cpbm"), ", ")
'ubonnd函数表示返回字符变量( )里的最大索引号////////
For I=0 To UBound(Products)
PutToShopBag Products(I), ProductList
Next
'写入session的值到变量中////////////
Session("ProductList") = ProductList
ProductList = Session("ProductList")
'函数len( )返回字符变量( )里的长度///////
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
%>
<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 topmargin="5" bgcolor="#E6E4C4">
<table width="100%" border="0" cellspacing="0">
<tr>
<td width="80%" valign="top"><p align="center">
<font color="#FF0000" class=main1>以下是您在</font><font color="#0000FF" class=main1><%=session("shop")%></font><font color="#FF0000" class=main1>所选购的物品清单</font></p>
<form Action="Check.asp" Method="POST" onsubmit="return form1_onsubmit()" >
<input type="hidden" name="MySelf" value="Yes">
<input type="hidden" name="shopname" value="<%=session("shop")%>">
<div align="center"><center>
<table border="1" cellpadding="0" cellspacing="0" width="524" bordercolor="#008000" bordercolorlight="#008000" bordercolordark="#FFFFFF" class=main>
<tr bgcolor="#6d8e4d">
<td align="center" width="59" height="22"><font color="#FFFFFF">商品编号</font></td>
<td align="center" width="191" height="22"><font color="#FFFFFF">商品名称</font></td>
<td align="center" width="76" height="22"><font color="#FFFFFF">商品价格</font></td>
<td align="center" width="77" height="22"><font color="#FFFFFF">商品数量</font></td>
<td align="center" width="34" height="22"><font color="#FFFFFF">购买</font></td>
<td align="center" width="73" height="22"><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">
<input type="button" value="继续购物" name="B2" onclick="window.close();" style="font-size: 9pt">
<input type="button" value="订单取消" name="B3" onclick="javascript:window.location='Clear.asp'" style="font-size: 9pt">
<input type="button" value="去收银台" name="B4" onclick="window.opener.location.href='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 + -