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

📄 sysproduct.asp

📁 官方最新的南方数据v12生成静态商业版。全站生成静态。
💻 ASP
📖 第 1 页 / 共 3 页
字号:
<!--#include file="Conn.asp"-->
<!--#Include File="Check_Sql.asp"-->
<!--#include file="Config.asp"-->
<!--#include file="Function.asp"-->

<%
dim strFileName,MaxPerPage,ShowSmallClassType
dim totalPut,CurrentPage,TotalPages
dim BeginTime,EndTime
dim founderr, errmsg
dim BigClassName,SmallClassName,keyword,strField
dim rs,sql,sqlProduct,rsProduct,sqlSearch,rsSearch,sqlBigClass,rsBigClass
BeginTime=Timer
ClassID=trim(request("ClassID"))
keyword=trim(request("keyword"))
if keyword<>"" then 
	keyword=replace(replace(replace(replace(keyword,"'","‘"),"<","&lt;"),">","&gt;")," ","&nbsp;")
end if
strField=trim(request("Field"))

if request("page")<>"" then
    currentPage=cint(request("page"))
else
	currentPage=1
end if



strPath= "&nbsp;您现在的位置&nbsp;>>&nbsp;<a href='product.asp'>所有产品</a>"

if len(ClassID)>0 then

	sql="select ClassName,RootID,ParentID,Depth,ParentPath,Child From 0791idc_ProductClass"
	sql=sql & " where ClassID=" & ClassID
	set tClass=conn.execute(sql)
	
	if tClass.bof and tClass.eof then

		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>找不到指定的栏目</li>"
	else
		
			ClassName=tClass(0)
			RootID=tClass(1)
			ParentID=tClass(2)
			Depth=tClass(3)
			ParentPath=tClass(4)
			Child=tClass(5)			

			strPath=strPath & "&nbsp;&gt;&gt;&nbsp;"			
			if ParentID>0 then
				dim sqlPath,rsPath
				sqlPath="select ClassID,ClassName From 0791idc_ProductClass"
				sqlPath= sqlPath & " where ClassID in (" & ParentPath & ") order by Depth"
				set rsPath=server.createobject("adodb.recordset")
				rsPath.open sqlPath,conn,1,1
				do while not rsPath.eof
					strPath=strPath & "<a href='Product.asp?ClassID=" & rsPath(0)  & "'>" & rsPath(1) & "</a>&nbsp;&gt;&gt;&nbsp;"
					strPageTitle=strPageTitle & rsPath(1) & " >> "
					rsPath.movenext
				loop
				rsPath.close
				set rsPath=nothing
			end if
			strPath=strPath & "<a href='Product.asp?ClassID=" & ClassID & "'>" & ClassName & "</a>"						
	end if
end if
'=================================================
'过程名:ShowSmallClass_Tree
'作  用:树形目录方式显示栏目
'参  数:无
'=================================================
Sub ShowSmallClass_Tree()
%>
<SCRIPT language=javascript>
function opencat(cat,img){
	if(cat.style.display=="none"){
	cat.style.display="";
	img.src="img/class2.gif";
	}	else {
	cat.style.display="none"; 
	img.src="img/class1.gif";
	}
}
</Script>
<TABLE cellSpacing=0 cellPadding=0 width="99%" border=0>
<%
dim i
set rsbig = server.CreateObject ("adodb.recordset")
		sql="select * from 0791idc_BigClass"
		rsbig.open sql,conn,1,1
if rsbig.eof and rsbig.bof then
	Response.Write "栏目正在建设中……"
else
	i=1
	do while not rsbig.eof
%>
	<TR>
		<TD language=javascript onmouseup="opencat(cat10<%=i%>000,&#13;&#10; img10<%=i%>000);" id=item$pval[catID]) style="CURSOR: hand" width=34 height=24 align=center><IMG id=img10<%=i%>000 src="img/class1.gif" width=20 height=20></TD>
		<TD width="190"><a href='Product.asp?BigClassName=<%=rsbig("BigClassName")%>'><%=rsbig("BigClassName")%></a></TD>
	</TR>
	<TR>
		<TD id=cat10<%=i%>000 <%if rsbig("BigClassName")=BigClassName then 
		     response.write "style='DISPLAY'"   
		    else  
		     response.write "style='DISPLAY: none'"
		    end if%> colspan="2">
