<%


if request.QueryString("id")="" or isnumeric(request.QueryString("id"))=0 then
response.Redirect("index.asp")
response.End()
end if

%><%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
else
if session("flag")>1 then
response.Write "<p align=center><font color=red>您没有此项目管理权限！</font></p>"
response.End
end if
end if
%>

<!--#include file="ljconn.asp"-->
<link href="../main.css" rel="stylesheet" type="text/css" />

<%
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from lyb where sfhy=0 and id="&request.querystring("id")&" order by id desc",conn,1,1
if rs.recordcount=0 then
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect("index.asp")
response.end()
end if
fbr=rs("fbr")
title=rs("title")
content=rs("content")
adddate=rs("adddate")
rs.close
set rs=nothing

link="&id="&request.QueryString("id")&""

function HTMLEncodew(fString)
	fString = Replace(fString,CHR(32),"&nbsp;")
	fString = Replace(fString,">","&gt;")
	fString = Replace(fString,"<","&lt;")
	fString = Replace(fString,CHR(10) & CHR(10),"</P><P>")
	fString = Replace(fString,CHR(10),"<BR>")
	HTMLEncodew = fString
end function





%>
<script type="text/javascript"> 
<!--
function FormCheck(thisform)
{
     if(checkspace(thisform.title.value)) {
	thisform.title.focus();
    alert("标题是必填项!");
	return (false);
  }
     if(checkspace(thisform.content.value)) {
	thisform.content.focus();
    alert("内容是必填项!");
	return (false);
  }

}
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
//-->
</script>


<style type="text/css">
<!--
.STYLE1 {font-size: 14px}
.STYLE3 {font-size: 12px}
-->
</style>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="6"></td>
  </tr>
</table>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1"></td>
    <td width="1" background="images/nyline.jpg"></td>
    <td width="3"></td>
    <td align="center" valign="top"><table width="100%" border="0" align="right" cellpadding="0" cellspacing="0">
      <tr>
        <td height="8" align="right"><table width="99%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="1" background="images/csdh7.jpg"></td>
              </tr>
          </table></td>
      </tr>
      <tr>
        <td height="12"></td>
      </tr>
      <tr>
        <td align="center" valign="top">
        
        <table width="95%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
          <tr>
            <td height="25" align="center" bgcolor="#FFFFFF"><table width="98%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="left"><span class="STYLE3"><img src="../images/xf.jpg" width="13" height="10" />&nbsp; <span style="color:#ff6600;"><%=fbr%></span> 于 <%=adddate%> 发表留言如下：</span></td>
                <td align="right"><a href="delbbs.asp?flag=ly&id=<%=request.QueryString("id")%>" class="STYLE3" onClick="return confirm('删除此留言吗!')">删除此留言</a></td>
              </tr>
            </table>              </td>
          </tr>
          <tr>
            <td height="25" align="center" bgcolor="#FFFFFF"><table width="98%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="left" class="STYLE3"><span style="font-weight:bold;"><%=title%></span></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="25" align="center" bgcolor="#FFFFFF"><table width="98%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="left" class="STYLE3" style="line-height:23px;"><%=HTMLEncodew(content)%></td>
              </tr>
            </table></td>
          </tr>
        </table>
        
        
        <table width="95%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="5"></td>
          </tr>
        </table>
<%
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from hfly where sfhy=0 and lyid="&request.QueryString("id")&" order by id desc",conn,1,1
page=1 ' 设置变量PAGE=1
rs.PageSize = 10 '每页显示记录数
if Not IsEmpty(Request.QueryString("Page")) then '如果PAGE已经初始化...
if isnumeric(request.QueryString("page"))=0 then
response.Redirect("index.asp")
response.End()
end if
Page = CInt(Request.QueryString("Page")) '接收PAGE并化为数字型赋给PAGE变量
if Page > rs.PageCount then '如果接收的页数大于总页数
rs.AbsolutePage = rs.PageCount '设置当前显示页等于最后页
elseif Page <= 0 then '如果page小于等于0
Page = 1 '设置PAGE等于第一页
else
rs.AbsolutePage = Page '如果大于零,显示当前页等于接收的页数 
end if
End if
Page = rs.AbsolutePage 

if rs.recordcount=0 then
else
for i=1 to rs.pagesize
%> 
        <table width="95%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
          <tr>
            <td height="25" align="center" bgcolor="#FFFFFF"><table width="98%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="74%" align="left" class="STYLE3"><img src="../images/xf1.jpg" width="13" height="10" />&nbsp; <span style="color:#ff6600;"><%=rs("fbr")%></span> 于 <%=rs("adddate")%> 发表回复如下：</td>
                  <td width="26%" align="right" class="STYLE3"><a href="delbbs.asp?flag=hf&id=<%=rs("id")%>&lyid=<%=request.QueryString("id")%>" class="STYLE3" onClick="return confirm('删除该回复吗!')">删除此回复</a></td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td height="25" align="center" bgcolor="#FFFFFF"><table width="98%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td align="left" class="STYLE3"><span style="font-weight:bold;"><%=rs("title")%></span></td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td height="25" align="center" bgcolor="#FFFFFF"><table width="98%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td align="left" class="STYLE3" style="line-height:23px;"><%=rs("content")%></td>
                </tr>
            </table></td>
          </tr>
        </table>
        <table width="95%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="5"></td>
          </tr>
        </table>
        <%
rs.movenext
if rs.eof then exit for
next
%>        
        <table width="95%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="5"></td>
          </tr>
          <tr>
            <td align="center"><%if rs.recordcount<=10 then%>
  
<%else%>
<%if page=1 or page<1 then%>
<%end if%>
<%if page>1 then%>
<a href="?Page=<%=page-1%><%=link%>"><span class="style1">上一页</span></a>
<%end if%>
<!--//-->

<!--当前页面前，循环显示4页-->
<%
'1-4页要特殊对待
if page>1 then a=1 
if page>2 then a=2
if page>3 then a=3
if page>4 then a=4
if page>5 then a=5
if page>6 then a=6
if page>7 then a=7
if page>8 then a=8
if page>9 then a=9
'当前页面前，循环显示4页
for i=page-a to page-1 %>
<a href="?Page=<%=i%><%=link%>">[<%=i%>]</a>
<% next %>

<!--当前所在页面-->
<%=page%>
<!--//-->

<!--当前页面后，循环显示4页-->
<%
for i=page+1 to page+8
if i>rs.PageCount then exit for
%>
<a href="?Page=<%=i%><%=link%>">[<%=i%>]</a>
<%
next
%>
<!--//-->
<!--控制最后一张图片，有没有下一页-->
<% if page=rs.PageCount or page>rs.PageCount then %>
<% else %><a href="?Page=<%=page+1%><%=link%>"><span class="style1">下一页</span></a>
<% end if %>
<%end if%></td>
          </tr>
          <tr>
            <td height="5"></td>
          </tr>
        </table>
        <%
end if
rs.close
set rs=nothing
%></td>
      </tr>
      <tr>
        <td height="8"></td>
      </tr>
    </table></td>
  </tr>
</table>

<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center"><a href="javascript:window.close();" class="STYLE3">[关闭]</a></td>
  </tr>
</table>
<%
conn.close
set conn=nothing
%>