user_wholesale_code.asp

来自「个人网站比较简短」· ASP 代码 · 共 360 行 · 第 1/2 页

ASP
360
字号
            Querysql = Querysql & " and P.ProductExplain like '%" & Keyword & "%' "
        Case "ProducerName"
            Querysql = Querysql & " and P.ProducerName like '%" & Keyword & "%' "
        Case "TrademarkName"
            Querysql = Querysql & " and P.TrademarkName like '%" & Keyword & "%' "
        Case Else
            Querysql = Querysql & " and P.ProductName like '%" & Keyword & "%' "
        End Select
    End If
    
    totalPut = PE_CLng(Conn.Execute("select Count(*) from PE_Product P " & Querysql)(0))
    If CurrentPage < 1 Then
        CurrentPage = 1
    End If
    If (CurrentPage - 1) * MaxPerPage > totalPut Then
        If (totalPut Mod MaxPerPage) = 0 Then
            CurrentPage = totalPut \ MaxPerPage
        Else
            CurrentPage = totalPut \ MaxPerPage + 1
        End If
    End If
    If CurrentPage > 1 Then
        Querysql = Querysql & " and P.ProductID < (select min(ProductID) from (select top " & ((CurrentPage - 1) * MaxPerPage) & " P.ProductID from PE_Product P " & Querysql & " order by P.ProductID desc) as QueryProduct) "
    End If
    sql = sql & Querysql & " order by P.ProductID desc"

    Set rsProductList = Server.CreateObject("ADODB.Recordset")
    rsProductList.Open sql, Conn, 1, 1
    
    If rsProductList.BOF And rsProductList.EOF Then
        totalPut = 0
        If Child = 0 Then
            Response.Write "<tr class='tdbg' height='50'><td colspan='20' align='center'>没有任何" & ChannelShortName & "!<br><br></td></tr>"
        Else
            Response.Write "<tr class='tdbg' height='50'><td colspan='20' align='center'>此栏目及其子栏目中没有任何" & ChannelShortName & "!</td></tr>"
        End If
    Else
        Dim ProductNum, ProductPath
        ProductNum = 0
        Do While Not rsProductList.EOF
            Response.Write "      <tr class='tdbg' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"">"
            Response.Write "        <td>"
            If rsProductList("ClassID") <> ClassID Then
                Response.Write "<a href='User_Wholesale.asp?ClassID=" & rsProductList("ClassID") & "'>[" & rsProductList("ClassName") & "]</a>&nbsp;"
            End If
            Response.Write "<a href='../Shop/ShowProduct.asp?ProductID=" & rsProductList("ProductID") & "' target='_blank'"
            Response.Write " title='" & ChannelShortName & "名称:" & rsProductList("ProductName") & vbCrLf
            Response.Write ChannelShortName & "类别:" & arrProductKind(rsProductList("ProductKind")) & "商品" & vbCrLf
            Response.Write ChannelShortName & "型号:" & rsProductList("ProductModel") & vbCrLf
            Response.Write ChannelShortName & "规格:" & rsProductList("ProductStandard") & vbCrLf
            Response.Write "上市时间:" & rsProductList("UpdateTime") & vbCrLf
            Response.Write "推荐等级:"
            If rsProductList("Stars") = 0 Then
                Response.Write "无"
            Else
                Response.Write String(rsProductList("Stars"), "★")
            End If
            Response.Write "'>"
            Select Case rsProductList("ProductKind")
            Case 1
                Response.Write "<font color='#000000'>"
            Case 2
                Response.Write "<font color='green'>"
            Case 3
                Response.Write "<font color='blue'>"
            End Select
            Response.Write rsProductList("ProductName") & "</font></a>"
            Response.Write "</td>"
            Response.Write "            <td width='40' align='center'>"
            Select Case rsProductList("ProductType")
            Case 1
                Response.Write "<font color='#000000'>正常</font>"
            Case 2
                Response.Write "<font color='green'>涨价</font> "
            Case 5
                Response.Write "<font color='red'>降价</font> "
            Case 3
                If rsProductList("Begindate") > Date Or rsProductList("EndDate") < Date Then
                    Response.Write "<font color='#000000'>正常</font>"
                Else
                    Response.Write "<font color='#FFCC00'>特价</font>"
                End If
            Case 4
                Response.Write "<font color='blue'>礼品</font> "
            End Select
            Response.Write "    </td>"
            Response.Write "            <td width='40' align='center' >" & rsProductList("Unit") & "</td>"
            Response.Write "            <td width='40' align='center' >" & rsProductList("Stocks") & "</td>"
            Response.Write "            <td width='60' align='center' >" & FormatNumber(rsProductList("Price_Original"), 2, vbTrue, vbFalse, vbFalse) & "</td>"
            Response.Write "            <td width='80' align='center' >" & rsProductList("Number_Wholesale1") & " / " & FormatNumber(rsProductList("Price_Wholesale1"), 2, vbTrue, vbFalse, vbFalse) & "</td>"
            Response.Write "            <td width='80' align='center' >" & rsProductList("Number_Wholesale2") & " / " & FormatNumber(rsProductList("Price_Wholesale2"), 2, vbTrue, vbFalse, vbFalse) & "</td>"
            Response.Write "            <td width='80' align='center' >" & rsProductList("Number_Wholesale3") & " / " & FormatNumber(rsProductList("Price_Wholesale3"), 2, vbTrue, vbFalse, vbFalse) & "</td>"
            Response.Write "            <td width='30' align='center' ><input type='checkbox' name='ProductID' value='" & rsProductList("ProductID") & "'></td>"
            Response.Write "            <td width='60' align='center' ><input type='text' name='Amount_" & rsProductList("ProductID") & "' size='5' value='" & rsProductList("Number_Wholesale1") & "' style='text-align:center'></td>"
            Response.Write "</tr>"

            ProductNum = ProductNum + 1
            If ProductNum >= MaxPerPage Then Exit Do
            rsProductList.MoveNext
        Loop
    End If
    rsProductList.Close
    Set rsProductList = Nothing
    Response.Write "</table>"
    Response.Write "<table width='100%' border='0' cellpadding='0' cellspacing='0'>"
    Response.Write "  <tr height='30'>"
    Response.Write "    <td width='200'><input name='chkAll' type='checkbox' id='chkAll' onclick='CheckAll(this.form)' value='checkbox'>选中本页显示的所有" & ChannelShortName & "</td>"
    Response.Write "    <td align='center'><input type='submit' name='submit1' value='确定批量购买选中的" & ChannelShortName & "'><input name='Action' type='hidden' id='Action' value='Modify'><input name='IsWholesale' type='hidden' id='IsWholesale' value='1'></td>"
    Response.Write "  </tr>"
    Response.Write "</table>"
    Response.Write "</td>"
    Response.Write "</form></tr></table>"
    If Keyword <> "" Then
        strFileName = strFileName & "&Keyword=" & Keyword
    End If
    If ClassID > 0 Then
        strFileName = strFileName & "&ClassID=" & ClassID
    End If
    If totalPut > 0 Then
        Response.Write ShowPage(strFileName, totalPut, MaxPerPage, CurrentPage, True, True, ChannelItemUnit & ChannelShortName & "", True)
    End If

