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

📄 shop_bag.asp

📁 该软件是帮助大学生更好的生活
💻 ASP
字号:
<%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true
%>
<!-- #include file="inc/conn.asp" -->
<!--#include file="inc/Conn_User.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/func.asp"-->

<!-- #include file="inc_shop/config_shop.asp" -->
<%
dim pid,num,sum,buttoncan,shop_session,sdim,snum,tid,tnum,tprice,tprices

dim name,remark_1,remark_2,price_1,price_2,bigimg,serial,brand,stock,isgood,counter,buy_counter,down_url,down_remark '--JK
dim strChannel,sqlChannel,rsChannel,ChannelUrl,ChannelName
dim strFileName,MaxPerPage,totalPut,CurrentPage,TotalPages
dim BeginTime,EndTime,founderr, errmsg
dim PageTitle,strPath,strPageTitle
dim SkinID,ClassID,AnnounceCount
dim UserGuestName,UserType,UserSex,UserEmail,UserHomepage,UserOicq,UserIcq,UserMsn
dim WriteName,WriteType,WriteSex,WriteEmail,WriteOicq,WriteIcq,WriteMsn,WriteHomepage
dim WriteFace,WriteImages,WriteTitle,WriteContent,SaveEdit,SaveEditId
dim GuestType,LoginName,AdminReplyContent
dim SubmitType,GuestPath,TitleName,keyword


SkinID=0

strPath= "&nbsp;您现在的位置:&nbsp;<a href='" & SiteUrl & "'>" & SiteName & "</a>"
strPageTitle= SiteTitle

BeginTime=Timer
ClassID=0
pagetitle=pagetitle&"购 物 车"

shop_session=trim(request.cookies(web_cookies)("shop"))
pid=trim(request.querystring("id"))
if isnumeric(pid) then
  sql="select name from product where hidden and id="&pid
  set rs=conn.execute(sql)
  if not(rs.eof and rs.bof) then
    if len(shop_session)<1 then
      shop_session=pid&",1"
    else
      if int(instr("#"&shop_session,"#"&pid&","))<1 then
        shop_session=shop_session&"#"&pid&",1"
      end if
    end if
    response.cookies(web_cookies)("shop")=shop_session
    if request.cookies(web_cookies)("iscookies")="yes" then
      response.cookies(web_cookies).expires=date+365
    end if
  end if
  rs.close:set rs=nothing
end if

action=trim(request.querystring("action"))
select case action
case "shopbag"
  shop_session=""
  pid=replace(trim(request.form("pid")),", ",",")
  sdim=split(pid,",")
  snum=ubound(sdim)
  for i=0 to snum
    tnum=trim(request.form("num"&sdim(i)))
    if not(isnumeric(tnum)) then tnum=1
    if len(shop_session)<1 then
      shop_session=sdim(i)&","&tnum
    else
      if int(instr("#"&shop_session,"#"&sdim(i)&","))<1 then
        shop_session=shop_session&"#"&sdim(i)&","&tnum
      end if
    end if
    response.cookies(web_cookies)("shop")=shop_session
    if request.cookies(web_cookies)("iscookies")="yes" then
      response.cookies(web_cookies).expires=date+365
    end if
  next
  erase sdim
case "clear"
  shop_session=""
  response.cookies(web_cookies)("shop")=shop_session
  if request.cookies(web_cookies)("iscookies")="yes" then
    response.cookies(web_cookies).expires=date+365
  end if
end select
%>
<html>
<head>
<title><%=strPageTitle & " >> " & PageTitle%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="inc/Skin_CSS.asp"-->
<%call MenuJS()%>
</head>
<body <%=Body_Label%> onmousemove='HideMenu()'>
<!--#include file="top.asp"-->
<table border="0" align="center" cellpadding="0" cellspacing="0" class="border2">
  <tr> 
    <td width="190" align="left" valign="top" class="tdbg_leftall">
    <%
	  call shop_sort()
	  call shop_left()
	  %></td>
    <td valign="top"> 
      <table border=0 cellpadding="10" cellspacing="0" >
  <tr><td class=red height=30>以下是您所选购的物品清单</td></tr></table>
