
<%
'##################################################################                                                                 
'★         web08.net - 威博购物系统                                              
'★  版权所有: web08.net                                                                                                       
'★  程序制作: 威博网络技术公司                                     
'★           email:web08net@hotmail.com                           
'★            Q Q :645095280,475980829
'★	       电话:021-55520018                                                                                                         
'★  相关网址: [产品介绍] http://www.021web.com.cn/gwxt.html
'★            [支持论坛] http://bbs.web08.net/                                                                                     
'★  主页地址: http://www.web08.net/  
'★		http://www.021web.com.cn/			                                                                 
'###################################################################
%>
<%
  Function getcommcontent(commpath)
	getcommcontent=server.mappath(commpath)
	getcommcontent=getcontent(getcommcontent)
	createhtm.close
  End Function

  Function pagelist(page,totalpage,pageurl,totalcount)
	  if totalpage=1 then 
		str="首 页&nbsp;上一页&nbsp;下一页&nbsp;末 页&nbsp;"
	  end if 
  	  if page>=totalpage and page<>1 then
		  str="<a href="&pageurl&"_1.html>首页</a>&nbsp;"
		  str=str&"<a href="&pageurl&"_"&page-1&".html>上一页</a>&nbsp;"
		  str=str&"下一页&nbsp;"
		  str=str&"尾页&nbsp;"
	 end if
	if page>1 and page<totalpage then
	 	 str="<a href="&pageurl&"_1.html>首页</a>&nbsp;"
	 	 str=str&"<a href="&pageurl&"_"&page-1&".html>上一页</a>&nbsp;"
	 	 str=str&"<a href="&pageurl&"_"&page+1&".html>下一页</a>&nbsp;"
		 str=str&"<a href="&pageurl&"_"&totalpage&".html>尾页</a>&nbsp;"
	end if
	if page=1 and totalpage>1 then	
		  str="首页&nbsp;"
		  str=str&"上一页&nbsp;"
		  str=str&"<a href='"&pageurl&"_"&page+1&".html'>下一页</a>&nbsp;"
		  str=str&"<a href='"&pageurl&"_"&totalpage&".html'>尾页</a>&nbsp;"
	end if
	str1="页次:"&page&"/"&totalpage&"页 共有"&totalcount&"条记录&nbsp;"
     	str2="<select name=""menu1"" onChange=""MM_jumpMenu('parent',this,0)"">"
		for i=1 to totalpage
	   		if i=page then
               			str3=str3&"<option value='"&pageurl&"_"&i&".html' selected>第"&i&"页</option>"
	   		else
               			str3=str3&"<option value='"&pageurl&"_"&i&".html' >第"&i&"页</option>"
	   		end if 
               	 next
        str2=str2&str3&"</select>"
	pagelist=str&str1&str2
  End Function

  Function GetActList(favoractivity)
	if favoractivity<>0 then 
	      tmpstr="true"
	      set rec=server.createobject("adodb.recordset")
	      sql="select * from web_activity where id="&favoractivity
	      rec.open sql,conn
	      if not rec.eof then 
		select case rec("a_actexp")
			case 2:
			tmp=datediff("d",rec("a_enddate"),date())
			if datediff("d",rec("a_startdate"),date())>0 then
				if datediff("d",rec("a_enddate"),date())>0 then
					tmpstr="活动已结束"
				end if
			else
				tmpstr="开始日期："&rec("a_startdate")
			end if
		case 3:
			if rec("A_TimeFlag")=0 then 
				tmpstr="礼品已送完"
			end if 
		case 4:
			permonth=rec("A_TimeFlag")
			if permonth=0 then
				msg="每月"
				tmp1="true"
			else 
				msg=permonth&"月"
				if cstr(month(now()))=cstr(permonth) then
					tmp1="true"
				end if 
			end if 
			perday=split(rec("A_Timebtw"),",")
			if tmp1="true" then 
				for iii=0 to ubound(perday)
					if cstr(day(now()))=cstr(perday(iii)) then
						tmpstr="true"
						exit for
					else
						tmpstr="活动在"&msg&rec("A_Timebtw")&"开始"
					end if
				next
			else
				tmpstr="活动在"&msg&rec("A_Timebtw")&"开始"
			end if
		End select
		A_Method=rec("A_Method")
		if rec("A_PetFlag")=1 then
			pet1="获礼品"
			pet11="所得礼品"
			act_petid=split(rec("A_Petid"),",")
			for kk=0 to ubound(act_petid)
				pet22=pet22&"|"&getonevalue("web_gifts","g_name","id="&trim(act_petid(kk)))
			next 
			pet11=pet11&pet22
		end if 
		if rec("A_BenefitFlag")=1 then
			pet2="得优惠券"
			pet22="所得优惠券"
			act_bfnid=split(rec("A_BenefitId"),",")
			for kk=0 to ubound(act_bfnid)
				pet33=pet33&"|"&getonevalue("Web_Benefit","BF_Name","id="&trim(act_bfnid(kk)))
			next 
			pet22=pet22&pet33
		end if 
		'if rec("actdiscount")=1 then
		'	pet3="享折扣"
		'	pet33="所享折扣|"&rec("act_disrate")
		'end if 
		if rec("A_RemarkFlag")=1 then
			pet4="赢积分"
			pet44="所获积分|"&rec("A_mark")
		end if 
		rec.close : set rec =nothing
		str="<table width='100%' height='40' border='0' cellpadding='0' cellspacing='0' align='left'>"&vbcrlf
                str=str&"<tr>"&vbcrlf
                str=str&"<td align='left' width='35%' >附赠礼品：</td>"&vbcrlf
                str=str&"<td align='left'>"
		if A_Method=2 then
			if w_iii="" then w_iii=0
			str_1="<select name='select"&w_iii&"' style='BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; WIDTH: 80px; BORDER-BOTTOM: #cccccc 1px solid'>"&vbcrlf
			if pet1<>"" then 
				str_1=str_1&"<option value='1~"&pet11&"'>"&pet1&"</value>"&vbcrlf
			end if
			if pet2<>"" then
				str_1=str_1&"<option value='2~"&pet22&"'>"&pet2&"</value>"&vbcrlf
			end if
			if pet3<>"" then
				str_1=str_1&"<option value='3~"&pet33&"'>"&pet3&"</value>"&vbcrlf
			end if
		 	if pet4<>"" then
				str_1=str_1&"<option value='4~"&pet44&"'>"&pet4&"</value>"&vbcrlf
			end if 
  		 	str_1=str_1&"</select>"&vbcrlf
		else
			if w_iii="" then w_iii=0
			str_1="<select name='select"&w_iii&"' style='BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; WIDTH: 80px; BORDER-BOTTOM: #cccccc 1px solid'>"&vbcrlf
			str_1=str_1&"<option value='0~附加礼品|享受全部'>全部赠送</option>"&vbcrlf
		        str_1=str_1&"</select>"&vbcrlf
	        end if
		str=str&str_1&"</td>"&vbcrlf
                str=str&"</tr>"&vbcrlf
                str=str&"</table>"
	 end if
	end if
	getactlist=str
  End Function

  Function Getprevious(fid,nid)
	set rec=server.createobject("adodb.recordset")
	sql="select top 1 * from news where fid=" & fid & " and newsid<" & nid & " order by newsid desc"
	rec.open sql,conn
	if rec.eof then 
		str="没有了"
	else
		str="<a href='"&rootpath&"html/news/"&trim(rec("folder"))&"/"&trim(rec("titleid"))&".html'>"&rec("title")&"</a>"
	end if
	rec.close : set rec=nothing
	getprevious=str
  End Function

  Function GetNext(fid,nid)
	set rec=server.createobject("adodb.recordset")
	sql="select top 1 * from news where fid=" & fid & " and newsid>" & nid & " order by newsid asc"
	rec.open sql,conn
	if rec.eof then 
		str="没有了"
	else
		str="<a href='"&rootpath&"html/news/"&trim(rec("folder"))&"/"&trim(rec("titleid"))&".html'>"&rec("title")&"</a>"
	end if
	rec.close : set rec=nothing
	getnext=str
  End Function
 
  Function setvar()
	v_nowpath=Request.ServerVariables("server_name") & Request.ServerVariables("path_info")
	v_sysrootpath=web_get_rootdir(web_c_setupfolder)
	v_a1=v_sysrootpath&"inc/function"
	v_a2=v_sysrootpath&"inc/function1"
	v_a3=v_sysrootpath&"inc/function2"
  	v_a4=v_sysrootpath&"inc/htmlclass"
  	v_a5=v_sysrootpath&"weblogin/wmainsave"
  	v_a6=v_sysrootpath&"weblogin/mall/wprosave"
  	v_a7=v_sysrootpath&"weblogin/template/wlablesave"
	v_a8=v_sysrootpath&"weblogin/template/label/Malls_Label"
	v_a9=v_sysrootpath&"weblogin/template/label/Stores_Label"
	v_a10=v_sysrootpath&"weblogin/template/label/Articles_Label"
	v_a11=v_sysrootpath&"weblogin/template/label/Supply_Label"
	v_a12=v_sysrootpath&"Web_Taginterface/Web_MSClass"
	v_a13=v_sysrootpath&"Web_Taginterface/Web_ASClass"
	v_a14=v_sysrootpath&"Web_Taginterface/Web_NSClass"
	v_a15=v_sysrootpath&"Web_Taginterface/Web_GSClass"
	v_a16=v_sysrootpath&"Web_Taginterface/Public"
	v_a17=v_sysrootpath&"systemupdate"
  End Function  

 Function Getnolevelclass(tabname,cc_level,cc_id,cc_fid,pageurl)
	set rec=server.createobject("adodb.recordset")
	if cc_fid=0 then
		sql="select * from "&tabname&" where level="&cc_level&"  order by id asc"
	else
		sql="select * from "&tabname&" where level="&cc_level&" and fid="&cc_fid&" order by id asc"
	end if 

	rec.open sql,conn
	ii=1
	do while not rec.eof
		select case pageurl
			case "navi":
				tmpurl="html/class/category/category_"&rec("id")&".html"
			case "catelist":
				tmpurl="html/class/sort"&rec("id")&"/sort_"&rec("id")&"_1.html"
			case "discount","discount3","discount5","discount7","discount8" :
				tmpurl="html/discount/sort"&rec("id")&"/sort_"&rec("id")&"_1.html"
			case "newslist" :
				tmpurl="html/class/new"&rec("id")&"/new_"&rec("id")&"_1.html"
		end select 
  		str=str&"<tr>"
    		str=str&"<td height='14' align='right' valign='top'  background='"&rootpath&"images/array/service2.gif'  bgcolor='#FFFFFF'>"
		str=str&"<table width='180' border='0' cellspacing='0' cellpadding='0'>"
        	str=str&"<tr> "
        	str=str&" <td height='20'><strong><font color='#990000'>C"&ii&"</font></strong>.<a href='"&rootpath&tmpurl&"'>"&rec("name")&"</a> </td>"
       		str=str&" </tr>"
	if rec("id")=cc_id then
		str=str&getsclass(tabname,cc_id,pageurl)
	end if 
	      	str=str&"</table>"
	     	str=str&"</td>"
		str=str&"</tr>"
	rec.movenext
	ii=ii+1
	loop
	rec.close : set rec=nothing

	Getnolevelclass=str
  End Function

  Function Getsclass(tabname,cc_fid,pageurl1)
	set rec=server.createobject("adodb.recordset")
	sql="select * from "&tabname&" where fid="&cc_fid&" order by id asc"
	rec.open sql,conn
	ii=1
	do while not rec.eof 
		select case pageurl1
			case "navi"
				tmpurl="html/class/sort"&rec("id")&"/sort_"&rec("id")&"_1.html"
			case "catelist"
				tmpurl="html/class/sort"&rec("id")&"/sort_"&rec("id")&"_1.html"
			case "discount","discount3","discount5","discount7","discount8" :
				tmpurl="html/discount/sort"&rec("id")&"/sort_"&rec("id")&"_1.html"
			case "newslist" :
				tmpurl="html/class/new"&rec("id")&"/new_"&rec("id")&"_1.html"
		end select 
 		str=str&"<tr>"
       		str=str&"<td align='right'>"
 		str=str&"<table width='165' border='0' cellspacing='0' cellpadding='0'>"
 		str=str&"<tr>"
 		str=str&"<td height='20'><strong>S"&ii&"</strong>.<a href='"&rootpath&tmpurl&"'>"&rec("name")&"</a> </td>"
 		str=str&"</tr>"
 		str=str&"</table>"
 		str=str&"</td>"
 		str=str&"</tr>"
	rec.movenext
	ii=ii+1
	loop
	rec.close : set rec=nothing

	Getsclass=str
  End Function
%> 

 
 