End Sub

Sub ShowPath(RootName)
    Response.Write "您现在的位置:&nbsp;" & ChannelName & "管理&nbsp;&gt;&gt;&nbsp;<a href='User_Wholesale.asp'>" & RootName & "</a>&nbsp;&gt;&gt;&nbsp;"
    If ClassID > 0 Then
        If ParentID > 0 Then
            Dim sqlPath, rsPath
            sqlPath = "select ClassID,ClassName from PE_Class where ClassID in (" & ParentPath & ") order by Depth"
            Set rsPath = Conn.Execute(sqlPath)
            Do While Not rsPath.EOF
                Response.Write "<a href='User_Wholesale.asp?ClassID=" & rsPath(0) & "'>" & rsPath(1) & "</a>&nbsp;&gt;&gt;&nbsp;"
                rsPath.MoveNext
            Loop
            rsPath.Close
            Set rsPath = Nothing
        End If
        Response.Write "<a href='User_Wholesale.asp?ClassID=" & ClassID & "'>" & ClassName & "</a>&nbsp;&gt;&gt;&nbsp;"
    End If
    Select Case SearchType
    Case 0
        Response.Write "所有" & ChannelShortName & ""
    Case 3
        Response.Write "正常销售的" & ChannelShortName & ""
    Case 4
        Response.Write "涨价商品"
    Case 5
        Response.Write "降价/打折商品"
    Case 7
        Response.Write strPath & "有促销活动的" & ChannelShortName & ""
    Case 11
        Response.Write "所有固顶的" & ChannelShortName & ""
    Case 12
        Response.Write "所有热卖" & ChannelShortName & ""
    Case 13
        Response.Write "所有推荐" & ChannelShortName & ""
    Case Else
        Select Case strField
            Case "ProductName"
                Response.Write ChannelShortName & "名称中含有 <font color=red>" & Keyword & "</font> "
            Case "ProductIntro"
                Response.Write ChannelShortName & "简介中含有 <font color=red>" & Keyword & "</font> "
            Case "ProductExplain"
                Response.Write ChannelShortName & "介绍中含有 <font color=red>" & Keyword & "</font> "
            Case "Inputer"
                Response.Write "<font color=red>" & Keyword & "</font> 添加"
            Case "ProducerName"
                Response.Write "厂商为 <font color=red>" & Keyword & "</font> "
            Case "TrademarkName"
                Response.Write "品牌为 <font color=red>" & Keyword & "</font> "
            Case Else
                Response.Write ChannelShortName & "名称中含有 <font color=red>" & Keyword & "</font> "
        End Select
        Response.Write "的" & ChannelShortName
    End Select
End Sub

%>

⌨️ 快捷键说明

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