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

📄 show.asp

📁 这是一本关于高级软件工程的书籍
💻 ASP
字号:
<!-- #include file="../inc/conn.asp" -->
<!-- #include file="../inc/function.asp" -->
<%
	pid = managestr(request("pid"))
	if session("username") = "" then
		response.Redirect("index.asp")
	end if
%>
<%
	
	'''''''''''''''''记录用户所买产品到session中'''''''''''''''''
	stat = managestr(request("stat"))
	if stat = "" then
		sql = "SELECT pname, price FROM goods WHERE (pid = '"&pid&"')"
		rs.open sql,conn
		if not rs.eof then
			pname = rs("pname")
			price = rs("price")
		end if
		rs.close
	end if
	if InStr(session("buylist"),pid&"#")=0 then
		session("buylist") = session("buylist")&pid&"#"&pname&"#"&price&"#"&"1*@"
		suan = mid(session("buylist"),1,len(session("buylist"))-2)
	else
		suan = mid(session("buylist"),1,len(session("buylist"))-2)
	end if
	statu = request("statu")
	if statu <> "" then
	'''''''''''''''''修改数量及是否购买'''''''''''''''''
		coutup = split(suan,"*@")
		for i=0 to ubound(coutup)
			inpup = split(coutup(i),"#")
			cnumber = cnumber&request("c"&inpup(0))&":::"
		next
	'''''''''''''''''获取修改数量'''''''''''''''''''''
		cnumber = mid(cnumber,1,len(cnumber)-3)
		resstr = split(cnumber,":::")
		for k=0 to ubound(resstr)
			if resstr(k) = "0" or resstr(k) = "00" or resstr(k) = "000" then
				resstr(k) = "1"
			end if
		next
	'''''''''''''''''获取修改数量结束''''''''''''''''''
	
	''''''''''''''''''数量值的修改''''''''''''''''''''''
		jcout = split(suan,"*@")
		session("buylist") = ""
		for z=0 to ubound(jcout)
			session("buylist") = session("buylist")&mid(jcout(z),1,InstrRev(jcout(z),"#"))&resstr(z)&"*@"
		next
		suan = mid(session("buylist"),1,len(session("buylist"))-2)
	''''''''''''''''''数量值的修改结束''''''''''''''''''
	
	''''''''''建立字典表,键是产品ID,值是Session中该条记录''''''''''
		set dic = server.createObject("scripting.Dictionary") 
		icout = split(suan,"*@")
		for e=0 to ubound(icout)
			dic.add mid(icout(e),1,instr(icout(e),"#")-1),icout(e)
		next
	''''''''''''''''''''建立字典表结束''''''''''''''''''''
	''''''''''''''''''购买的修改'''''''''''''''''''''''''''
		isbuy = request("isbuy")
		session("buylist") = ""
		isbuyup = split(isbuy,",")
		for q=0 to ubound(isbuyup)
			session("buylist") = session("buylist")&dic.item(trim(isbuyup(q)))&"*@"
		next
		if session("buylist") <> "" then
			suan = mid(session("buylist"),1,len(session("buylist"))-2)
		end if
	''''''''''''''''''购买的修改结束'''''''''''''''''''''''
	end if
	
	if session("buylist") = "" then
		ooutstr = "<br><td height='20' valign='bottom' class='w-1'><div align='center'><b>您未选购任何商品!</b></div></td>"
	else
		ooutstr = "<td height='20' valign='bottom' class='w-1'><div align='center'><strong>以下是您所选购的物品清单</strong></div></td>"
	end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script language="javascript" src="../inc/formCheck.js"></script>
