product.asp

来自「体育商城」· ASP 代码 · 共 1,154 行 · 第 1/3 页

ASP
1,154
字号
UC_AddId = CStr(Request("UC_AddId"))
If (UC_AddId <> "") Then
  UC_redirectPage = ""
  If (NOT (UC_rs is Nothing)) Then
    ' Position recordset to correct location
    If (UC_rs.Fields.Item(UC_uniqueCol).Value <> UC_AddId) Then
      ' reset the cursor to the beginning
      If (UC_rs.CursorType > 0) Then
        If (Not UC_rs.BOF) Then UC_rs.MoveFirst
      Else
        UC_rs.Close
        UC_rs.Open
      End If
      Do While (Not UC_rs.EOF)
        If (Cstr(UC_rs.Fields.Item(UC_uniqueCol).Value) = UC_AddId) Then
          Exit Do
        End If
        UC_rs.MoveNext
      Loop
    End If
  End If
  UC_BindingTypes=Array("RS","LITERAL","RS","RS","NONE","RS","NONE")
  UC_BindingValues=Array("productid","1","productname","xprice","","weight","")
  UCCart1.AddItem UC_rs,UC_BindingTypes,UC_BindingValues,"increment"
  ' always redirect to remove the "UC_AddId" 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_AddId") 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
%>
<%
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>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>					
function DoDateTime(str, nNamedFormat, nLCID)				
	dim strRet								
	dim nOldLCID								
										
	strRet = str								
	If (nLCID > -1) Then							
		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									
</SCRIPT>
<html>
<head>
<title><%=(product.Fields.Item("productname").Value)%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="ddd.css" type="text/css">
<script language="JavaScript">
<!--
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="2" marginwidth="0" marginheight="0">
<SCRIPT language=javascript>
<!--
document.ns = navigator.appName == "Netscape"
window.screen.width>800 ? imgheight=110:imgheight=110
window.screen.width>800 ? imgleft=110:imgleft=110
function qingzuiload()
{
if (navigator.appName == "Netscape")
{document.qingzui.pageY=pageYOffset+window.innerHeight-imgheight;
document.qingzui.pageX=pageXOffset+window.innerWidth-imgleft;
qingzuimove();
}
else
{
qingzui.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;
qingzui.style.left=document.body.offsetWidth-imgleft;
qingzui2.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight-80;
qingzui2.style.left=document.body.offsetWidth-imgleft;
qingzuimove();
}
}
function qingzuimove()
{
if(document.ns)
{
document.qingzui.top=pageYOffset+window.innerHeight-imgheight
document.qingzui.left=pageXOffset+window.innerWidth-imgleft;
setTimeout("qingzuimove();",80)
}
else
{
qingzui.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;
qingzui.style.left=document.body.offsetWidth-imgleft;
qingzui2.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight-80;
qingzui2.style.left=document.body.offsetWidth-imgleft;
setTimeout("qingzuimove();",80)
}
}

function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true)