<%
dim rsSmall,sqls,j
set rsSmall = server.CreateObject ("adodb.recordset")
sqls="select * from 0791idc_SmallClass where BigClassName='" & rsbig("BigClassName") & "' order by SmallClassID"
rsSmall.open sqls,conn,1,1
if rsSmall.eof and rsSmall.bof then
	Response.Write "没有小类"
else
	j=1
	do while not rsSmall.eof
%>
&nbsp;<IMG height=20 src="img/class3.gif" width=26 align=absMiddle border=0><a href="Product.asp?BigClassName=<%=rsSmall("BigClassName")%>&Smallclassname=<%=rsSmall("SmallClassName")%>"><%=rsSmall("SmallClassName")%></a><BR>
<%
	rsSmall.movenext
	j=j+1
	loop
end if
rsSmall.close
set rsSmall=nothing
%>
		</TD>
	</TR>
<%
	rsbig.movenext
	i=i+1
	loop
	rsbig.close
    set rsbig=nothing
end if
%>
</TABLE>
<%
end Sub 

'=================================================
'过程名:ShowVote
'作  用:显示网站调查
'参  数:无
'=================================================
sub ShowVote()
	dim sqlVote,rsVote,i
	sqlVote="select top 1 * from 0791idc_Vote where IsSelected="&TrueType&""
	Set rsVote= Server.CreateObject("ADODB.Recordset")
	rsVote.open sqlVote,conn,1,1
	if rsVote.bof and rsVote.eof then 
		response.Write "&nbsp;没有任何调查"
	else
		response.write "<form name='VoteForm' method='post' action='vote.asp' target='_blank'><td>"
		response.write rsVote("Title") & "<br><br>"
		if rsVote("VoteType")="Single" then
			for i=1 to 8
				if trim(rsVote("Select" & i) & "")="" then exit for
				response.Write "<input type='radio' name='VoteOption' value='" & i & "'>" & rsVote("Select" & i) & "<br>"
			next
		else
			for i=1 to 8
				if trim(rsVote("Select" & i) & "")="" then exit for
				response.Write "<input type='checkbox' name='VoteOption' value='" & i & "'>" & rsVote("Select" & i) & "<br>"
			next
		end if
		response.write "<br><input name='VoteType' type='hidden'value='" & rsVote("VoteType") & "'>"
		response.write "<input name='Action' type='hidden' value='Vote'>"
		response.write "<input name='ID' type='hidden' value='" & rsVote("ID") & "'>"
		response.write "<a href='javascript:VoteForm.submit();'><img src='images/voteSubmit.gif' width='52' height='18' border='0'></a>&nbsp;&nbsp;"
        response.write "<a href='Vote.asp?Action=Show' target='_blank'><img src='images/voteView.gif' width='52' height='18' border='0'></a>"
		response.write "</td></form>"
	end if
	rsVote.close
	set rsVote=nothing
end sub

'=================================================
'过程名:ShowClassGuide
'作  用:显示栏目导航位置
'参  数:无
'=================================================
sub ShowClassGuide()
	if PageTitle<>"" and ChannelID<>1 then
		strPath=strPath & "&nbsp;&gt;&gt;&nbsp;" & PageTitle
	end if
	response.write strPath
end sub

'=================================================
'过程名:ShowProductTotal
'作  用:显示文章总数
'参  数:无
'=================================================
sub ShowProductTotal()
	dim sqlTotal
	dim rsTotal,arrClassID

	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
	 		
	 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
	else	    
	    Set rsTotal= Server.CreateObject("ADODB.Recordset")
	    rsTotal.open sqlTotal,conn,1,1
		totalPut=rsTotal.recordcount
		response.Write "共有 " & rsTotal.recordcount & " 个产品"
	end if
	rsTotal.close
	set rsTotal=nothing
end sub

'=================================================
'过程名:ShowProduct
'=================================================
sub ShowProduct(TitleLen)
	if TitleLen<0 or TitleLen>200 then
		TitleLen=50
	end if
    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
        sqlProduct="select top " & MaxPerPage	
	else
		sqlProduct="select "
	end if

	sqlProduct=sqlProduct & " 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

⌨️ 快捷键说明

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