<%
'//--------------------------Dailyn得到并显示大类名称-------------------------------// 
Sub getBigclass(ziduan,tablename,urlpage,showRow,cutStr) 
	'//ziduan:需要选出的字段名。tablename：表名。urlpage：链接地址。showRow:分几列显示。cutStr：每条记录显示多少个字符
	response.Write "<table width='70%' border='0' align='center' cellpadding='0' cellspacing='0'>"
	set rsClass=server.CreateObject("adodb.recordset")
	rsClass.open "select "&ziduan&" from "&tablename&"",conn,1,1
	if rsClass.eof and rsClass.bof then
		response.Write "<tr><td height='22'>暂无大类!</td></tr>"
	else
			i=1 
				response.Write "<tr>"
				do while not rsClass.eof
				response.Write "<td height='22' style='BORDER-BOTTOM: #cccccc 1px solid;'>"
				response.Write"<a href="&urlpage&"?Bclass="&server.URLENCODE(rsClass("BigClassName"))&" title="&rsClass("BigClassName")&"><div align='center'>"&left (rsClass("BigClassName"),cutStr)&"<div></a>"
			if i mod showRow = 0 then
				response.Write "</td></tr>"	
			end if
			i=i+1
			rsClass.movenext
		loop
		rsClass.close
	end if
	response.Write "</table>"
End Sub 


'//--------------------------Dailyn得到并显示小类名称-------------------------------// 
Sub getSmallclass(defaultbigclass,tablename,urlpage,showRow,cutStr) 
	'//defaultbigclass：默认大类。tablename：表名。urlpage：链接地址。showRow:分几列显示。cutStr：每条记录显示多少个字符。
	bigClass=trim(request("Bigclass"))'取得分类的类型号
	if bigClass="" then'设定默认类型号
	bigClass=""&defaultbigclass&""             
	end if
	response.Write "<table width='142' border='0' align='center' cellpadding='0' cellspacing='0'>"
	set rsClassSmall=server.CreateObject("adodb.recordset")
	rsClassSmall.open "select * from "&tablename&" where BigClassName='"&bigClass&"' order by SmallClassID asc",conn,1,1
	
	if rsClassSmall.eof and rsClassSmall.bof then
		response.Write "您未选择大类或此类中没有小类!"
	else
		i=1 
		do while not rsClassSmall.eof
				response.Write "<tr><td width='20'><img src='./images/dian.gif'></td>			<td height='28'>"
				response.Write("<a href='"&urlpage&"?bigClass="&bigClass&"&amp;smallClass="&rsClassSmall("SmallClassName")&"'>")
				response.write("<span class=''>"&rsClassSmall("SmallClassName")&"</span></a>")
			if i mod showRow = 0 then
				response.Write "</td></tr>"	
				'response.Write "<tr><td height='1' bgcolor='#D1D1D1'></td></tr>"
			end if
			i=i+1
			rsClassSmall.movenext
		loop
		rsClassSmall.close
	end if
	response.Write "</table>"
End Sub


'//--------------------------Dailyn显示列表类新闻-------------------------------// 
Sub showNews(showRow,cutStr,tableper,tdper,tdDownper,frospace,linkclass,linktarget,myrsSql,showStr,showtime,showHit,urlpage,getid) 
	'//showRow：显示几列。cutStr：截取字符串长度。tableper：表格属性。
	'//tdper:td属性。tdDownper：下划线属性。frospace：标题前字符。
	'//linkclass：超链接样式。linktarget：超链接属性。myrssql:sql语句。showStr：显示字符。showtime：显示时间。
	'//showHit：显示点击量。urlpage：链接地址。getid：传递ID参数。
	response.Write "<table width='100%' border='0' cellspacing='0' cellpadding='0' align='left'>" '表格属性
	set myrs=server.CreateObject("adodb.recordset")
	sql=""&myrssql&""  'SQL语句
	myrs.open sql,conn,1,1
	if myrs.eof and myrs.bof then
				response.write "&nbsp;&nbsp;&nbsp;暂时还没有信息"
	else
		i=1
				response.Write "<tr>"
		do while not myrs.eof
				response.Write "<td height='25'>"
				response.Write ""&tableper&"" '表格属性
				if showtime<>"" then
				   mytime = myrs(""&showtime&"")
				   mytimeStr = "&nbsp;&nbsp;<font color='#979898'>"&month(mytime)&"/"&day(mytime)&"</font>"
				end if
				if showHit<>"" then
				   myHit = myrs(""&showHit&"")
				   myHitStr = "&nbsp;<font color='bbbbbb'>"&myHit&"</font>"
				else
				end if					
				response.Write " "&tdper&" "&frospace&"<a href='"&urlpage&"?"&getid&"="&myrs(""&getid&"")&"' class='"&linkclass&"' target='"&linktarget&"' title="&myrs(""&showStr&"")&">"&left (myrs(""&showStr&""),cutStr)&"</a>"&mytimeStr&"</td>"
				response.Write "</tr><tr>"&tdDownper&"</table>"
			if i mod showRow = 0 then
				response.Write "</td></tr>"
			end if
		i=i+1
		myrs.MoveNext
		loop
	myrs.close
	end if
	response.Write "</table>"
end Sub


