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

📄 ensysproduct.asp

📁 唐网公司企业网站管理系统源码 双数据库 sql access 功能强大 易于扩展
💻 ASP
📖 第 1 页 / 共 2 页
字号:
 
<!--#Include File="Check_Sql.asp"-->
<!--#include file="Conn.asp"-->
<!--#include file="Config.asp"-->
<!--#include file="Function.asp"-->

<%
dim strFileName,MaxPerPage,ShowSmallClassType
dim totalPut,CurrentPage,TotalPages
dim BeginTime,EndTime
dim founderr, errmsg
dim EnBigClassName,EnSmallClassName,keyword,strField
dim rs,sql,sqlProduct,rsProduct,sqlSearch,rsSearch,sqlBigClass,rsBigClass
BeginTime=Timer
EnBigClassName=Trim(request("EnBigClassName"))
EnSmallClassName=Trim(request("EnSmallClassName"))
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

sqlBigClass="select * from BigClass order by BigClassID"
Set rsBigClass= Server.CreateObject("ADODB.Recordset")
rsBigClass.open sqlBigClass,conn,1,1

'=================================================
'过程名: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 BigClass"
		rsbig.open sql,conn,1,1
if rsbig.eof and rsbig.bof then
	Response.Write "Columns In Building……"
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="662"><a href='EnProduct.asp?EnBigClassName=<%=rsbig("EnBigClassName")%>'><%=rsbig("EnBigClassName")%></a></TD>
	</TR>
	<TR>
		<TD id=cat10<%=i%>000 <%if rsbig("EnBigClassName")=EnBigClassName 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 SmallClass where EnBigClassName='" & rsbig("EnBigClassName") & "' order by SmallClassID"
rsSmall.open sqls,conn,1,1
if rsSmall.eof and rsSmall.bof then
	Response.Write "No SmallClass"
else
	j=1
	do while not rsSmall.eof
%>
&nbsp;<IMG height=20 src="img/class3.gif" width=26 align=absMiddle border=0><a href="EnProduct.asp?EnBigClassName=<%=rsSmall("EnBigClassName")%>&EnSmallClassName=<%=rsSmall("EnSmallClassName")%>"><%=rsSmall("EnSmallClassName")%></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 Vote where IsSelected=True"
	Set rsVote= Server.CreateObject("ADODB.Recordset")
	rsVote.open sqlVote,conn,1,1
	if rsVote.bof and rsVote.eof then 
		response.Write "&nbsp;No research"
	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()
	response.write  "&nbsp;<a href='EnProducts.asp'>Product</a>&nbsp;&gt;&gt;"
	if EnBigClassName="" and EnSmallClassName="" then
		response.write "&nbsp;All Products"
	else
		if EnBigClassName<>"" then
			response.write "&nbsp;<a href='EnProduct.asp?EnBigClassName=" & EnBigClassName & "'>" & EnBigClassName & "</a>&nbsp;&gt;&gt;&nbsp;"
			if EnSmallClassName<>"" then
				response.write "<a href='EnProduct.asp?EnBigClassName=" & EnBigClassName & "&EnSmallClassName=" & EnSmallClassName & "'>" & EnSmallClassName & "</a>"
			else
				response.write "All SmallClass"
			end if
		end if
	end if
end sub

