![]() |
#2
dzt00012011-06-30 11:59
|
只有本站会员才能查看附件,请 登录
怎么总额计算错误的
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Connections/connshop.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("cx") <> "") Then
Recordset1__MMColParam = Request.QueryString("cx")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_connshop_STRING
Recordset1.Source = "SELECT * FROM pay WHERE author = '" + Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.>
<html xmlns="http://www.>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body><table width="700" border="1" cellpadding="5" cellspacing="0" bordercolor="#E8E09F" id="detailItem" align="center" >
<tr>
<td colspan="6" nowrap bgcolor="#F3EFCD" class="STYLE7 " align="center"><h1>出仓单</h1></td></tr>
<tr>
<td colspan="2" nowrap bgcolor="#F3EFCD" class="STYLE7 "><span class="STYLE7 "><strong>客户名称:</strong><strong><%=(Recordset1.Fields.Item("user").Value)%>
<label></label>
</strong></span></td>
<td nowrap bgcolor="#F3EFCD" colspan="2" class="STYLE7 "><strong> 电话:<%=(Recordset1.Fields.Item("tel").Value)%></strong></td>
<td nowrap bgcolor="#F3EFCD" colspan="2" class="STYLE7 "><strong>NO.
<label></label>
<%=(Recordset1.Fields.Item("NO").Value)%></strong></td>
</tr>
<tr>
<td nowrap bgcolor="#F3EFCD" class="STYLE7 td1" align="center"><strong>商品名称</strong></td>
<td nowrap bgcolor="#F3EFCD" class="td1 STYLE7" align="center"><strong>规 格</strong></td>
<td nowrap bgcolor="#F3EFCD" class="STYLE7 td1" align="center"><strong>单位</strong></td>
<td nowrap bgcolor="#F3EFCD" class="STYLE7 td1" align="center"><strong>数量</strong></td>
<td nowrap bgcolor="#F3EFCD" class="STYLE7 td1" align="center"><strong>单价</strong></td>
<td nowrap bgcolor="#F3EFCD" class="STYLE7 td1" align="center"><strong>金额</strong></td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<tr >
<td nowrap bgcolor="#F3EFCD" ><%=(Recordset1.Fields.Item("name").Value)%></td>
<td nowrap bgcolor="#F3EFCD"><%=(Recordset1.Fields.Item("size").Value)%></td>
<td nowrap bgcolor="#F3EFCD"><%=(Recordset1.Fields.Item("unit").Value) %></td>
<td nowrap bgcolor="#F3EFCD"><%quantityw=(Recordset1.Fields.Item("quantity").Value)
response.Write(quantityw)%></td>
<td nowrap bgcolor="#F3EFCD"><%price=(Recordset1.Fields.Item("pric").Value)
sum=quantityw*price
response.Write(price)%></td>
<td nowrap bgcolor="#F3EFCD"><%response.write(sum)%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
<tr>
<td colspan="7" nowrap bgcolor="#F3EFCD" class="STYLE7 " align="center">总额:
<%dim i,sum2
for i=1 to sum
sum2=sum+i
next
response.Write(sum2)%>
</td>
</tr>
</table>
</body></html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<!--#include file="../Connections/connshop.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("cx") <> "") Then
Recordset1__MMColParam = Request.QueryString("cx")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_connshop_STRING
Recordset1.Source = "SELECT * FROM pay WHERE author = '" + Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.>
<html xmlns="http://www.>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body><table width="700" border="1" cellpadding="5" cellspacing="0" bordercolor="#E8E09F" id="detailItem" align="center" >
<tr>
<td colspan="6" nowrap bgcolor="#F3EFCD" class="STYLE7 " align="center"><h1>出仓单</h1></td></tr>
<tr>
<td colspan="2" nowrap bgcolor="#F3EFCD" class="STYLE7 "><span class="STYLE7 "><strong>客户名称:</strong><strong><%=(Recordset1.Fields.Item("user").Value)%>
<label></label>
</strong></span></td>
<td nowrap bgcolor="#F3EFCD" colspan="2" class="STYLE7 "><strong> 电话:<%=(Recordset1.Fields.Item("tel").Value)%></strong></td>
<td nowrap bgcolor="#F3EFCD" colspan="2" class="STYLE7 "><strong>NO.
<label></label>
<%=(Recordset1.Fields.Item("NO").Value)%></strong></td>
</tr>
<tr>
<td nowrap bgcolor="#F3EFCD" class="STYLE7 td1" align="center"><strong>商品名称</strong></td>
<td nowrap bgcolor="#F3EFCD" class="td1 STYLE7" align="center"><strong>规 格</strong></td>
<td nowrap bgcolor="#F3EFCD" class="STYLE7 td1" align="center"><strong>单位</strong></td>
<td nowrap bgcolor="#F3EFCD" class="STYLE7 td1" align="center"><strong>数量</strong></td>
<td nowrap bgcolor="#F3EFCD" class="STYLE7 td1" align="center"><strong>单价</strong></td>
<td nowrap bgcolor="#F3EFCD" class="STYLE7 td1" align="center"><strong>金额</strong></td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<tr >
<td nowrap bgcolor="#F3EFCD" ><%=(Recordset1.Fields.Item("name").Value)%></td>
<td nowrap bgcolor="#F3EFCD"><%=(Recordset1.Fields.Item("size").Value)%></td>
<td nowrap bgcolor="#F3EFCD"><%=(Recordset1.Fields.Item("unit").Value) %></td>
<td nowrap bgcolor="#F3EFCD"><%quantityw=(Recordset1.Fields.Item("quantity").Value)
response.Write(quantityw)%></td>
<td nowrap bgcolor="#F3EFCD"><%price=(Recordset1.Fields.Item("pric").Value)
sum=quantityw*price
response.Write(price)%></td>
<td nowrap bgcolor="#F3EFCD"><%response.write(sum)%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
<tr>
<td colspan="7" nowrap bgcolor="#F3EFCD" class="STYLE7 " align="center">总额:
<%dim i,sum2
for i=1 to sum
sum2=sum+i
next
response.Write(sum2)%>
</td>
</tr>
</table>
</body></html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>