'//--------------------------Dailyn得到并显示用户当前的位置-------------------------------// 
Sub getNowPage() 
   
	bigClass=trim(request("Bclass"))'取得分类的类型号
	smallClass=trim(request("smallClass"))'取得分类的类型号
	response.Write("<font color=#F9E9D2>当前位置：</font><a href='/'><font color=#F9E9D2>首页</font></a>&nbsp;<font color=#F9E9D2>-</font>&nbsp;<a href=production.asp?bigClass="&server.URLENCODE(bigClass)&"><font color=#F9E9D2>"&bigClass&"</font><a>&nbsp;<font color=#F9E9D2>-</font>&nbsp;<a href=productionSmall.asp?bigClass="&server.URLENCODE(bigClass)&"&smallClass="&server.URLENCODE(smallClass)&"><font color=#F9E9D2>"&smallClass&"</font><a>")
	
End Sub 



'//--------------------------Dailyn得到并显示分页代码-------------------------------// 
sub getPage
	
	dim strPage
	pathUrl="http://" & request.ServerVariables("HTTP_HOST")&request.ServerVariables("PATH_INFO")
	strPage=strPage & "共有"&rs.recordcount&"条记录&nbsp;&nbsp;每页"&rs.pagesize&"条&nbsp;&nbsp;"
	if page>1 then
		strPage=strPage & "<a href="&pathUrl&"?page=1&bigClass="&server.URLENCODE(bigClass)&"&smallClass="&server.URLENCODE(smallClass)&">首页</a>&nbsp;&nbsp;<a href="&pathUrl&"?page="&page-1&"&bigClass="&server.URLENCODE(bigClass)&"&smallClass="&server.URLENCODE(smallClass)&">上一页</a>&nbsp;&nbsp;"
	else
		strPage=strPage & "首页&nbsp;&nbsp;上一页&nbsp;&nbsp;"
	end if
	if page<rs.pagecount then
		strPage=strPage & "<a href="&pathUrl&"?page="&page+1&"&bigClass="&server.URLENCODE(bigClass)&"&smallClass="&server.URLENCODE(smallClass)&">下一页</a>&nbsp;&nbsp;<a href="&pathUrl&"?page="&rs.pagecount&"&bigClass="&server.URLENCODE(bigClass)&"&smallClass="&server.URLENCODE(smallClass)&">尾页</a>&nbsp;&nbsp;"
	else
		strPage=strPage & "下一页&nbsp;&nbsp;尾页&nbsp;&nbsp;"
	end if
		strPage=strPage & "页次: <font color='#9C102D'>"&page&"</font>/"&rs.pagecount&""
	response.write strPage
	
end sub


 '//--------------------------Dailyn前台显示广告代码-------------------------------// 
sub getAdv(advName)
	'//advName:广告名称。
	
	set myrs=server.CreateObject("adodb.recordset")
	sql="select * from [adv] where discription='"&rtrim(ltrim(advName))&"'"
	myrs.open sql,Conn,1,1
	if myrs.eof and myrs.bof then
	response.write "&nbsp;&nbsp;暂无广告或广告地址、类型错误！"
	else
	lockpic=myrs("lockpic")
	pictype=myrs("pictype")
	   
		if lockpic="No" then
		response.Write "&nbsp;&nbsp;此广告已隐藏"
		else
	   
		  if pictype="Flash" then
			 response.Write "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'    codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='"&myrs("width")&"' height='"&myrs("height")&"'>"
			 response.Write "<param name='movie' value='../"&myrs("picurl")&"'>"
			 response.Write "<param name='quality' value='high'>"
			 response.Write "<param name='menu' value='false'>"
			 response.Write "<param name='menu' value='false'>"
			 response.Write "<embed src='../"&myrs("picurl")&"' width='"&myrs("width")&"' height='"&myrs("height")&"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' menu='false'></embed></object>"
		  else
			 response.Write "<a href='"&myrs("linkurl")&"' target='_blank'><img src='../"&myrs("picurl")&"' width='"&myrs("width")&"' height='"&myrs("height")&"' border='0'></a>"
		  end if
		  
		end if
	myrs.close
	end if
	
end sub

'//--------------------------Dailyn前台显示基本信息-------------------------------// 
function getweb_config(confName)
set myrs=server.CreateObject("adodb.recordset")
	sql="select * from web_config"
	myrs.open sql,Conn,1,1
	if myrs.eof and myrs.bof then
	response.write "暂无信息！"
	else
	response.Write(myrs(""&confName&""))
	getweb_config=myrs(""&confName&"")
	myrs.close
	end if
end function

'//--------------------------发送Email配置信息-------------------------------// 
function mail_config(confmail)
set myrs=server.CreateObject("adodb.recordset")
	sql="select * from web_config"
	myrs.open sql,Conn,1,1
	if myrs.eof and myrs.bof then
	response.write "暂无信息！"
	else
	mail_config=myrs(""&confmail&"")
	myrs.close
	end if
end function
	
'判断数字是否整形
function isInteger(para)
       on error resume next
       dim str
       dim l,i
       if isNUll(para) then 
          isInteger=false
          exit function
       end if
       str=cstr(para)
       if trim(str)="" then
          isInteger=false
          exit function
       end if
       l=len(str)
       for i=1 to l
           if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
              isInteger=false 
              exit function
           end if
       next
       isInteger=true
       if err.number<>0 then err.clear
end function
%>