<!--#include file="../conn.asp" -->
<%
if session("admin")="" then
Response.Write("<script language=JavaScript>alert('对不起,您没有权限使用该功能!!');history.back();</script>")
response.end
end if%>

<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from diary where good=1 order by diaryid desc"
rs.open sql,conn,3,1


rs.pagesize=50
maxpage=rs.pagecount
page=clng(request("page"))


if page="" or page=0 then
   page=1
end if
if page>maxpage then
    page=maxpage
end if
rs.absolutepage = page

%>
<html>
<!--以下是双击滚屏的代码-->
<script language=JavaScript>
var currentpos,timer; 
function initialize() 
{ 
timer=setInterval("scrollwindow()",10);
} 
function sc()
{
clearInterval(timer); 
}
function scrollwindow() 
{ 
currentpos=document.body.scrollTop; 
window.scroll(0,++currentpos); 
if (currentpos != document.body.scrollTop) 
sc();
} 
document.onmousedown=sc
document.ondblclick=initialize
</script>
<!--双击滚屏的代码结束-->

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 2</title>
<link href="images/style.css" rel="stylesheet" type="text/css">
</head>

<body  style="OVERFLOW:hidden;OVERFLOW-X:HIDDEN;OVERFLOW-y:auto;background-color=transparent" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">

        <div align="center">

        
  <table width="100%" border="1" cellpadding="0" cellspacing="0"  bordercolor="#d7f5ff" bordercolordark="#FFFFFF" id="table1" bordercolorlight="#dddddd">
    <tr bgcolor="ecfbff"> 
          
      <td width="76" align="center" background="images/center_title_bg.jpg" height="34">日记ID</td>
          
      <td width="145" background="images/center_title_bg.jpg" align="center">用户ID</td>
          <td width="571" background="images/center_title_bg.jpg">日记标题</td>
          
      <td width="65" background="images/center_title_bg.jpg" align="center">管理</td>
		  
		  
          <td width="86" background="images/center_title_bg.jpg">
			
        <p align="center">取消推荐
      </td>
		  
		  
        </tr>
        <%
do while not rs.eof
%>
        <tr> 
          <td align="center" nowrap><%=rs("diaryid")%></td>
          
      <td nowrap align="center"><font color=red><span style="font-weight: 400"><%=rs("userid")%></span></font></td>
          <td height="22"><a target="_blank" href=../u/play.asp?id=<%=rs("diaryid")%>>
			<font color=#FF0000><span style="font-weight: 400">《<%=rs("title")%>》</span></font></a></td>
          
      <td width="65" align="center"> <font color="#FF0000"><span style="font-weight: 400">删除</span></font> 
      </td>
          <td width="86">
          <p align="center">
			<a href="ok.asp?action=delgood&diaryid=<%=rs("diaryid")%>" onclick="{if(confirm('您真的要去除推荐吗?!')){return true;}return false;}">去除推荐</a></td>
        </tr>
        <%
n=n+1
rs.movenext
if n>=rs.pagesize then exit do    
loop
%>

    <tr> 
      <td colspan="2" align="center" height="34" background="images/center_title_bg.jpg"> 
        <div align="center">
          <div align="center"></div>
          &nbsp;&nbsp; 共 <%=rs.recordcount%>篇 <%=rs.pagecount%>页</div>
        </td>
      <td width="65%" background="images/center_title_bg.jpg" align="center"> 
        <%
if cstr(page)=1 then
'Response.Write("←&nbsp;")
Response.Write("首页&nbsp;上页")
else
if page>1 and page=maxpage then%>
        <a href="admin_diary.asp?page=1">首页</a> <a href="admin_diary.asp?page=<%=page-1%>">上页</a> 
        <%end if%>
        <% if page<>1 and page<>maxpage then%>
        <a href="admin_diary.asp?page=1">首页</a> <a href="admin_diary.asp?page=<%=page-1%>">上页</a> 
        <%end if
end if

response.write ("&nbsp;<a href=admin_diary.asp?user="&user&"&page="&page&">当前第"&page&"页</a>")

if cstr(page)=cstr(rs.pagecount) then%>
        下页 尾页 
        <%else%>
        <%
			if cstr(page)=1 and cstr(page)<>cstr(rs.pagecount) and cstr(rs.pagecount)<>0 then%>
        <a href="admin_diary.asp?page=<%=page+1%>">下页</a> <a href="admin_diary.asp?page=<%=maxpage%>">尾页</a> 
        <%end if%>
        <%
			if cstr(page)<>1 and cstr(page)<>cstr(rs.pagecount) and cstr(rs.pagecount)<>0 then%>
        <a href="admin_diary.asp?page=<%=page+1%>">下页</a> <a href="admin_diary.asp?page=<%=maxpage%>">尾页</a> 
        <%end if%>
        <%end if%>
<%
response.Write("<select name='select' onchange='javascript:location.href=this.value;'>")
for i=1 to page-1
response.Write("<option value='admin_diary.asp?page="&i&"'>第"&i&"页</option>")
next
response.Write("<option value='admin_diary.asp?page="&page&"' selected>第"&i&"页</option>")
for j=page+1 to maxpage
response.Write("<option value='admin_diary.asp?page="&j&"'>第"&j&"页</option>")
next
response.Write("</select>")%>
      </td>
      <td colspan="2" background="images/center_title_bg.jpg" align="center"> 
        <center>
          <font color=green><span style="font-weight: 400">50篇/页</span></font> 
        </center>
      </td>
    </tr>
        </table>
        
      	
</div>
</body>

</html>
