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

📄 sysproduct.asp

📁 官方最新的南方数据v12生成静态商业版。全站生成静态。
💻 ASP
📖 第 1 页 / 共 3 页
字号:
	if ParentID>0 then
		set trs=conn.execute("select ClassID from 0791idc_ProductClass where ParentID=" & ClassID & " or ParentPath like '%" & ParentPath & "," & ClassID & ",%' and Child=0 ")
	else
		set trs=conn.execute("select ClassID from 0791idc_ProductClass where RootID=" & RootID & " and Child=0 " )
	end if

	   if not trs.eof then
 					do while not trs.eof
						arrClassID=arrClassID & "," & trs(0)
						trs.movenext
					loop				
	    trs.close
	     sqlProduct=sqlProduct & " and ClassID in (" & arrClassID & ")"
	   else
	    sqlProduct=sqlProduct & " and ClassID=" & ClassID
	   end if	
	end if
	sqlProduct=sqlProduct & " order by ID desc"
	Set rsProduct= Server.CreateObject("ADODB.Recordset")
	rsProduct.open sqlProduct,conn,1,1
	if rsProduct.bof and  rsProduct.eof then
		response.Write("<br><li>没有任何产品</li>")
	else
		if currentPage=1 then
			call ProductContent(TitleLen)
		else
			if (currentPage-1)*MaxPerPage<totalPut then
         	   	rsProduct.move  (currentPage-1)*MaxPerPage
         		dim bookmark
           		bookmark=rsProduct.bookmark
            	call ProductContent(TitleLen)
        	else
	        	currentPage=1
           		call ProductContent(TitleLen)
	    	end if
		end if
	end if
	rsProduct.close
	set rsProduct=nothing
end sub

