📄 price.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<%
ch
%>
<% if request.Cookies("level") = 3 then response.Redirect("fench.asp")
dim action,j
action = request("action")
j = request("j")
if action = "jiesuan" then jiesuan
id =request("id")
response.Cookies("saleid") = id
saleid = request.Cookies("saleid")
sub jiesuan()
aid = request("id")
sqlstr = "select * from 购物车记录 where 编号='"&aid&"'"
dbo.getsql = sqlstr
set rs = dbo.getrs1()
if rs("结算") =true then
exit sub
else
rs("结算") =true
rs.update
end if
sqlstr = "insert into 药品销售(药编号,数量) select 编号,数量 from shopcar where 客户='"&aid&"'"
dbo.getsql = sqlstr
set rs = dbo.getrs1()
sqlstr = "update 库存数据 set 库存=库存-(select 数量 from shopcar where 客户='"&aid&"') where 编号=(select 数量 from shopcar where 客户='"&aid&"')"
dbo.getsql = sqlstr
set rs = dbo.getrs1()
'Web = "price.asp?action=detail&id="&request.Cookies("saleid")
'response.write "<Script Language=JavaScript>location.href='"&Web&"'</Script>"
response.Redirect("price.asp")
end sub
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {color: #FF0000}
-->
</style>
</head>
<body>
<p> </p>
<table width="80%" border="0" align="center" cellpadding="4" cellspacing="1">
<%if request.Cookies("level") = 2 or request.Cookies("level") = 0 then%>
<tr>
<td bgcolor="#76AFD6">购销管理 - <a href="sale.asp">前台销售</a> - <a href="price.asp">结算管理</a> - 取药管理</td>
</tr>
<%else%>
<tr>
<td bgcolor="#76AFD6">购销管理 - 前台销售 - 结算管理 - <a href="fench.asp">取药管理</a></td>
</tr>
<%end if%>
<tr>
<td bgcolor="#CEE2F0">结算管理(客户:<%=saleid%>)</td>
</tr>
</table>
<%if action = "detail" then%>
<table width="80%" border="0" align="center" cellpadding="2" cellspacing="1">
<tr>
<td width="150" bgcolor="#76AFD6">药品</td>
<td width="100" bgcolor="#76AFD6">数量</td>
<td width="100" bgcolor="#76AFD6">售价</td>
<td width="100" colspan="2" bgcolor="#76AFD6">合计(元)</td>
</tr>
<%totle = 0
sqlstr = "select * from shopcar where 客户='"&request.Cookies("saleid")&"' order by id desc"
dbo.getsql = sqlstr
dbo.pagesize = 25
set rs = dbo.Getrs()
for i=1 to dbo.pagesize
if not rs.eof then
a = 1
sqlstr = "select * from 药品信息 where 编号='"&rs("编号")&"'"
dbo.getsql = sqlstr
set rs1 = dbo.Getrs()
response.write "<tr bgcolor=#CEE2F0><td width=150 bgcolor=#CEE2F0>"&rs1("名称")&"</td><td width=100 bgcolor=#CEE2F0>"&rs("数量")&"</td><td width=100 bgcolor=#CEE2F0>"&rs1("售价")&"</td><td colspan=2 bgcolor=#CEE2F0>"&rs("数量")*rs1("售价")&"</td></tr>"
totle = rs("数量")*rs1("售价")+ totle
rs.movenext
else
exit for
end if
next
response.write "<tr bgcolor=#CEE2F0><td> </td><td> </td><td> </td><td width=100 bgcolor=#CEE2F0>总计:"&totle&"(元)</td><td width=80 valign=middle bgcolor=#CEE2F0><div align=center>"
if j = "2True" then
response.write "购买结算</div></td></tr></table>"
else
if a =1 then
response.write "<a href=price.asp?action=jiesuan&id="&request.Cookies("saleid")&">购买结算</a></div></td></tr></table>"
else
response.write "购买结算</div></td></tr></table>"
end if
end if
dbo.showpage()
%>
<%else%>
<table width="80%" border="0" align="center" cellpadding="2" cellspacing="1">
<tr>
<td width="150" bgcolor="#76AFD6">编 号</td>
<td width="300" bgcolor="#76AFD6">客 户</td>
<td width="150" bgcolor="#76AFD6">日 期</td>
<td width="100" bgcolor="#76AFD6">是否结算</td>
</tr>
<%
sqlstr = "select * from 购物车记录 order by 日期 desc"
dbo.getsql = sqlstr
dbo.pagesize = 25
set rs = dbo.Getrs()
for i=1 to dbo.pagesize
if not rs.eof then
response.write "<tr><td width=150 bgcolor=#CEE2F0>"&rs("编号")&"</td><td width=300 bgcolor=#CEE2F0><a href=price.asp?action=detail&id="&rs("编号")&"&j=2"&rs("结算")&">"&rs("客户名")&"</a></td><td width=150 bgcolor=#CEE2F0>"&rs("日期")&"</td><td width=100 bgcolor=#CEE2F0>"&rs("结算")&"</td></tr>"
rs.movenext
else
exit for
end if
next
response.write "</table>"
dbo.showpage()
%>
<%end if%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -