<!--#include file="Include/Const.asp" -->
<!--#include file="Include/ConnSiteData.asp" -->
<!--#include file="Include/NoHackSql.Asp" -->
<%
Call SiteInfo
If ISHTML = 1 Then
Response.expires = 0
Response.expiresabsolute = Now() - 1
Response.addHeader "pragma", "no-cache"
Response.addHeader "cache-control", "private"
Response.CacheControl = "no-cache"
End If
Headid=0
Dim ShopID
%>
<!-- #include file="Head.asp" -->
<div id='index_wrapper'>
<div style="clear:both;background-image:url('images/mybuzhou.jpg');width:800px;height:85px;margin-bottom:10px;" id="mySitep">
<div style="height:20px;margin-bottom:26px;text-align:right;" ><div onclick="stepcoclose()" style="width:20px;height:20px;cursor:pointer;float:right">&nbsp;</div></div>
<div style="clear:both;font-size:14px;font-weight:bold;color:#5A552B;">
<div style="width:100px;float:left;">&nbsp;</div>
<div style="width:200px;float:left;">查看今日团购价</div>
<div style="width:36px;float:left;">&nbsp;</div>
<div style="width:200px;float:left;">付款并获得优惠凭证码</div>
<div style="width:66px;float:left;">&nbsp;</div>
<div style="width:180px;float:left;">凭优惠凭证码享受超级折扣</div>
</div>
</div>
<div id=best-r class="best" style="width:586px;float:left;clear:both;">
<div id=bests>
<%Call Products("0,",1,1,20,62,"Products")%>
</div>
</div>
<div style="width:200px; float:right;">
<div id=best-r class="best" style="width:200px; float:right;">
<div id=best-sc>
<div class=best-tb>
<a style="width:80px;font-size:14px;font-weight:bold;">商家信息</a>
<span id="sishowsitep" onclick="stepcoclose1()" style="display:none;padding-top:7px;padding-left:6px;"><font style="color:red;">查看步骤</font></span>
</div>
</div>
<div id=bests>
<script language="javascript" src=" http://api.51ditu.com/js/maps.js " ></script>
<script language="javascript" src="http://api.51ditu.com/js/ezmarker.js"></script>
<table cellpadding="0" cellspacing="0" width="100%px">
<%
If ShopID="" Or ShopID=0 Then 
    response.write("<tr><td align=""center"">")
    Response.Write "暂时没有商家信息"
    response.write("</td></tr>")
    response.write("</table>")
    response.write("</div>")
Else 
Call ShopMessage(ShopID)
End If 
%>
<div id=best-sc>
<div class=best-tb>
<a style="width:80px;font-weight:bold;">团购答疑</a>       
</div>
</div>
<div id=bests>
<table cellpadding="0" cellspacing="0" width="100%px">
<tr><td>
<%Call News("0,1,",6)%>
</td></tr>
</table>
</div>


</div>
<div id=best-r class="best" style="width:200px; float:right;margin-top:10px;">
<div id=best-sc>
<div class=best-tb>
<a style="width:80px;font-size:14px;font-weight:bold;">信息订阅</a>       
</div>
</div>

<div id=bests>
<table cellpadding="0" cellspacing="0" width="100%px" style="padding:6px;">
<tr><td align="center">
<% Call LiangjingCMSEMail() %>
</td></tr>
</table>

</div>
</div>
</div>
<div style="clear:both;;*display:inline;overflow:;hidden;">
</div>
<div style="float:none;height:10px;"></div>
</div></div>
</div></div>
<!--#include file="Foot.asp"-->
<%
function News(SortPath,number)
  dim rs,sql,NewsName,NewFlag
  set rs = server.createobject("adodb.recordset")
  sql="select top "&number&" * from LiangJing_News where ViewFlag"&" and Instr(SortPath,'"&SortPath&"')>0 order by id desc"
  rs.open sql,conn,1,1
  if rs.eof then
 Response.Write"<li class=""newslist"">暂无相关信息</li>"
  Else