sub ProductContent(intTitleLen)
        dim i,strTemp,ViewList
        i=1
		ViewList=4 
		strTemp=""
		strtemp= strtemp & "<p>"
		strTemp= strTemp & "<TABLE width='98%' align=center  BORDER=0 CELLSPACING=1 CELLPADDING=0>"
		strTemp= strTemp & "<tr>"
	do while not rsProduct.eof
	strTemp= strTemp & "<td>"				
	strTemp= strTemp & "<table align=center width=170 border=0 cellspacing=2 cellpadding=0>"
    strTemp= strTemp & "<tr>"
    strTemp= strTemp & "<td colspan=2>"
    strTemp= strTemp &"<TABLE align=center  border=0 cellPadding=0 cellSpacing=5>" 
    strTemp= strTemp &"<TR>"
    strTemp= strTemp &"<TD align=middle > <TABLE align=center border=0 cellPadding=0 cellSpacing=0>"       
    strTemp= strTemp &"<TR>"
    strTemp= strTemp &"<TD  height=10><IMG height=10 src='Img/bg_0ltop.gif' width=10></TD>"
    strTemp= strTemp &"<TD background='Img/bg_01.gif' height=10></TD>"
    strTemp= strTemp &"<TD height=10><IMG height=10 src='Img/bg_0rtop.gif' width=10></TD>"
    strTemp= strTemp &"</TR>"
    strTemp= strTemp &"<TR> "
    strTemp= strTemp &"<TD background='Img/bg_03.gif' width=10>&nbsp;</TD>"
    strTemp= strTemp & "<td width=130 height=100>"&"<div align=center>"  

   
   If ISHTML = 1 Then
	  AutoLink = ""&ProName&""&Separated&""&rsProduct("ID")&"."&HTMLName&""
   Else
	  AutoLink = "ProductShow.asp?ClassID="& rsProduct("ClassID")&"&ID=" & rsProduct("id") &""
   End If
	strTemp= strTemp &"<a href="""&AutoLink&""">"
   
    strTemp= strTemp & "<img src=" & rsProduct("DefaultPicUrl") & " width='130' height='100' border='0' onload='javascript:DrawImage(this);'>" & "</a><br></div>"  
	 
   strTemp= strTemp & "</td>"
   strTemp= strTemp &"<TD background='Img/bg_04.gif' width=10>&nbsp;</TD>"
   strTemp= strTemp &"</TR>"
   strTemp= strTemp &"<TR>"
   strTemp= strTemp &"<TD height=10><IMG height=10 src='Img/bg_0lbottom.gif' width=10></TD>"
   strTemp= strTemp &"<TD background=Img/bg_02.gif height=10></TD>"
   strTemp= strTemp &"<TD height=10><IMG height=10 src='Img/bg_0rbottom.gif' width=10></TD>"
   strTemp= strTemp &"</TR>"          
   strTemp= strTemp &"</TABLE></TD>"
   strTemp= strTemp &"</TR>"  
   strTemp= strTemp &"</TABLE>"
                strTemp= strTemp & "</a></div></td>"
				strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td align=right >"
                strTemp= strTemp & "名称:</td>"
                strTemp= strTemp & "<td width=80% >"
                strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsProduct("id") & ">" & rsProduct("Title") & ""
                strTemp= strTemp & "</a></td>"
				
				strTemp= strTemp & "</tr><tr>"
				strTemp= strTemp & "<td align=right >"
                strTemp= strTemp & "编号:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & rsProduct("Product_Id") & ""
                strTemp= strTemp & "</a></td>"				      
			   
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td colspan=2>"
                strTemp= strTemp & "<table width=100% border=0 cellpadding=0 cellspacing=0>"
                strTemp= strTemp & "<tr>" 
                strTemp= strTemp & "<td>"
                strTemp= strTemp & "</td><td></td></tr>"             
			   strTemp= strTemp & "<tr>" 
                strTemp= strTemp & "<td width=50% height=12>"
                strTemp= strTemp & "</td>"
                
				strTemp= strTemp & "<td width=50% height=12>"
                strTemp= strTemp & "<div align=center><input name='Product_Id' type='checkbox'    id='Product_Id' value="&cstr(rsProduct("Product_Id"))&"> 选取"
                strTemp= strTemp & "</div></td>"
                strTemp= strTemp & "</tr>"
                strTemp= strTemp & "</table>"
                strTemp= strTemp & "</td>"
                strTemp= strTemp & "</tr><tr>" 
                strTemp= strTemp & "<td height=1 colspan=3 bgcolor=#CCCCCC></td>"
                strTemp= strTemp & "</tr>"
                strTemp= strTemp & "</table>"		
        if i mod ViewList =0 then 
		   strTemp= strTemp & "</td></tr><tr>"
		else 
		   strTemp= strTemp & "</td>"  
        end if
           rsProduct.MoveNext      
		i=i+1
		if i>MaxPerPage then exit do			
	loop
		strtemp= strtemp & "</tr></table>"
		response.write strTemp  
end sub



'=================================================
'过程名:ShowSearchTerm
'作  用:显示搜索条件信息
'参  数:无
'=================================================
sub ShowSearchTerm()
	response.write "&nbsp;产品搜索&nbsp;&gt;&gt; "
	if BigClassName<>"" then
		response.write "<a href='Product.asp?BigClassName=" & BigClassName & "'>" & BigClassName & "</a>&nbsp;&gt;&gt;&nbsp;"
		if SmallClassName<>"" then
			response.write "<a href='Product.asp?BigClassName=" & BigClassName & "&SmallClassName=" & SmallClassName & "'>" & SmallClassName & "</a>&nbsp;&gt;&gt;&nbsp;"
		else
			response.write "所有小类&nbsp;&gt;&gt;&nbsp;"
		end if
	end if
	if keyword<>"" then
	  select case strField
		case "Title"
			response.Write "名称中含有 <font color=red>"&keyword&"</font> 的产品"
		case "Content"
			response.Write "说明含有 <font color=red>"&keyword&"</font> 的产品"
		case else
			response.Write "名称中含有 <font color=red>"&keyword&"</font> 的产品"
	  end select
	else
	  response.write "&nbsp;所有产品"
	end if
end sub

'=================================================
'过程名:SearchResultTotal
'作  用:显示搜索结果总数
'参  数:无
'=================================================
sub SearchResultTotal()
	dim rsTotal,sqlTotal
	sqlTotal="select id from 0791idc_Product where Passed=True "
	if ClassID="" then ClassID=0
	if ClassID>0 then		
	arrClassID=ClassID
	if ParentID>0 then
		set trs=conn.execute("select ClassID from 0791idc_ProductClass where ParentID=" & ClassID & " or ParentPath like '%" & ParentPath & "," & ClassID & ",%' and Child=0 ")
	else
		set trs=conn.execute("select ClassID from 0791idc_ProductClass where RootID=" & RootID & " and Child=0 " )
	end if
	   if not trs.eof then
 					do while not trs.eof
						arrClassID=arrClassID & "," & trs(0)
						trs.movenext
					loop				
         	trs.close
			set trs=nothing			
			sqlTotal=sqlTotal & " and ClassID in (" & arrClassID & ")"
		else
			sqlTotal=sqlTotal & " and ClassID=" & ClassID
 		end if
		
	end if	
	
	if keyword<>"" then
		select case strField
			case "Title"
				sqlTotal=sqlTotal & " and Title like '%" & keyword & "%' "
			case "Content"
				sqlTotal=sqlTotal & " and Content like '%" & keyword & "%' "
			case else
				sqlTotal=sqlTotal & " and Title like '%" & keyword & "%' "
		end select
	end if
	Set rsTotal= Server.CreateObject("ADODB.Recordset")
	rsTotal.open sqlTotal,conn,1,1
	if rsTotal.eof and rsTotal.bof then
		totalPut=0
		response.write "共有 0 个产品"
	else
		totalPut=rsTotal.recordcount
		response.Write "共找到 " & rsTotal.recordcount & " 个产品"
	end if
end sub

'=================================================
'过程名:ShowSearchResult
'作  用:分页显示搜索结果
'参  数:无
'=================================================
sub ShowSearchResult()
   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
        sqlSearch="select top " & MaxPerPage	
	else
		sqlSearch="select "
	end if	
		sqlSearch=sqlSearch & " ID,Product_Id,ClassID,IncludePic,Title,Price,Spec,Unit,Memo,DefaultPicUrl,UpdateTime,Hits from 0791idc_Product where Passed=True "
	if ClassID="" then ClassID=0	
	if ClassID>0 then		
	arrClassID=ClassID
	if ParentID>0 then
		set trs=conn.execute("select ClassID from 0791idc_ProductClass where ParentID=" & ClassID & " or ParentPath like '%" & ParentPath & "," & ClassID & ",%' and Child=0 ")
	else
		set trs=conn.execute("select ClassID from 0791idc_ProductClass where RootID=" & RootID & " and Child=0 " )
	end if
	   if not trs.eof then
 					do while not trs.eof
						arrClassID=arrClassID & "," & trs(0)
						trs.movenext
					loop				
         	trs.close
			set trs=nothing			
			sqlSearch=sqlSearch & " and ClassID in (" & arrClassID & ")"
		else
			sqlSearch=sqlSearch & " and ClassID=" & ClassID
		end if
	end if	
		
	if keyword<>"" then
		select case strField
			case "Title"
				sqlSearch=sqlSearch & " and Title like '%" & keyword & "%' "
			case "Content"
				sqlSearch=sqlSearch & " and Content like '%" & keyword & "%' "
			case else
				sqlSearch=sqlSearch & " and Title like '%" & keyword & "%' "

⌨️ 快捷键说明

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