<!--#include file="Include/Const.asp" -->
<!--#include file="Include/NoHackSql.Asp" -->
<!--#include file="Include/ConnSiteData.asp" -->
<%
call SiteInfo
headid=3
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
if request.QueryString("SortID")="" then
SeoTitle="新闻动态"
elseif not IsNumeric(request.QueryString("SortID")) then
SeoTitle="参数错误"
elseif conn.execute("select * from LiangJing_NewsSort Where ViewFlag and  ID="&request.QueryString("SortID")).eof then
SeoTitle="参数错误"
else
set rs = server.createobject("adodb.recordset")
sql="select * from LiangJing_NewsSort where ViewFlag and ID="&request.QueryString("SortID")
rs.open sql,conn,1,1
SeoTitle=rs("SortName")
rs.close
set rs=nothing
end if
%>
<!--#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">
<div id=best-sc>
<div class=best-tb>
<a style="width:80px">当前位置：</a>
<%=WebLocation()%>
</div>
</div>
<div id=bests>
<table cellspacing="0" cellpadding="0" width="100%" bgcolor="#ffffff" border="0" height="">
    <tbody>
        <tr>
            <td align="center">
<%=WebContent("LiangJing_NewsSort",request.QueryString("SortID"),"")%>
            </td>
        </tr>
    </tbody>
</table>
</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>
<ul>
<%Call WebMenu(0,0,2)%>
</ul>
</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 WebMenu(ParentID,i,level)
  dim rs,sql
  set rs = server.createobject("adodb.recordset")
  sql="select * from LiangJing_NewsSort where ViewFlag and ParentID="&ParentID&" order by ID asc"
  rs.open sql,conn,1,1
  if conn.execute("select ID from LiangJing_NewsSort Where ViewFlag and ParentID=0").eof then
    response.write "暂无相关信息"
  end if
  do while not rs.eof
  	If ISHTML = 1 Then
		AutoLink = ""&NewSortName&""&Separated&""&rs("ID")&""&Separated&"1."&HTMLName&""
	Else
		AutoLink = "NewsList.asp?SortID="&rs("ID")&""
	End If
	if ParentID=0 then
	  response.write "<Li>  <img src=""image/Tx_Ar3.gif"" style=""margin-left:5px;"" /> <a href="""&AutoLink&""" target=""_blank"" style=""margin-left:5px;"">"&rs("SortName")&"</a></li>"
	else
	  response.write "<Li>  <img src=""image/Tx_Ar3.gif"" style=""margin-left:5px;"" /> <a href="""&AutoLink&""" target=""_blank"" style=""margin-left:5px;"">"&rs("SortName")&"</a></li>"
	end if
    i=i+1
	if i<level then call WebMenu(rs("ID"),i,level)
	i=i-1
	rs.movenext
  loop 
  rs.close
  set rs=nothing
end Function


function LiangjingCMSEMail()

       Response.Write "         <form action="""" method=""post"" name=""LiangjingCMSEmail"">"&VbCrLf
       Response.Write "      <div class=""mail_list_box_input_position"">"&VbCrLf
       Response.Write "          <input type=""text"" name=""LiangjingCMSSubscribe"" class=""mail_list_input"" onblur=""this.className='LiangjingCMSSubscribe';if(this.value==''){this.value='请输入您的Email地址';}"" onfocus=""this.className='LiangjingCMSSubscribe';this.focus();if(this.value=='请输入您的Email地址'){this.value='';}"" value=""请输入您的Email地址"" />"&VbCrLf
       Response.Write "        </div>"&VbCrLf
       Response.Write "        <div class=""mail_list_box_bt_position""><br /><span>"&VbCrLf
       Response.Write "   <input type=""image"" name=""Subscribe"" src=""images/bt_mail_list_01.png"" onclick=""document.LiangjingCMSEmail.action='Subscribe.Asp?Action=Add'"" />"&VbCrLf
       Response.Write "          </span>"&VbCrLf
       Response.Write "<span><input type=""image"" name=""Unsubscribe"" src=""images/tuiding_mail_list_01.png""  value=""退订"" onclick=""document.LiangjingCMSEmail.action='Subscribe.Asp?Action=Del'"" />"&VbCrLf
       Response.Write "          </span>"&VbCrLf
	   Response.Write "  	<div style=""height:6px;""></div> </div>"&VbCrLf
       Response.Write "       <div class=""clear""></div>"&VbCrLf
       Response.Write "      </form>"&VbCrLf