Dim i
i=1
Response.Write "<ul style=""width:180px;"">"
 do while not rs.eof
	  if now()-rs("AddTime")<=2 then 
	    NewsName=StrLeft(rs("NewsName"),20)
	    NewFlag=" <img src=""Images/new.gif"" align=""absmiddle"">"
	  else
	    NewsName=StrLeft(rs("NewsName"),20)
	    NewFlag=""
	  end If
		If ISHTML = 1 Then
			AutoLink = ""&NewName&""&Separated&""&rs("ID")&"."&HTMLName&""
		Else
			AutoLink = "NewsView.asp?ID="&rs("id")&""
		End If
  Response.Write"<li style=""font-size:14px;text-align:left;width:160px;height:18px""><img src='images/"&i&".jpg'/><a href="""&AutoLink&""" target=""_self"" style=""font-size:13px"">"&NewsName&"</a></li>"
      rs.movenext
	  i=i+1
    loop 
  end If
  Response.Write "</ul>"
  rs.close
  set rs=nothing
end Function

'商家信息
Function ConstShop(id)
  dim rs,sql
  set rs = server.createobject("adodb.recordset")
  sql="select * from liangjing_Shops where ID="&id&" and Working"
  rs.open sql,conn,1,1
  if rs.bof and rs.eof then
    response.write("暂无商家信息")
  Else 
    response.write("<div style=""padding-top:6px;""><p class=""MsoNormal""><span style=""font-family:微软雅黑;""><strong>"&rs("Company")&"</strong></span></p>")
    response.write("<p class=""MsoNormal""><span style=""font-family:微软雅黑;"">"&rs("Disdcoration")&"</span></p>")
    response.write("<p class=""MsoNormal""><span style=""font-family:微软雅黑;"">商家客服电话：</span><span lang=""EN-US"">"&rs("Telephone")&"</span></p>")
    response.write("<p class=""MsoNormal""><span style=""color:red;font-family:微软雅黑;"">本商家和商品已经过<span lang=""EN-US"">"&ComName&"</span>的严格审核，您可放心购买。</span></p></div>")
  End If 
  rs.close
  set rs=nothing
end Function 



Function ShopMessage(id)
  dim rs,sql
  set rs = server.createobject("adodb.recordset")
  sql="select * from liangjing_Shops where ID="&id&" and Working"
  rs.open sql,conn,1,1
  if rs.bof and rs.eof then
    response.write("暂无商家信息")
	response.write("</table>")
    response.write("</div>")
  Else 
    response.write("<div style=""padding:6px;""><p class=""MsoNormal""><span style=""font-family:宋体;"">商家名称：<strong>"&rs("Company")&"</strong></span></p>")
	response.write("<p class=""MsoNormal""><span style=""font-family:宋体;"">在线客服：</span><span lang=""EN-US"">"&rs("ShopQQ")&"<a href=""tencent://message/?uin="&rs("ShopQQ")&"&amp;Site="&ComName&"&amp;menu=yes""><img border=""0"" alt="""&rs("ShopQQ")&""" src=""images/qqon2.gif"" /></a></span></p>")
    response.write("<p class=""MsoNormal""><span style=""font-family:宋体;"">"&rs("Disdcoration")&"</span></p>")
    response.write("<p class=""MsoNormal""><span style=""font-family:宋体;"">商家电话：</span><span lang=""EN-US"">"&rs("Telephone")&"</span></p>")
    response.write("<p class=""MsoNormal""><span style=""font-family:宋体;"">商家手机：</span><span lang=""EN-US"">"&rs("Mobile")&"</span></p>")
	response.write("<p class=""MsoNormal""><span style=""font-family:宋体;"">商家网址：</span><span lang=""EN-US""><a href="&rs("HomePage")&" >"&Replace(rs("HomePage"),"http://","")&"</a></span></p>")
	response.write("<p class=""MsoNormal""><span style=""font-family:宋体;"">商家地址：</span><span lang=""EN-US"">"&rs("Address")&"</span></p>")
    response.write("<p class=""MsoNormal""><span style=""color:red;font-family:宋体;"">本商家和商品已经过<span lang=""EN-US"">"&ComName&"</span>的严格审核，您可放心购买。</span></p></div>")
	response.write("</table>")
    response.write("</div>")
    response.write("<div id=best-sc>")
    response.write("<div class=best-tb>")
    response.write("<a style=""width:80px;font-weight:bold;"">商家地图</a>")       
    response.write("</div>")
    response.write("</div>")
    response.write("<div id=bests>")
    response.write("<table cellpadding=""0"" cellspacing=""0"" width=""100%px"">")
    response.write("<tr><td align=""center"" style=""background-color:#F2EFE8;"">")
%>
<div style='position:relative;text-align:center;z-index:1000;font-size:12px; overflow: hidden;margin-left:120px; background-image:url(images/bg_ckbg.gif); border:1px #666666 solid'><a href="BigMap.asp?BigMap=<%=rs("SiteMap")%>"  target="_blank">
<font color=#000000 style="font-size:12px;">查看大图</font></a></div>
<div id="myMap" style="width:190px; height:198px; margin:0px;padding:0xp;" >
</div>
<input type="hidden" id="myemAp" value="<%=rs("SiteMap")%>">
<script language="javascript"> 
var maps = new LTMaps( "myMap" );
var icon = new LTIcon();
 
var point = new LTPoint(<%=rs("SiteMap")%>)
maps.centerAndZoom (point ,3);
 
var marker1 = new LTMarker( new LTPoint(<%=rs("SiteMap")%>) , icon );
maps.addOverLay( marker1 );
 
var text = new LTMapText( point );
text.setLabel( "<div style='padding:6px'><%=rs("Company")%></div>"); 
maps.addOverLay( text ); 
//maps.handleKeyboard(); //键盘操作支持
maps.handleMouseScroll();//鼠标滚轮支持
var control1 = new LTSmallMapControl();//标准缩放控件
maps.addControl( control1 );
</script>

<%
    response.write("</td></tr>")
    response.write("</table>")
    response.write("</div>")

  End If 
  rs.close
  set rs=nothing
End Function  


'最新产品展示
Function Products(SortPath,trs,tds,PicW,PicH,Oderder)
  dim rs,sql,tr,td,ProductName,SmallPicPath
  Dim yy,y, m, d, h, mi, s
  set rs = server.createobject("adodb.recordset")
  If Oderder="Products" Then
  sql="select top "&trs*tds&" * from liangjing_Products where Stock>0 and Instr(SortPath,'"&SortPath&"')>0 order by AddTime desc"
  Else 
  sql="select top "&trs*tds&" * from liangjing_Products where NewFlag  and Instr(SortPath,'"&SortPath&"')>0 order by "&Oderder&" desc,id desc"
  End If 
  rs.open sql,conn,1,1
  if rs.eof then
    response.write "暂无相关信息"
  Else
	for tr=1 to trs

        for td=1 to tds
		  ChildCount=conn.execute("select count(*) from liangjing_Order where IsokMoney=true and ProductNo='"&rs("ProductNo")&"'")(0)
	      if StrLen(rs("ProductName"))<=18 then
            ProductName=rs("ProductName")
	      else
	        ProductName=Left(rs("ProductName"),26)
	      end If
			If ISHTML = 1 Then
				AutoLink = ""&ProName&""&Separated&""&rs("ID")&"."&HTMLName&""
			Else
				AutoLink = "ProductView.asp?ID="&rs("id")&""
			End If
			SmallPicPath=HtmlSmallPic(rs("GroupID"),rs("SmallPic"),rs("Exclusive"))
 If IsDate(rs("EndTime")) Then 
  yy = CStr(Year(rs("EndTime")))
  y = Mid(CStr(Year(rs("EndTime"))),3)
  m = CStr(Month(rs("EndTime")))
  If Len(m) = 1 Then m = "0" & m
  d = CStr(Day(rs("EndTime")))
  If Len(d) = 1 Then d = "0" & d
  h = CStr(Hour(rs("EndTime")))
  If Len(h) = 1 Then h = "0" & h
  mi = CStr(Minute(rs("EndTime")))
  If Len(mi) = 1 Then mi = "0" & mi
  s = CStr(Second(rs("EndTime")))
  If Len(s) = 1 Then s = "0" & s
End If 
%>
<div style="font-size:14px;font-weight:bold;padding-left:6px;"><div style="padding:3px;"><font style="color:<%=rs("TitleColor")%>"><%=ProductName%></font></div></div>
<div style="width:360px;float:left;">
<div><img src="<%=SmallPicPath%>" width="350px" height="280" style="margin-left:5px;margin-right:5px;margin-top:0px;padding-top:0px;padding-left:2px;padding-right:2px;border:#cccccc 1px solid;"/></div>
</div>
<div style="width:220px;float:right;">
<div id="Productright" class="goumai" style="height:80px;padding:0px;" >
<%If CInt(rs("Stock"))<0 Or CInt(rs("Stock"))=0 Then %>
<div style="background-image:url('images/maiguangl.jpg');width:196px;height:80px;"></div>
<%
Else 
If CDate(rs("EndTime"))<Now() Then %>
<div style="background-image:url('images/buyjieshu.jpg');width:196px;height:80px;"></div>
<%else%>
<%if session("MemName")="" or session("GroupID")="" or session("MemLogin")<>"Succeed" Then%>
<div style="background-image:url('images/buy.jpg');width:196px;height:80px;">
<a href="login.asp" style="margin:0px;padding:0px">
<div style="width:196px;height:78px;text-align:right;font-size:12px;">
<div style="height:33px;"></div>
现价:<font style="color:red;"><%=Formatnumber(rs("N_Price")-rs("P_Price"),2,-1,-1,0)%>￥</font></div>
</a></div>
<%Else%>
<div style="background-image:url('images/buy.jpg');width:196px;height:80px;">
<a href="ProductBuy.asp?ProductNo=<%=rs("ProductNo")%>" style="margin:0px;padding:0px">
<div style="width:196px;height:78px;text-align:right;font-size:12px;">
<div style="height:33px;"></div>
现价:<font style="color:red;"><%=Formatnumber(rs("N_Price")-rs("P_Price"),2,-1,-1,0)%>￥</font></div>
</a></div>
<%End If %>
<%
End If 
End If 
%>
</div>
<div id="Productright" class="Prefertxt">
<ul class="listproright">
<li style="width:30px">原价</li>
<li style="width:30px">折扣价</li>
<li style="width:30px">节省</li>
</ul>
<ul class="listproright">
<li style="width:30px"><%=rs("N_Price")%> ￥</li>
<li style="width:30px"><%=rs("K_Price")%> 折</li>
<li style="width:30px"><%=rs("P_Price")%> ￥</li>
</ul>
</div>
<div>

<%If CDate(rs("EndTime"))<Now() Then %>
<div class="lasttime">
<div style="height:16px;">&nbsp;</div>
<div>
 		本团购结束于:<br />
    	<b><%=yy%></b>年<b><%=m%></b>月<b><%=d%></b>日<b><%=h%></b>点<b><%=s%></b>分
		</div>

</div>

<%Else%>


<div class="lasttime">
<div style="height:16px;">&nbsp;</div>
<div>
 		剩余时间: <br/>
 		<b><span id='leftTime220'></span></b>天<b><span id='leftTime221'></span></b>小时<b><span id='leftTime222'></span></b>分钟<b><span id='leftTime223'></span></b>秒
		</div>
</div>

<script type="text/javascript">
<!--   
startclock();   
var timerID = null;   
var timerRunning = false;     
function showtime() { 
	Today = new Date();   
	var NowHour = Today.getHours();   
	var NowMinute = Today.getMinutes();   
	var NowMonth = Today.getMonth();   
	var NowDate = Today.getDate();   
	var NowYear = Today.getYear();   
	var NowSecond = Today.getSeconds();   
	if (NowYear <2000){  
		NowYear=1900+NowYear;   
	}
	Today = null;   
	Hourleft = <%=h%>- NowHour   
	Minuteleft = <%=mi%>- NowMinute   
	Secondleft = <%=s%> - NowSecond   
	Yearleft = <%=yy%> - NowYear   
	Monthleft = <%=m%> - NowMonth - 1   
	Dateleft = <%=d%>- NowDate   
	if (Secondleft<0) {   
		Secondleft=60+Secondleft;   
		Minuteleft=Minuteleft-1;   
	}   
	if (Minuteleft<0){    
		Minuteleft=60+Minuteleft;   
		Hourleft=Hourleft-1;   
	}   
	if (Hourleft<0){   
		Hourleft=24+Hourleft;   
		Dateleft=Dateleft-1;   
	}   
	if (Dateleft<0){   
		Dateleft=31+Dateleft;   //todo
		Monthleft=Monthleft-1;   
	}   
	if (Monthleft<0){   
		Monthleft=12+Monthleft;   
		Yearleft=Yearleft-1;   
	} 
	
	replaceText('leftTime220',Dateleft);   
	replaceText('leftTime221',Hourleft);   
	replaceText('leftTime222',Minuteleft);   
	replaceText('leftTime223',Secondleft);  
	timerID = setTimeout("showtime()",1000);   
	timerRunning = true;   
} 
function stopclock () {   
	if(timerRunning) {  
		clearTimeout(timerID);   
	}
	timerRunning = false;   
}   
function startclock () {   
	stopclock();   
	showtime();   
}   
// -->
</script>

<%End If %>

</div>
<div  id="Productright" class="goumai" style="height:40px;border:#ddd 1px solid" ><div style="padding:10px;">已经订购人数：<%=ChildCount%></div></div>
</div>

<div style="clear:both;padding:4px;border:#cccccc 1px solid;width:560px;margin-left:5px;font-size:14px;">
<%=rs("SeoDescription")%>
</div>

<div style="clear:both;padding:4px">
<div style="width:350px;float:left;">
<div style="width:156px;float:left;margin-left:6px;padding:6px;">
<h2 style="font-weight:bold;font-size:14px;">特色推荐</h2>
<%=rs("ContentT")%>
</div> 

<div style="width:156px;float:right;padding:6px;">
<h2 style="font-weight:bold;font-size:14px;">使用说明</h2>
<%=rs("ContentS")%>
</div>
</div>


<div style="width:220px;float:right">
<%=ConstShop(rs("ShopID"))%>
</div>

</div>


<div style="clear:both;padding:4px">
<div style="padding:6px;">
<%=rs("Content")%>
</div>

</div>
</div>
<%
ShopID=rs("ShopID")
	 rs.movenext
		  if rs.eof then exit for
		next


		if rs.eof then exit for
	Next
  end if
  rs.close
  set rs=nothing
End Function

'最新产品展示
Function ListProducts(SortPath,trs,tds,PicW,PicH,Oderder)
  dim rs,sql,tr,td,ProductName,SmallPicPath
  set rs = server.createobject("adodb.recordset")
  If Oderder="Products" Then
  sql="select top "&trs*tds&" * from liangjing_Products where Instr(SortPath,'"&SortPath&"')>0 and [AddTime] between dateadd('ww',-1,now()) and now() order by AddTime desc"
  Else 
  sql="select top "&trs*tds&" * from liangjing_Products where NewFlag  and Instr(SortPath,'"&SortPath&"')>0 order by "&Oderder&" desc,id desc"
  End If 
  rs.open sql,conn,1,1
  if rs.eof then
    response.write "暂无相关信息"
  Else

	
	for tr=1 to trs
        for td=1 to tds
	      if StrLen(rs("ProductName"))<=18 then
            ProductName=rs("ProductName")
	      else
	        ProductName=rs("ProductName")
	      end If
			If ISHTML = 1 Then
				AutoLink = ""&ProName&""&Separated&""&rs("ID")&"."&HTMLName&""
			Else
				AutoLink = "ProductView.asp?ID="&rs("id")&""
			End If
			SmallPicPath=HtmlSmallPic(rs("GroupID"),rs("SmallPic"),rs("Exclusive"))
		ChildCount=conn.execute("select count(*) from liangjing_Order where IsokMoney=true and ProductNo='"&rs("ProductNo")&"'")(0)
Response.Write "<tr><td align=""center"">"
Response.Write " <div id=""mian_border"">"
Response.Write "<div id=""mian_border_title""><a href="""&AutoLink&""">"&ProductName&"</a></div>"
Response.Write "<div id=""mian_border_1""><a href="""&AutoLink&""" target=""_blank"">"
Response.Write "<img src="""&SmallPicPath&""" alt="""" width="""&PicW&""" height="""&PicH&""" border=""0""></a></div>"
Response.Write "<div><font style=""color:red;font-size:16px;"">"&ChildCount&"</font>人已订购 <a href="""&AutoLink&"""><img src=""images/dinggou.jpg"" width=""75px"" height=""25px""></a></div>"
Response.Write "</div>"
Response.Write " </td></tr>"
	      rs.movenext
		  if rs.eof then exit for
		next
		if rs.eof then exit for
	Next
  end if
  rs.close
  set rs=nothing
End Function




'在线客服
function qqa()
Dim connQQstr,connQQ,rssetupQQ,qqonline,adm_qq,adm_qq_name,whereqq,kefuskin,qqskin,qqmsg_on,qqmsg_off,QQ_NAME,QQ,MyQQ,N,sitename
connQQstr = "Provider=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE="&SERVER.MAPPATH("QQ/QQ.mdb")
Set connQQ=server.CreateObject("adodb.connection")
connQQ.Open connQQstr
Set rssetupQQ=connQQ.execute("select * from QQsetup") 
qqonline=rssetupQQ("qqonline")
adm_qq= rssetupQQ("adm_qq")
adm_qq_name= rssetupQQ("adm_qq_name")
whereqq=rssetupQQ("whereqq")
kefuskin=rssetupQQ("kefuskin")
qqskin=rssetupQQ("qqskin")
qqmsg_on=rssetupQQ("qqmsg_on")
qqmsg_off=rssetupQQ("qqmsg_off")
msn= rssetupQQ("msn")
msn_name= rssetupQQ("msn_name")
set rssetupQQ=Nothing
QQ_NAME=split(adm_qq_name,",")
QQ=split(adm_qq,",")

for N=0 to UBound(QQ)
Response.write "<li><a target=blank href=tencent://message/?uin="&QQ(n)&"&Site=QQ:"& QQ(n)&"&Menu=yes><img border=""0"" SRC=""Image/QQon4.gif"" alt="&QQ(n)  &">QQ:"& QQ_NAME(n)&"</a></li>"
next
Response.write "<li><a target=blank href=""msnim:chat?contact="&msn&"&Site="&msn&"""><img border=""0"" SRC=""Image/msn.gif"" alt="&msn&" >"&msn&"</a></li>"
if adm_qq<>"" and qqonline=1 then
adm_qq=replace(adm_qq,"，",",")
if isnull(adm_qq_name) or adm_qq_name="" then adm_qq_name=adm_qq
adm_qq_name=replace(adm_qq_name,"，",",")
QQ_NAME=split(adm_qq_name,",")
QQ=split(adm_qq,",")

for N=0 to UBound(QQ)

next
End if
end function
%>