<title>意科在线定单系统</title>
<style>
.w-1 {
	font-family: "宋体";
	font-size: 12px;
	color: #FFFFFF;
	background-position: bottom;
}
.w-2 {
	font-family: "宋体";
	font-size: 12px;
	color: #cccccc;
	background-position: bottom;
}
.w-3 {
	font-family: "宋体";
	font-size: 12px;
	color: #000000;
	background-position: bottom;
}
.STYLE1 {color: #ffffff}
.STYLE2 {font-family: "宋体"; font-size: 12px; color: #333333; background-position: bottom; }
.STYLE3 {font-family: "宋体"; font-size: 12px; color: #ffffff; background-position: bottom; }
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="666666">
<table width="100%" border="0" cellspacing="0">
  <tr>
    <td width="80%" valign="top"><p align="center">
	  <table width="100%" border="0">
        <tr><%=ooutstr%></tr>
      </table>
	  <%
	  	if session("buylist") = "" then
			response.write "<br><input type='button' value='继续购物' name='bt' onClick='window.close();' style='font-size: 9pt'>"
			response.end
		end if
	  %>
	  
      <form name="showform" action="show.asp" method="post" onSubmit="return check(this)">
<input type="hidden" name="statu" value="1">
<input type="hidden" name="pid" value="<%=pid%>">
<div align="center"><center>
<table border="1" cellpadding="0" cellspacing="0" bordercolor="cccccc">
        <tr bgcolor="#5C85D6">
          <td width="59"  height="22" align="center" bordercolor="#CCCCCC" bgcolor="333333" class="w-1 STYLE1">产品编号</td>
          <td width="191"  height="22" align="center" bordercolor="#CCCCCC" bgcolor="333333" class="STYLE3">产品名称</td>
          <td width="76" height="22" align="center" bordercolor="#CCCCCC" bgcolor="333333" class="STYLE3">产品价格</td>
          <td width="77"  height="22" align="center" bordercolor="#CCCCCC" bgcolor="333333" class="STYLE3">产品数量</td>
          <td width="34"  height="22" align="center" bordercolor="#CCCCCC" bgcolor="333333" class="STYLE3">购买</td>
          <td width="73"  height="22" align="center" bordercolor="#CCCCCC" bgcolor="333333" class="STYLE3">总价</td>
        </tr>
<%
	cout = split(suan,"*@")
	for i=0 to ubound(cout)
		inp = split(cout(i),"#")
%>
        
		<tr>
          <td align="center" valign="bottom" bordercolor="#CCCCCC" class="w-3"><%=inp(0)%></td>
          <td align="center" valign="bottom" bordercolor="#CCCCCC" class="w-3"><%=inp(1)%></td>
          <td align="center" valign="bottom" bordercolor="#CCCCCC" class="w-3"><%=inp(2)%></td>
          <td align="center" valign="bottom" bordercolor="#CCCCCC" class="w-3"><input name="c<%=inp(0)%>" value="<%=inp(3)%>" size="3" maxlength="3" v_name="产品数量" v_must="1" v_type="int"></td>
          <td Align="center" valign="bottom" bordercolor="#CCCCCC" class="w-3"><input Type="checkbox" Name="isbuy" Value="<%=inp(0)%>" Checked></td>
          <td Align="center" valign="bottom" bordercolor="#CCCCCC" class="w-3"><%=inp(2)*inp(3)%>元</td>
        </tr>
<%
		count = count+inp(2)*inp(3)
	next
%>	
		
        <tr>
      <td width="520" height="22" ColSpan="6" Align="Right" valign="bottom" bordercolor="#CCCCCC"><font color="#cc0000">总价格:<b><%=count%>元</b></font></td>  
        </tr>
      </table>
      </center></div><blockquote>
        <p align="center">
        <input Type="submit" Value="确认更改" name="confirm" style="font-size: 9pt">&nbsp;&nbsp;&nbsp; 
        <input type="button" img="../pic/jxgw.jpg" value="继续购物" name="B2" onClick="window.close();" style="font-size: 9pt">&nbsp;&nbsp;&nbsp; 
        <input type="button" value="去收银台" name="B4" onClick="window.opener.location.href='confirm.asp';window.close();" style="font-size: 9pt">
      </blockquote>
    </form>
</td></tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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