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

📄 cart.asp

📁 体育商城
💻 ASP
📖 第 1 页 / 共 3 页
字号:
		oldLCID = Session.LCID
	End If

	On Error Resume Next

	If (nLCID > -1) Then
		Session.LCID = nLCID
	End If

	If ((nLCID < 0) Or (Session.LCID = nLCID)) Then
		strRet = FormatDateTime(str, nNamedFormat)
	End If
										
	If (nLCID > -1) Then
		Session.LCID = oldLCID
	End If			
										
	DoDateTime = strRet
End Function

function DoPercent(str, nDigitsAfterDecimal, nLeadingDigit, nUseParensForNeg, nGroupDigits)
	DoPercent = FormatPercent(str, nDigitsAfterDecimal, nLeadingDigit, nUseParensForNeg, nGroupDigits)
End Function							

function DoTrim(str, side)
	dim strRet
	strRet = str

	If (side = "left") Then
		strRet = LTrim(str)
	ElseIf (side = "right") Then
		strRet = RTrim(str)
	Else
		strRet = Trim(str)
	End If
	DoTrim = strRet
End Function
</SCRIPT>
<%
UC_CartColNames=Array("ProductID","Quantity","productName","Price","totalweight","weight","Total")
UC_ComputedCols=Array("","","","","weight","","Price")
set UCCart1=VBConstuctCart("UCCart",2,UC_CartColNames,UC_ComputedCols)
UCCart1__i=0
%>
<%
Dim HLooper1__numRows
HLooper1__numRows = 7
Dim HLooper1__index
HLooper1__index = 0
bclass_numRows = bclass_numRows + HLooper1__numRows
%>
<%
UC_updateAction = CStr(Request("URL"))
If (Request.QueryString <> "") Then
  UC_updateAction = UC_updateAction & "?" & Request.QueryString
End If
If (Request.Form("textfield").Count > 0) Then
  UCCart1.Update("textfield")
  If ("" <> "") Then
    Response.Redirect("")
  End If