if (navigator.appName == "Netscape")
{document.write("<layer id=qingzui top=300 width=64 height=80><a href=cart.asp><img src=images/lookcart.gif border=0></a></layer>")
qingzuiload()}
else
{
document.write("<div id=qingzui style='position: absolute;width:64;top:300;hidden: visible;z-index: 1'><a href=cart.asp><img src=images/lookcart.gif border=0></a></div>"
+"<div id=qingzui2 style='position: absolute;visibility: hidden;z-index: 10'><img src=images/lookcart.gif></div>");
qingzuiload()
}
//-->
</SCRIPT>
<!--#include file="top.asp" -->
<table width="771" border="0" cellspacing="0" cellpadding="0" align="center" height="258" class="bk1">
  <tr> 
    <td valign="top" height="360" width="614" class="bk1"> <br>
      <table width="433" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
          <td><img src="images/product.gif" width="358" height="50"></td>
        </tr>
      </table>
      <br>
      <table width="476" border="0" cellspacing="2" cellpadding="0" align="center" class="dfont">
        <tr> 
          <td height="125" rowspan="10" width="137"> 
            <div align="center"><font color="#000000"><img src="images/product/<%=(product.Fields.Item("images").Value)%>" width="120" height="120"></font></div>
          </td>
          <td height="15" width="333"> 
            <p><font color="#000000">商品名称:<b><%=(product.Fields.Item("productname").Value)%>
              <% If (product.Fields.Item("dazhe").Value) = (-1) Then 'script %>
              <img src="images/hotprice.gif" width="24" height="24">
              <% End If ' end If (product.Fields.Item("dazhe").Value) = (-1) script %>
              </b></font></p>
          </td>
        </tr>
        <tr> 
          <td height="2" width="333"><font color="#000000">商品序号:<%=(product.Fields.Item("productid").Value)%></font></td>
        </tr>
        <tr> 
          <td height="13" width="333"><font color="#000000">生产厂商:<%=(product.Fields.Item("changshang").Value)%></font></td>
        </tr>
        <tr> 
          <td height="5" width="333"><font color="#000000">出厂日期:<%= DoDateTime((product.Fields.Item("cdate").Value), 1, -1) %></font></td>
        </tr>
        <tr> 
          <td height="3" width="333"><font color="#000000">现有数量:<%=(product.Fields.Item("Stock").Value)%></font></td>
        </tr>
        <tr> 
          <td height="10" width="333"><font color="#000000"> 
            <% If (product.Fields.Item("dazhe").Value) <> (-1) Then 'script %>
            原价:<font color="#FF0000"><%=(product.Fields.Item("yprice").Value)%></font>元 
            <% End If ' end If (product.Fields.Item("dazhe").Value) <> (-1) script %>
            <% If (product.Fields.Item("dazhe").Value) = (-1) Then 'script %>
            原价:<span class="hot"><%=(product.Fields.Item("yprice").Value)%></span>元 特价:<font color="#FF0000"><%=(product.Fields.Item("xprice").Value)%></font>元 
            <% End If ' end If (product.Fields.Item("dazhe").Value) = (-1) script %>
            </font></td>
        </tr>
        <tr> 
          <td height="2" width="333"><font color="#000000">重量:<%=(product.Fields.Item("weight").Value)%></font></td>
        </tr>
        <tr> 
          <td height="0" width="333">销售数量:<%=(product.Fields.Item("sell").Value)%></td>
        </tr>
        <tr> 
          <td height="0" width="333">查看次数:<%=(product.Fields.Item("hit").Value)%></td>
        </tr>
        <tr> 
          <td height="0" width="333"><A HREF="<%=(UC_AddLink + CStr(UC_rs.Fields.Item(UC_uniqueCol).Value)) %>"><img border=0 src="images/mai.gif" width="67" height="15" onClick="MM_popupMsg('此商品已经添加到您的购物车,请继续购买。')"></A></td>
        </tr>
        <tr> 
          <td height="17" colspan="2"><font color="#000000"><%=(product.Fields.Item("productjs").Value)%></font></td>
        </tr>
      </table>
    </td>
    <td height="360" width="196" bgcolor="#999999" background="images/BG020.jpg"> 
      <table width="143" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
          <td><img src="images/pingfen.gif" width="152" height="20"></td>
        </tr>
      </table>
      <table width="151" border="0" cellspacing="2" cellpadding="0" align="center" class="bk" bgcolor="#FFFFFF">
        <tr> 
          <td height="12" bgcolor="#FFFFFF" colspan="2">评分情况:</td>
        </tr>
        <% If (vote.Fields.Item("NUM_RATES").Value) <> (0) Then 'script %>
        <tr> 
          <td height="11" bgcolor="#FFFFFF" width="106"> 
            <table width="69" border="0" cellspacing="0" cellpadding="0" background="images/rate_back.gif">
              <tr> 
                <td> 
                  <table width="<%=(vote.Fields.Item("GRAGHWIDTH").Value)%>" border="0" cellspacing="0" cellpadding="0" background="images/5.gif">
                    <tr> 
                      <td>&nbsp;</td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
          <td height="11" bgcolor="#FFFFFF" width="115"><%= FormatNumber((vote.Fields.Item("AVERAGE_RATES").Value), 2, -2, -2, -2) %>分</td>
        </tr>
        <tr> 
          <td height="5" bgcolor="#FFFFFF" colspan="2">最高分:<%=(vote.Fields.Item("HIGH_RATE").Value)%>分</td>
        </tr>
        <tr> 
          <td height="16" bgcolor="#FFFFFF" colspan="2">最低分:<%=(vote.Fields.Item("LOW_RATE").Value)%>分</td>
        </tr>
        <tr> 
          <td height="4" bgcolor="#FFFFFF" colspan="2">总共有<%=(vote.Fields.Item("NUM_RATES").Value)%>个网友评分</td>
        </tr>
        <% End If ' end If (vote.Fields.Item("NUM_RATES").Value) <> (0) script %>
        <tr> 
          <td height="2" bgcolor="#FFFFFF" colspan="2"> 
            <% If (vote.Fields.Item("NUM_RATES").Value) = (0) Then 'script %>
            <font color="#FF0000"> 目前还没有人评分!!! </font> 
            <% End If ' end If (vote.Fields.Item("NUM_RATES").Value) = (0) script %>
          </td>
        </tr>
        <tr bgcolor="#99CC00"> 
          <td height="11" colspan="2"><b>请您评分&gt;&gt;&gt;</b></td>
        </tr>
        <tr> 
          <td height="92" bgcolor="#FFFFFF" colspan="2"> 
            <form ACTION="<%=MM_editAction%>" METHOD="POST" name="form1">
              <p> 
                <input type="radio" name="radiobutton" value="1">
                <img src="images/1.gif" width="70" height="15"><br>
                <input type="radio" name="radiobutton" value="2">
                <img src="images/2.gif" width="70" height="15"><br>
                <input type="radio" name="radiobutton" value="3" checked>
                <img src="images/3.gif" width="70" height="15"><br>
                <input type="radio" name="radiobutton" value="4">
                <img src="images/4.gif" width="70" height="15"><br>
                <input type="radio" name="radiobutton" value="5">
                <img src="images/5.gif" width="70" height="15"> </p>
              <p align="center"> 
                <input name=next onFocus=blur() style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-RIGHT: 0px; BORDER-TOP: 0px" type=submit value="评分" onClick="MM_popupMsg('评分成功,谢谢您对该商品评分。')">
                <input type="hidden" name="hiddenField" value="<%=(product.Fields.Item("productid").Value)%>">
              </p>
              <input type="hidden" name="MM_insert" value="true">
            </form>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<br>
<!--#include file="bottom.asp" -->
</body>
</html>
<%
product.Close()
set product=nothing
%>
<%
vote.Close()
set vote=nothing
%>

⌨️ 快捷键说明

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