网上“店铺”DIY(3)
网上“店铺”DIY(3),网上“店铺”DIY(3)
<HTML
<HEAD
<title购货蓝</title
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"
</HEAD
<BODY bgColor=lightcyan
<P align=center<IMG alt="网上书店"
src="http://img.jcwcn.com/attachment/portal/jcwcj/2005-12/10/05121001171774634.jpg""<br
<BODY bgColor=lightcyan
<form action=buy.asp method=post
<script language=vbscript
function ID(mystr)
pos=0
for i=1 to len(mystr)
if mid(mystr,i,1)="`" then
if pos=0 then
ID=left(mystr,i-1)
exit for
end if
end if
next
end function
</script
<%
function ID(mystr)
pos=0
for i=1 to len(mystr)
if mid(mystr,i,1)="`" then
if pos=0 then
ID=left(mystr,i-1)
exit for
end if
end if
next
end function
function BookName(mystr)
pos=0
for i=1 to len(mystr)
if mid(mystr,i,1)="`" then
if pos=0 then
pos=pos+1
else
BookName=mid(mystr,len(id(name))+2,i-2-len(id(name)))
exit for
end if
end if
next
end function
function Price(mystr)
for i= len(mystr) to 1 step -1
if mid(mystr,i,1)="`" then
if pos=0 then
Price=right(mystr,len(mystr)-i)
exit for
end if
end if
next
end function
select case request.querystring("Name")
case "view"
response.write "浏览"
if session("num")="" then
response.write "目前购货蓝中没有选中的书目!"
else
num=clng(session("num"))
response.write "<table border=1<tr<td书号</td<td书名</td<td单价
</td<td数量</td<td小计</td</tr"
session("sum")=0
for i=0 to num
session("sum")=session("sum")+session("sum_" & cstr(i))
response.write "<tr<td" & session("ID_" & cstr(i)) & "</td<td" &
session("BookName_" & cstr(i)) & "</td<td" & session("price_" & cstr
(i)) & "</td<td<input type=text size=5 name=txtNum" & cstr(i) & "
value=" & session("num_" & cstr(i)) & "<td" & session("sum_" & cstr
(i)) & "</td</td</tr"
next
response.write "</table"
Response.Write "购货总金额:" & session("sum")
end if
case ""
response.write "本页内修改"
num=clng(session("num"))
for i=0 to num
session("num_" & cstr(i))=(request.form("txtNum" & cstr(i)))
session("sum_" & cstr(i))=session("num_" & cstr(i))*session("price_"
& cstr(i))
next
response.write "<table border=1<tr<td书号</td<td书名</td<td单价
</td<td数量</td<td小计</td</tr"
session("sum")=0
for i=0 to num
session("sum")=session("sum")+session("sum_" & cstr(i))
response.write "<tr<td" & session("ID_" & cstr(i)) & "</td<td" &
session("BookName_" & cstr(i)) & "</td<td" & session("price_" & cstr
(i)) & "</td<td<input type=text size=5