End If
%>
<%
UC_EmptyCart = CStr(Request.ServerVariables("URL")) & "?UC_EmptyCart=1"
If (CStr(Request("UC_EmptyCart")) = "1") Then
  UCCart1.Destroy()
  UC_redirectPage = "cartempty.asp"
  ' redirect with URL parameters (remove the "UC_EmptyCart" query param).
  if (UC_redirectPage = "") Then UC_redirectPage = CStr(Request.ServerVariables("URL"))
  If (InStr(1, UC_redirectPage, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
    newQS = "?"
    For Each Item In Request.QueryString
      If (Item <> "UC_EmptyCart") Then
        If (Len(newQS) > 1) Then newQS = newQS & "&"
        newQS = newQS & Item & "=" & Server.URLencode(Request.QueryString(Item))
      End If
    Next
    if (Len(newQS) > 1) Then UC_redirectPage = UC_redirectPage & newQS
  End If
  Response.Redirect(UC_redirectPage)
End If
%>
<% If UCCart1.GetItemCount() <= 0 Then Response.Redirect("cartempty.asp") %>
<%
Dim Repeat2__numRows
Repeat2__numRows = 10
Dim Repeat2__index
Repeat2__index = 0
tuijian_numRows = tuijian_numRows + Repeat2__numRows
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = 10
Dim Repeat1__index
Repeat1__index = 0
hot_numRows = hot_numRows + Repeat1__numRows
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
  NextItem = "&" & Item & "="
  If (InStr(1,MM_removeList,NextItem,1) = 0) Then
    MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
  End If
Next

' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
  NextItem = "&" & Item & "="
  If (InStr(1,MM_removeList,NextItem,1) = 0) Then
    MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
  End If
Next

' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "")  Then MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
  If (firstItem <> "") Then
    MM_joinChar = "&"
  Else
    MM_joinChar = ""
  End If
End Function
%>
<%
Dim Repeat3__numRows
Repeat3__numRows = 7
Dim Repeat3__index
Repeat3__index = 0
news_numRows = news_numRows + Repeat3__numRows
%>
<%
Dim HLooper3__numRows
HLooper3__numRows = 4
Dim HLooper3__index
HLooper3__index = 0
dazhe_numRows = dazhe_numRows + HLooper3__numRows
%>
<%
Dim HLooper2__numRows
HLooper2__numRows = 2
Dim HLooper2__index
HLooper2__index = 0
newproduct_numRows = newproduct_numRows + HLooper2__numRows
%>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>	
function DoTrimProperly(str, nNamedFormat, properly, pointed, points)
  dim strRet
  strRet = Server.HTMLEncode(str)
  strRet = replace(strRet, vbcrlf,"")
  strRet = replace(strRet, vbtab,"")
  If (LEN(strRet) > nNamedFormat) Then
    strRet = LEFT(strRet, nNamedFormat)			
    If (properly = 1) Then					
      Dim TempArray								
      TempArray = split(strRet, " ")	
      Dim n
      strRet = ""
      for n = 0 to Ubound(TempArray) - 1
        strRet = strRet & " " & TempArray(n)
      next
    End If
    If (pointed = 1) Then
      strRet = strRet & points
    End If
  End If
  DoTrimProperly = strRet
End Function
</SCRIPT>
<html>
<head>
<title>购物车</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="ddd.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="2" marginwidth="0" marginheight="0">
<!--#include file="top.asp" -->
<table width="771" border="0" cellspacing="0" cellpadding="0" align="center" height="258" class="bk1">
  <tr> 
    <td valign="top" height="171"><br>
      <br>
      <form name="form1" method="post" action="<%=UC_updateAction%>">
        <table width="562" border="1" cellspacing="2" cellpadding="0" align="center" class="dfont" bordercolor="#000000">
          <tr bgcolor="#99CC00"> 
            <td width="138"> 
              <div align="center">商品名称</div>
            </td>
            <td width="155"> 
              <div align="center">商品编号</div>
            </td>
            <td width="93"> 
              <div align="center">单价</div>
            </td>
            <td width="67"> 
              <div align="center">数量</div>
            </td>
            <td width="85">
              <div align="center">删除</div>
            </td>
            <td width="85"> 
              <div align="center">合计</div>
            </td>
          </tr>
          <% For UCCart1__i=0 To UCCart1.GetItemCount()-1 %>
          <tr> 
            <td width="138" height="4"> 
              <div align="center"><%=(UCCart1.GetColumnValue("productName",UCCart1__i))%></div>
            </td>
            <td width="155" height="4"> 
              <div align="center"><%=(UCCart1.GetColumnValue("ProductID",UCCart1__i))%></div>
            </td>
            <td width="93" height="4"> 
              <div align="center"><%=(UCCart1.GetColumnValue("Price",UCCart1__i))%>元</div>
            </td>
            <td width="67" height="4"> 
              <div align="center"> 
                <input type="text" name="textfield" size="4" value="<%=(UCCart1.GetColumnValue("Quantity",UCCart1__i))%>">
              </div>
            </td>
            <td width="85" height="4"> 
              <div align="center">
                <input type="checkbox" name="checkbox" value="checkbox" onClick="document.form1.textfield<%if (UCCart1.GetItemCount()<>1) Then Response.Write("["& UCCart1__i& "]")%>.value='0'">
              </div>
            </td>
            <td width="85" height="4"> 
              <div align="center"><%=(UCCart1.GetColumnValue("Total",UCCart1__i))%>元</div>
            </td>
          </tr>
          <% Next 'UCCart1__i %>
          <tr> 
            <td colspan="2" height="6">&nbsp; </td>
            <td width="93" bgcolor="#99CC00" height="6"> 
              <div align="center">合计费用:</div>
            </td>
            <td colspan="3" height="6"> 
              <div align="center"></div>
              <div align="center"><%=(UCCart1.GetColumnTotal("Total"))%>元</div>
            </td>
          </tr>
        </table>
        <div align="center"><br>
          <table width="448" border="0" cellspacing="0" cellpadding="0" align="center">
            <tr> 
              <td width="150"> 
                <div align="center"> 
                  <input type="image" border="0" name="imageField" src="images/upcart.gif" width="104" height="20">
                </div>
              </td>
              <td width="182"> 
                <div align="center"><a href="<%=UC_EmptyCart%>"><img border=0 src="images/rushcart.gif" width="104" height="20"></a></div>
              </td>
              <td width="116"> 
                <div align="center"><a href="default.asp"><img src="images/jixugw.gif" width="104" height="20" border="0"></a></div>
              </td>
            </tr>
          </table>
          <p><a href="order.asp"><img src="images/check.gif" width="134" height="32" border="0"></a></p>
        </div>
      </form>
    </td>
  </tr>
</table>
<br>
<!--#include file="bottom.asp" -->
</body>
</html>


<html></html>

⌨️ 快捷键说明

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