end Function


function WebLocation()
  WebLocation="<a href=""index.asp"">首页</a><a href=""NewsList.asp"" class=""agray"">新闻动态</a>"&VbCrLf
  if request.QueryString("SortID")="" then
    WebLocation=WebLocation
  elseif not IsNumeric(request.QueryString("SortID")) then
    WebLocation=WebLocation&"参数错误"
  elseif conn.execute("select * from LiangJing_NewsSort Where ViewFlag and  ID="&request.QueryString("SortID")).eof then
    WebLocation=WebLocation&"参数错误"
  else
    dim rs,sql
    set rs = server.createobject("adodb.recordset")
	sql="select * from LiangJing_NewsSort where ViewFlag and ID="&request.QueryString("SortID")
    rs.open sql,conn,1,1
	WebLocation=WebLocation&SortPathTXT("LiangJing_NewsSort",rs("ID"))
    rs.close
    set rs=nothing
  end if
end Function

function SortPathTXT(DataFrom,ID)
  dim rs,sql
  Set rs=server.CreateObject("adodb.recordset")
  sql="Select * From "&DataFrom&" where ViewFlag and ID="&ID
  rs.open sql,conn,1,1
  if not rs.eof Then
	If ISHTML = 1 Then
		AutoLink = ""&NewSortName&""&Separated&""&rs("ID")&""&Separated&"1."&HTMLName&""
	Else
		AutoLink = "NewsList.asp?SortID="&rs("ID")&""
	End If
	SortPathTXT=SortPathTXT(DataFrom,rs("ParentID"))&"<a href="""&AutoLink&""">"&rs("SortName")&"</a>"
  end if
  rs.close
  set rs=nothing
end function

function WebContent(DataFrom,ID,SortPath)
  dim rs,sql
  dim HideSort
  set rs = server.createobject("adodb.recordset")
  if ID="" then
	SortPath="0,"
  elseif not IsNumeric(ID) then
    response.write "<center>暂无相关信息</center>"
	exit function
  elseif conn.execute("select * from "&DataFrom&" Where ViewFlag and  ID="&ID).eof then
    response.write "<center>暂无相关信息</center>"
	exit function
  else
	SortPath=conn.execute("select * from "&DataFrom&" Where ViewFlag and  ID="&ID)("SortPath")
	conn.execute("update "&DataFrom&" set ClickNumber=ClickNumber+1 Where ID="&ID)
  end if
  sql="select * from "&DataFrom&" Where not(ViewFlag) and Instr(SortPath,'"&SortPath&"')>0"
  rs.open sql,conn,1,1
  while not rs.eof
	HideSort="and not(Instr(SortPath,'"&rs("SortPath")&"')>0) "&HideSort
    rs.movenext
  wend
  rs.close
  dim idCount
  dim pages
      pages=NewInfo
  dim pagec
  dim page
      page=clng(request("Page"))
  dim pagenc
      pagenc=5
  dim pagenmax
  dim pagenmin
  dim pageprevious
  dim pagenext
  datafrom="LiangJing_News"
  dim datawhere
	  datawhere="where ViewFlag and Instr(SortPath,'"&SortPath&"')>0 "&HideSort& " "
  dim sqlid
  dim Myself,PATH_INFO,QUERY_STRING
      PATH_INFO = request.servervariables("PATH_INFO")
	  QUERY_STRING = request.ServerVariables("QUERY_STRING")'
      if QUERY_STRING = "" then
	    Myself = PATH_INFO & "?"
	  elseif Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")=0 then
	    Myself= PATH_INFO & "?" & QUERY_STRING & "&"
	  else
	    Myself = Left(PATH_INFO & "?" & QUERY_STRING,Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")-1)
	  end if
  dim taxis
      taxis="order by id desc "
  dim i
  sql="select count(ID) as idCount from ["& datafrom &"]" & datawhere
  set rs=server.createobject("adodb.recordset")
  rs.open sql,conn,0,1
  idCount=rs("idCount")
  if(idcount>0) then
    if(idcount mod pages=0)then
	  pagec=int(idcount/pages)
   	else
      pagec=int(idcount/pages)+1
    end if
    sql="select id from ["& datafrom &"] " & datawhere & taxis
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,1
    rs.pagesize = pages
    if page < 1 then page = 1
    if page > pagec then page = pagec
    if pagec > 0 then rs.absolutepage = page
    for i=1 to rs.pagesize
	  if rs.eof then exit for
	  if(i=1)then
	    sqlid=rs("id")
	  else
	    sqlid=sqlid &","&rs("id")
	  end if
	  rs.movenext
    next
  end if
  if(idcount>0 and sqlid<>"") then
    sql="select * from ["& datafrom &"] where id in("& sqlid &") "&taxis
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,0,1
	Response.Write "<table width=""98%"" border=""0"" align=""center"" cellspacing=""0"" cellpadding=""0"">"&VbCrLf
	Response.Write "  <tr height=""32"">"&VbCrLf
	Response.Write "    <td width=""550"" align=""left"" style=""color:#000000; font-weight:bold; no-repeat right center; background-color:#F7FCFF"">&nbsp;&nbsp;&nbsp;&nbsp;信息标题</td>"&VbCrLf
	Response.Write "    <td align=""right"" bgcolor=""#F7FCFF"" style=""color:#000000; font-weight:bold"">发布日期</td>"&VbCrLf
	Response.Write "  </tr>"&VbCrLf
    while not rs.eof
	If ISHTML = 1 Then
		AutoLink = ""&NewName&""&Separated&""&rs("ID")&"."&HTMLName&""
	Else
		AutoLink = "NewsView.asp?ID="&rs("ID")&""
	End If
	Response.Write "  <tr height=""28"">"&VbCrLf
	Response.Write "    <td align=""left"" style=""background:url(Images/bg2.gif) repeat-x left bottom;"">&nbsp;<img src=""images/arr.gif"" align=""absmiddle"" />&nbsp;&nbsp;<a href="""&AutoLink&""">"&rs("NewsName")&"</a></td>"&VbCrLf
	Response.Write "    <td align=""center"" style=""background:url(Images/bg2.gif) repeat-x left bottom; color:#999999"">"&FormatDate(rs("Addtime"),13)&"</td>"&VbCrLf
	Response.Write "  </tr>"&VbCrLf
	rs.movenext
    wend
	Response.Write "</table>"&VbCrLf
  else
    response.write "<center>暂无相关信息</center>"
	exit function
  end if
  Response.Write "<table width=""98%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"&VbCrLf
  Response.Write "  <tr height=""35"">"&VbCrLf
  Response.Write "    <td align=""center"">"&VbCrLf
  Response.Write "共<strong style=""color:red"">"&idcount&"</strong>条记录 页次：<strong style=""color:red"">"&page&"</strong>/"&pagec&" 每页：<strong style=""color:red"">"&pages&"</strong>条记录" & vbCrLf
  pagenmin=page-pagenc
  pagenmax=page+pagenc
  if(pagenmin<1) then pagenmin=1
  If ISHTML = 1 Then
  If ID = "" Then
  if(page>1) then response.write ("<a href="""&NewSortName&""&Separated&"1."&HTMLName&""" title=""回到第一页""><font face=""webdings"" color=""#000000"">9</font></a> ")
  Else
  if(page>1) then response.write ("<a href="""&NewSortName&""&Separated&""&ID&""&Separated&"1."&HTMLName&""" title=""回到第一页""><font face=""webdings"" color=""#000000"">9</font></a> ")
  End If
  Else
  if(page>1) then response.write ("<a href="""& myself &"Page=1"" title=""回到第一页""><font face=""webdings"" color=""#000000"">9</font></a> ")
  End If
  if page-(pagenc*2+1)<=0 then
	pageprevious=1
  else
	pageprevious=page-(pagenc*2+1)
  end If
  If ISHTML = 1 Then
  If ID = "" Then
  if(pagenmin>1) then response.write ("<a href="""&NewSortName&""&Separated&""&pageprevious&"."&HTMLName&""" title=""第"& pageprevious &"页""><font face=""webdings"" color=""#000000"">3</font></a> ")
  Else
  if(pagenmin>1) then response.write ("<a href="""&NewSortName&""&Separated&""&ID&""&Separated&""&pageprevious&"."&HTMLName&""" title=""第"& pageprevious &"页""><font face=""webdings"" color=""#000000"">3</font></a> ")
  End If
  Else
  if(pagenmin>1) then response.write ("<a href="""& myself &"Page="& pageprevious &""" title=""第"& pageprevious &"页""><font face=""webdings"" color=""#000000"">3</font></a> ")
  End If
  if(pagenmax>pagec) then pagenmax=pagec
  for i = pagenmin to pagenmax
	if(i=page) then
	  response.write ("&nbsp;<strong style=""color:red"">"& i &"</strong>&nbsp;")
	Else
	If ISHTML = 1 Then
	If ID = "" Then
		response.write ("[<a href="""&NewSortName&""&Separated&""&i&"."&HTMLName&""">"& i &"</a>]")
	Else
		response.write ("[<a href="""&NewSortName&""&Separated&""&ID&""&Separated&""&i&"."&HTMLName&""">"& i &"</a>]")
	End If
	Else
		response.write ("[<a href="""& myself &"Page="&i&""">"& i &"</a>]")
	End If
	end if
  next
  if page+(pagenc*2+1)>=pagec then
    pagenext=pagec
  else
    pagenext=page+(pagenc*2+1)
  end If
  If ISHTML = 1 Then
  If ID = "" Then
  if(pagenmax<pagec) then response.write (" <a href="""&NewSortName&""&Separated&""&pagenext&"."&HTMLName&""" title=""跳转到第"&pagenext&"页""><font face=""webdings"" color=""#999999"">:</font></a> ")
  if(page<pagec) then response.write (" <a href="""&NewSortName&""&Separated&""&pagec&"."&HTMLName&""" title=""跳转到第"&pagec&"页""><font face=""webdings"" color=""#000000"">:</font></a>")
  Else
  if(pagenmax<pagec) then response.write (" <a href="""&NewSortName&""&Separated&""&ID&""&Separated&""&pagenext&"."&HTMLName&""" title=""跳转到第"&pagenext&"页""><font face=""webdings"" color=""#999999"">:</font></a> ")
  if(page<pagec) then response.write (" <a href="""&NewSortName&""&Separated&""&ID&""&Separated&""&pagec&"."&HTMLName&""" title=""跳转到第"&pagec&"页""><font face=""webdings"" color=""#000000"">:</font></a>")
  End If
  Else
  if(pagenmax<pagec) then response.write (" <a href="""& myself &"Page="& pagenext &""" title=""跳转到第"&pagenext&"页""><font face=""webdings"" color=""#999999"">:</font></a> ")
  if(page<pagec) then response.write (" <a href="""& myself &"Page="& pagec &""" title=""跳转到第"&pagec&"页""><font face=""webdings"" color=""#000000"">:</font></a>")
  End If
  Response.Write "    </td>"&VbCrLf
  Response.Write "  </tr>"&VbCrLf
  Response.Write "</table>"&VbCrLf
  rs.close
  set rs=nothing
end function
%>