'=================================================
'过程名:ShowProductTotal
'作  用:显示文章总数
'参  数:无
'=================================================
sub ShowProductTotal()
	dim sqlTotal
	dim rsTotal
	sqlTotal="select Count(*) from Product where Passed=True "
	if EnBigClassName<>"" then
		sqlTotal=sqlTotal & " and EnBigClassName='" & EnBigClassName & "' "
		if EnSmallClassName<>"" then
			sqlTotal=sqlTotal & " and EnSmallClassName='" & EnSmallClassName & "' "
		end if	
	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 "Total 0 Products"
	else
		totalPut=rsTotal(0)
		response.Write "Total " & totalPut & " Products"
	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,EnBigClassName,EnSmallClassName,IncludePic,EnTitle,Price,EnSpec,EnUnit,EnMemo,DefaultPicUrl,UpdateTime,Hits from Product where Passed=True "
	
	if EnBigClassName<>"" then
		sqlProduct=sqlProduct & " and EnBigClassName='" & EnBigClassName & "' "
		if EnSmallClassName<>"" then
			sqlProduct=sqlProduct & " and EnSmallClassName='" & EnSmallClassName & "' "
		end if
	end if
	sqlProduct=sqlProduct & " order by UpdateTime desc"
	Set rsProduct= Server.CreateObject("ADODB.Recordset")
	rsProduct.open sqlProduct,conn,1,1
	if rsProduct.bof and  rsProduct.eof then
		response.Write("<br><li>No products</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
    i=0
	do while not rsProduct.eof
		strTemp=""		
		strTemp= strTemp & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
                strTemp= strTemp & "<tr>"
                strTemp= strTemp & "<td width=25% rowspan=6>"
                strTemp= strTemp & "<div align=center><a href=EnProductShow.asp?ID=" & rsProduct("ID") & ">" 
				
				fileExt=lcase(getFileExtName(rsProduct("DefaultPicUrl")))
				if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then
                strTemp= strTemp & "<img style='BORDER-LEFT-COLOR: #cccccc; BORDER-BOTTOM-COLOR: #cccccc; BORDER-TOP-COLOR: #cccccc; BORDER-RIGHT-COLOR: #cccccc' src=" & rsProduct("DefaultPicUrl") & " width=105 height=80 onload='javascript:DrawImage(this);'>" 
				else
				 if fileext="swf" then
				    strTemp= strTemp & "<object  classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'  codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='105' height='84'>"
					strTemp= strTemp &"<param name=movie value='"&rsProduct("DefaultPicUrl")&"'>"
					strTemp= strTemp &"<param name=quality value=high>"
					strTemp= strTemp &"<param name='Play' value='-1'>"
					strTemp= strTemp &"<param name='Loop' value='0'>"
					strTemp= strTemp &"<param name='Menu' value='-1'>"					
					strTemp= strTemp &"<embed  src='"&rsProduct("DefaultPicUrl")&"' width='105' height='84' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed> </object>"												
			   end if
		      end if			 
				 
                strTemp= strTemp & "</a></div></td>"
                strTemp= strTemp & "<td width=18% height=12>"
                strTemp= strTemp & "Product Name:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & "<a href=EnProductShow.asp?ID=" & rsProduct("ID") & ">" & rsProduct("EnTitle") & ""
                strTemp= strTemp & "</a></td>"						
				
				'strTemp= strTemp & "</tr><tr>" 
                'strTemp= strTemp & "<td width=12% height=12>"
                'strTemp= strTemp & "产品售价:</td>"
                'strTemp= strTemp & "<td>" & rsProduct("Price") & "元</td>"	
				
				strTemp= strTemp & "</tr><tr>"
				strTemp= strTemp & "<td width=18% height=12>"
                strTemp= strTemp & "Product Spec:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & rsProduct("EnSpec") & ""
                strTemp= strTemp & "</a></td>"
				
				strTemp= strTemp & "</tr><tr>"
				strTemp= strTemp & "<td width=12% height=12>"
                strTemp= strTemp & "Product Memo:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & rsProduct("EnMemo") & ""
                strTemp= strTemp & "</a></td>"			
				
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td height=12>"
                strTemp= strTemp & "Product Class:</td>"
                strTemp= strTemp & "<td><a href=EnProduct.asp?EnBigClassName="& rsProduct("EnBigClassName")&">"&rsProduct("EnBigClassName")&"</a> → "
                strTemp= strTemp & "<a href=EnProduct.asp?EnBigClassName=" & rsProduct("EnBigClassName") & "&EnSmallClassName=" & rsProduct("EnSmallClassName") & ">" & rsProduct("EnSmallClassName") & ""
                strTemp= strTemp & "</a></td>"
                strTemp= strTemp & "</tr><tr>" 				

			   
                strTemp= strTemp & "<td height=12>Product Info:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & "<a href=EnProductShow.asp?ID=" & rsProduct("ID") & " target=_blank><img src=Images/arrow_7En.gif border=0></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 width=50% height=12>"
                strTemp= strTemp & "<div align=center></div></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"))&"> Select"
                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>"
		response.write strTemp
		rsProduct.movenext
		i=i+1
		if i>=MaxPerPage then exit do	
	loop
end sub 


'=================================================
'过程名:ShowSearchTerm
'作  用:显示搜索条件信息
'参  数:无
'=================================================
sub ShowSearchTerm()
	response.write "&nbsp;Product Search&nbsp;&gt;&gt; "
	if EnBigClassName<>"" then
		response.write "<a href='EnProduct.asp?EnBigClassName=" & EnBigClassName & "'>" & EnBigClassName & "</a>&nbsp;&gt;&gt;&nbsp;"
		if EnSmallClassName<>"" then
			response.write "<a href='EnProduct.asp?EnBigClassName=" & EnBigClassName & "&EnSmallClassName=" & EnSmallClassName & "'>" & EnSmallClassName & "</a>&nbsp;&gt;&gt;&nbsp;"
		else
			response.write "All Smallclass&nbsp;&gt;&gt;&nbsp;"
		end if
	end if
	if keyword<>"" then
	  select case strField
		case "Title"
			response.Write "Name include <font color=red>"&keyword&"</font> Products"
		case "Content"
			response.Write "Readme include <font color=red>"&keyword&"</font> Products"
		case else
			response.Write "Name include <font color=red>"&keyword&"</font> Products"
	  end select
	else
	  response.write "&nbsp;All Products"
	end if
end sub

⌨️ 快捷键说明

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