<%=table1%>
<tr align=center class=title_maintxt> 
<td width='6%' height=25><b>购买</td>
<td width='22%'><b>产品编号</td>
<td width='38%'><b>产品名称</td>
<td width='12%'><b>产品单价</td>
<td width='10%'><b>数量</td>
<td width='12%'><b>产品总价</td>
</tr>
<form name=shop_frm action='shop_bag.asp?action=shopbag' method=post>
<%
sum=0
buttoncan=" disabled"
sdim=split(shop_session,"#")
snum=ubound(sdim)
for i=0 to snum
  tid=left(sdim(i),instr(sdim(i),",")-1)
  tnum=right(sdim(i),len(sdim(i))-instr(sdim(i),","))
  sql="select serial,name,price_1,price_2 from product where hidden and id="&tid
  set rs=conn.execute(sql)
  if not(rs.eof and rs.bof) then
    if login_mode="" then
      tprice=rs("price_1")
    else
      tprice=rs("price_2")
    end if
    tprices=tprice*tnum
    sum=sum+tprices
%>
<tr align=center<%response.write table3%>> 
<td><input type=checkbox name=pid value='<%response.write tid%>' checked class=bg_1></td>
<td><%response.write rs("serial")%></td>
<td><%response.write rs("name")%></td>
<td><%response.write pu&tprice%>&nbsp;</td>
<input type=hidden name=numm<%response.write tid%> value='<%response.write tnum%>'>
<td><input type=text name=num<%response.write tid%> value='<%response.write tnum%>' size=4 onKeyUp="javascript:shop_checknum(num<%response.write tid%>,numm<%response.write tid%>);"></td>
<td><%response.write pu&tprices%></td>
</tr>
<%
    buttoncan=""
  end if
  rs.close:set rs=nothing
next
erase sdim
%>
<tr<%response.write table4%>><td align=right colspan=6 height=25 class=red>总价格:&nbsp;<font color="#FF0000"><%response.write pu&sum%></font>&nbsp;&nbsp;&nbsp;</td></tr>

<tr<%response.write table3%>><td colspan=6 align=center height=40>
<input type=submit value='确认更改'<%response.write buttoncan%>>&nbsp;&nbsp;
<input type=button value='继续购物' onclick="location.href='shop.asp';">&nbsp;&nbsp;
<input type=button value='清空购物车' onclick="javascript:shop_clear();"<%response.write buttoncan%>>&nbsp;&nbsp;
<input type=button value='去收银台' onclick="location.href='shop_pay.asp';"<%response.write buttoncan%>>
</td></tr>

</form>
</table><script language="Javascript">
<!--
function shop_fucchecknum(num)
{
  var i,j,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 shop_clear(){ 
  if (confirm("确定要清空购物车?")==1){
  window.location.href="shop_bag.asp?action=clear"}
}

function shop_checknum(num1,num2) 
{
  if ((shop_fucchecknum(num1.value)==0) )
  {  
    num1.value=num2.value;
    return false;
  }
}

function shop_checknumnull(num1) {
  if (num1.value=="")
  {  
    alert("请填写购买产品的数量");
    theform.focus();
    return false;
  }
}
//-->
</SCRIPT>
<table border=0 cellpadding="10">
<tr><td class=red height=30>注意:改变商品数量和减少商品种类需按“确认更改”按钮</td></tr></table>

</td></tr></table>
<% call Bottom() %>
</td>
</tr></table>
<% call PopAnnouceWindow(400,300) %>
</body>
</html>
<script>
 mtDropDown.initialize();
</script>
<%
call CloseConn()
%>

⌨️ 快捷键说明

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