<!--#include file="conn.asp"-->
<%
dim dlid
id=request.QueryString("id")
if id="" then id="0" 
if id="0" then dlname=""
xid=request.QueryString("xid")
if id<>"" and id<>"0" then
set npp=Server.CreateObject("ADODB.Recordset")
rspl="select * from Users where id="&id
npp.open rspl,connshop,1,2
dlname=npp("dname")
dljj=npp("djs")
npp.close
set npp=nothing
end if
%>

<%


call head()
Call saycarda(""&dlname&"的留言本")
%>
<!--#INCLUDE file="../bbs/sy1.asp"-->

<%if dlpd=1 then%>
<%=ubb2(dljj)%><br/>
<%end if%>
<!--以下提取属于本大类的商品并分页-->
<%
pag=10
set rsxl=Server.CreateObject("ADODB.Recordset")
rspl="select * from shop_ly where CStr(did)='"&id&"'"
rsxl.open rspl,connshop,1,2
if rsxl.eof then
   Response.write "暂无留言!!<br/>"
Else
page=cint(request.QueryString("page"))
if page="" or page<1 then page=1
maxpage=int((rsxl.recordcount-1)/pag)+1
if page>maxpage then page=maxpage

rsxl.Move((page-1)*pag)
dim j
j=1
do while ((not rsxl.EOF) and j <=cint(pag))
%>
<%=((page-1)*pag+j)%>.<a href='ly_view.asp?id=<%=rsxl("id")%>&amp;pagegg=<%=page%>&amp;sid=<%=sid%>'><%=ubb(rsxl("name"))%></a><%if len(rsxl("htxt"))<>"" then%>[已复]<%else%>[待阅]<%end if%>
<br/>
<%
rsxl.Movenext  
j=j+1
loop

if page*pag<rsxl.recordcount then response.write("<a href='tly.asp?id=" & id & "&amp;page=" & page+1 & "&amp;sid="&sid&"'>下一页</a>")
if page>1 then response.write("<a href='tly.asp?id=" & id & "&amp;page=" & page-1 & "&amp;sid="&sid&"'>上一页</a>")

if page*pag<rsxl.recordcount or page>1 then response.write("<br/>")
if page*pag<rsxl.recordcount then response.write("----------<br/>(第"& page & "页/共" & (int(rsxl.recordcount/pag+1)) &"页/总" & rsxl.recordcount & "条)<br/>")
end if
%>

-=-=-=-=-=-=-<br/>
<%if id<>"" and id<>"0" then%>
<a href='tdp.asp?sid=<%=sid%>&amp;id=<%=id%>'>回到他的商店</a><br/>
<%end if%>
[<a href="ly.asp?sid=<%=sid%>&amp;id=<%=id%>">我要留言</a>]<br/>
<!--#include file="fanhui.asp"-->
</p>
</card>
</wml>